This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

Generating IR pulses using msp430 valueline device

Hi...

I need to regenerate the IR pulses from a IR decoder using msp430 timer. Basically I would read the IR pulse stream any protocol (NEC or RC5) and then again generate it using timer PWM or delay between edges.

Which is the best method with least latency so that my IR detection in timer capture does not get affected at the same time due to regeneration of IR pulse. Is it possible using timer compare mode or do i need to possibly generate delays between edges of 1s and 0's thereby sending 32 bits approx 25 ms for NEC packet.

Thanks and regards,

Harshit

  • MSP430 can neither detect nor generate IR pulses. In order to do what you want, you need to have something that translates IR pulses into electric pulses and something that translates electric pulses into IR pulses.

    What things are you going to use?

    Once you have those two things, you can connect the electric output from one to the electric input of the other. You do not need the MSP430.

  • Hi..

    Thnks for the reply. I am interested in the baseband signal which is produced by the IR sensor and I want it to be feeded to another device which accepts IR pulses. In this way I can send only desired IR codes to the targeted device by using only one IR decoder

    In short i want to generate the demodulated signal, not idesired to generated the modultaed signal with carrier wave. I want to regenerate the NEC pulse code which is produced by the IR decoder. This signal would be fed to the MSP430 timer capture input for detection. After detecting the desired code, I require to regenerate the same IR NEC code using port pin of MSP430 so that I can feed it to the targeted device IR input pin.

    One method was to use blocking delay function to generate IR demodulated pulse stream in the main loop. But would be affected if another IR code is captured in ISR at the background.

    Can I effiiciently generate the same using compare mode and if yes then how...

    regards,

    Harshit

  • Wait... you want to build IR repeater which does not change data but just "amplify" received IR signal?

    Then why you need msp430? - Connect IR receiver to powerful IR transmitter and it's done.

  • If the IR receiver generates an electric signal indicating the presence/absence of sub-carrier (i.e., the envelope of IR pulse train), then you do need to re-generate that sub-carrier and modulate it to drive an IR transmitter. MSP430G2xx can do it assuming the sub-carrier frequency is below 100kHz.

  • Hi old_cow_yellow...

    Thanks for your reply. Let me make you clear my requirement....

    old_cow_yellow said:
    If the IR receiver generates an electric signal indicating the presence/absence of sub-carrier (i.e., the envelope of IR pulse train), then you do need to re-generate that sub-carrier and modulate it to drive an IR transmitter.

    I do not want to regenerate the modulated IR pulse train. The targeted device is also a microcontroller with a timer capture pin. So basically 2 controllers and one IR detector. Controller 1 will sense all the IR codes from front end and will regenerate the desired IR codes for the targeted micrcontroller. I would have connected the IR detector output to another micrcontroller too, but I do not want the second controller to unnecessarily scan the undesired IR codes not meant for it.

    I hope now the picture is clear. Now i wanted to know if I can regenerate the IR code (the pulses which is generated by the IR detector) using timer module of msp430 instead of using the delay function after toggling the port pin. I want to do this without any blocking delay functions, becoz doing so will disturb the NEC pulse width timings. Here the pulse timing is critical.

    Regards,

    Harshit

  • That is fine too.

  • Hello Harshit,

    How is the original IR signal being generated?  

    If you are generating the IR code, then you can add an address to the signal similar to a multifunction remote that can control the TV, DVD, etc.  Each MCU would only accept the codes addressed to it.

    A project I did in the past used the RC-5 protocol to transmit data to multiple controllers using IR over a 50 meter distance with standard IR LEDs and IR detector.  This was the only option because the environment was too electrically noisy to use RF.

    Thanks,

  • Hello Greenja,

    greenja said:
    A project I did in the past used the RC-5 protocol to transmit data to multiple controllers using IR over a 50 meter distance with standard IR LEDs and IR detector.  This was the only option because the environment was too electrically noisy to use RF.

    Can u pls share ur experiences... did u use blocking delay functions or u used the timer .

    Thanks and Regards,

    Harshit Jain

  • I used timers for the transmitter and timers for the receiver.  The asm file was converted to C and followed the exact same steps, just substitute the timers in the app note for the ones on your MCU.  There are app notes from TI for IR generation, but I found these to be the simplest for understanding just how everything was set up and why.  If you are using Keil, you can actually trace the output on the simulator to see exactly how the trace would look on an oscilloscope.  I'm not sure about the IAR or CCS simulator.

    In your code you would add the address, data length, data, checksum, similar to a standard data packet.  This now gives you a complete wireless data communication system.  Just add more IR transmitter LEDs to increase the range.

    If you are have the option of generating the IR signal, then this would be an option to follow.

    Thanks,

  • harshit said:
    I do not want to regenerate the modulated IR pulse train. The targeted device is also a microcontroller with a timer capture pin. So basically 2 controllers and one IR detector.

    Inter-IC communication using IR protocol? Strange solution. I would understand such approach if you are "hacking" 3rd party device having IR receiver to filter or modify it's IR commands for some reason (kid's protection for example). Otherwise why don't you let both uC's filter their commands? Or just use i2c or some other serial "baseband" protocol between uC's - if both are running your code?

  • Yes, strange solution indeed!

    Why would anyone want to have a cheap and effective method of sending information from their remote to their TV when you could just run a wire to it.  Better yet why not get up and change the channel yourself?  

    Why would I want to be able to program one device and allow it to communicate with many others when I could have 5 remotes on my desk?

    Why would I want an inexpensive way to send audio to my headphones, data to my printer when I could just plug it in?

    Now the big question is why would anyone want to adapt this solution to fast LED technology and use it as an alternative network solution?

    BECAUSE it's cheap and if your analysis of the methods of communication vs price and effectiveness for you application justify it, then you use it.

**Attention** This is a public forum