Hi Seb, Modulating accurate with 38kHz in software (with isr) is not so straight-forward as it seems. Especially since it means two interrupt for each cycle the interval gets quite short and reload time (from interrupt assertion up to that particular statement in the ISR) becomes relevant. Although you did not ask for any, my advise would be to use a timer with auto-reload (timer2 on 16f chips), convert the measured time into # of 38kHz cycles and have that ISR take it from there - create pulse and count down.
I do have some example (used to create a 40kHz ultrasonic pulse for position determination) laying around if you're interested. Joep 2011/7/24 Sebastien Lelong <[email protected]>: > OK, I guess this is because I don't modulate my 1s at 38KHz... > > 2011/7/24 Sebastien Lelong <[email protected]> >> >> Hi guys, >> Some progress, but more questions... I've been able to decode IR signals >> using TSOP4838, I can clearly identify my two distinct IR codes. I uses INT1 >> and 16-bits TMR3 to measure IR length. Values are stored in a array (only >> high bytes -- MSB -- values from the 16-bits timer, I think low bytes aren't >> relevant, they change on each try). >> Now I'd like to play back these IR codes. I have IR LEDs in my box, I >> think I need to add a transistor to drive these IR LEDs. From previous step, >> I have a table with TMR3 recorded values. I was thinking about loading back >> these values on TMR3 (max value - recorded value) and drive an IR LED on/off >> with interrupts. Well, doesn't seem to work, I guess this is again about >> modulation ? >> Do you have some more guidelines ? >> TIA >> Cheers, >> Seb >> >> >> 2011/6/18 William <[email protected]> >>> >>> Hi Seb, >>> >>> You're probably seeing the carrier - around 40KHz, so using a device >>> that demodulates the carrier would definitely help. They are cheap, >>> for example the PNA4612M. >>> >>> Have fun! >>> >>> William >>> >>> -- >>> You received this message because you are subscribed to the Google Groups >>> "jallib" group. >>> To post to this group, send email to [email protected]. >>> To unsubscribe from this group, send email to >>> [email protected]. >>> For more options, visit this group at >>> http://groups.google.com/group/jallib?hl=en. >>> >> >> >> >> -- >> Sébastien Lelong >> >> > > > > -- > Sébastien Lelong > > > -- > You received this message because you are subscribed to the Google Groups > "jallib" group. > To post to this group, send email to [email protected]. > To unsubscribe from this group, send email to > [email protected]. > For more options, visit this group at > http://groups.google.com/group/jallib?hl=en. > -- You received this message because you are subscribed to the Google Groups "jallib" group. To post to this group, send email to [email protected]. To unsubscribe from this group, send email to [email protected]. For more options, visit this group at http://groups.google.com/group/jallib?hl=en.
