Shawn Wilton wrote : > Now I just need someone to help me understand how you modulate that > output. I'm looking at the AP note. So you need to output some specific number of cycles of the carrier signal (as produced by the PWM module), right ? Probably a varying number of cycles depending on the data. > Do you modulate by just turning the damn thing on and off at > some other timer interval so you can produce a 1 that's shooting out a > pwm frequency greater than your modulation rate? First you must have a method to put the PWM output on/off. The AP note uses the TRIS bit of RB4 for this. Probably OK. > If that's the case, then how would you go about doing that? > Would this require a second timer that runs at some "baud rate" > that pulls data from a register and sends it out the pwm? You don't have to tie up a hole counter for this, just another software counter. Note that each "bit" wil be a specific number of periods of the PWM signal. So you can just as well count the number of PWM periods output and, when the correct number is reached, just shut of the PWM output. This can be done easily by using the "overflow interrupt" of the timer controling the PWM module. In the ISR you then just decrement a counter and, when it reach zero, shut the PWM output off. Using this method it's also easy to get clean on/off so you always gets whole and clean PWM pulses. You could either also control the "on" of the PWM in the ISR, or just monitor the "timer interrupt flag" somewhare else in your code. I used this concept in an IR sender using the PWM module to produce the 38Khz carrier, and using sequences of PWM pulses of different length to idicate "start", "1" and "0" bits. Looks very much the same as this application... Jan-Erik. -- http://www.piclist.com hint: PICList Posts must start with ONE topic: [PIC]:,[SX]:,[AVR]: ->uP ONLY! [EE]:,[OT]: ->Other [BUY]:,[AD]: ->Ads