> 13.15usec per half cycle. I don't think you have enough time to > save and restore context and reload timer0 at 4MHz, let alone > keep track of other timing. You could be right - as a straight 38kHz generator it would work but what's going to make it a tight squeeze at 4MHz is the testing and branching Maybe put a 32kHz xtal on Timer1 and use that to measure the 5 & 20 second intervals (T1 OSC available only if you use the internal osc), keeping TMR0 @ 4MHz just for the 38kHz Or even WDT + a timer ? OK OK, run it at 10MHz ;-) BTW Tom, I'd recommend ZTX transistors for driving IR LEDs. They switch faster and better and more current than other common types (eg TO92 like BCxxx or 2Nxxxx). Their higher current rating means a low value series R can be used eg 1 or 2 ohms for good range, but watch the wattage dissipated by the IR LED -- http://www.piclist.com PIC/SX FAQ & list archive View/change your membership options at http://mailman.mit.edu/mailman/listinfo/piclist