On Tuesday 03 May 2005 06:44 pm, PicDude scribbled: > 26us will give you ~38.5khz which works well with a 38khz IR receiver > module, though I expect the range may not be as great as if you get > 26.3khz. I currently do this in a calculated loop (not in the ISR), bu= t my Oops -- meant 26.3us (not khz). > app is a keyfob transmitter with only a few different signals. If you = plan > to do much more in the PIC, you will probably need to run it at a highe= r > frequency. > > Cheers, > -Neil. > > On Tuesday 03 May 2005 06:02 pm, Tom Wrighton scribbled: > > ... My project is to make a small IR > > beacon as part of a robotic competition for navigation. I would like= to > > execute a small flashing LED countdown (one pulse each for 5 seconds) > > and than modulate an IR LED for 20 seconds. I think I have the TMR0 > > interrupt figured out and I can execute seconds timing and LED flashi= ng. > > My confusion comes in as follows: I=92m trying to use the internal R= C osc > > ( _INTRC_OSC_NOCLKOUT ) which I believe ends up at 1 us > > execution cycles. To achieve a 38KHz flash rate I need an interrupt > > every 26.3 us. This calculates to loading the TMR0 with something li= ke > > decimal 242 +/- 4 cycles for a half cycle at 38KHz. This does not le= ave > > me very many cycles left for the ISR. At this point I have tried to > > measure the > > frequency of the flashing LED with a Craftsman DMM that has a freq > > measurement capability. The best I can do so far is 32 and a fractio= n > > KHz. At this point I am wondering if I need to use a crystal osc. And= run > > it at 10 MHz instead of the 4Mhz of the internal? I have followed th= e > > PICLIST ... --=20 http://www.piclist.com PIC/SX FAQ & list archive View/change your membership options at http://mailman.mit.edu/mailman/listinfo/piclist