Netduino home hardware projects downloads community

Jump to content


The Netduino forums have been replaced by new forums at community.wildernesslabs.co. This site has been preserved for archival purposes only and the ability to make new accounts or posts has been turned off.
Photo

About reading IR signals from remotes


  • Please log in to reply
3 replies to this topic

#1 starlight

starlight

    New Member

  • Members
  • Pip
  • 5 posts

Posted 08 October 2011 - 06:34 PM

hi, I just got my Visual Studio 2010 and started hacking last night, so please pardon my uber noobness. I want to record IR signals from my remotes. I measured the signals from an IR receiver diode at about 50 kHz, and saw from the ARM processor data sheet that the Netduino A/D channels can handle 384 KHz. I then wrote the following extremely sophisticated code (you can see I am a jeanous :))- public static void Main() { OutputPort led = new OutputPort(Pins.ONBOARD_LED, false); AnalogInput a5 = new AnalogInput(Pins.GPIO_PIN_A5); led.Write(true); // turn on the LED for (int x = 0; x < 100000; x++) { a5.Read(); } led.Write(false); // turn off the LED } I compiled as RELEASE version and let it run. From my stop watch, the blue LED turned on for about 28-31 seconds and then turned off. This means that Im only able to sample about 3,800 times per second, but my remote is throwing signals at 50,000 times per second (as I measured on my OScope). So, this is my summary why I believe this IR capture will never work with Netduino, but its my first project so likely completely wrong. I would like to know where I went wrong, if so- 384.0 KHz : Netduino hardware sampling capability 3.8 KHz : Microsoft .NET Micro sampling capability on the Netduino hardware 50.0 KHz : What my remote appears to be transmitting signals at Does .NET microframework or whatever its called really subtract two orders of magnitude performance from Netduino's hardware? If so, it seems I need a Netduino with a clock speed of 3.8x = 50; x = 50/3.8 = 13 times present speed of 48 MHz, so 625 MHz to handle simple IR remotes, and 5 GHz to realize the full potential of the ARM processor's A/D channels. I sit now in the smoldering wreckage of my first project wondering wtf I went wrong. Can someone please clue me in? I would appreciate it. In return you get this good laugh at my ignorance. Thanks

#2 CW2

CW2

    Advanced Member

  • Members
  • PipPipPip
  • 1592 posts
  • LocationCzech Republic

Posted 08 October 2011 - 07:57 PM

I want to record IR signals from my remotes. I measured the signals from an IR receiver diode at about 50 kHz, and saw from the ARM processor data sheet that the Netduino A/D channels can handle 384 KHz.

Although Netduino microcontroller is rather powerful, the performance of managed code is significantly lower, because it is interpreted (unlike in 'full' .NET Framework, where Just-In-Time (JIT) compiler translates IL opcodes into assembly). But in all likelihood, 50 kHz is the modulation frequency, you can easily use IR receiver with built-in demodulator or band-pass filter, so you don't have to sample the input signal at such rates. The demodulated output timing depends on particular IR protocol, it is usually slower (~milliseconds) and this can be recorded using interrupts. For example, there is already RC6 decoder and NEC protocol decoder.

#3 starlight

starlight

    New Member

  • Members
  • Pip
  • 5 posts

Posted 08 October 2011 - 08:11 PM

Although Netduino microcontroller is rather powerful, the performance of managed code is significantly lower, because it is interpreted (unlike in 'full' .NET Framework, where Just-In-Time (JIT) compiler translates IL opcodes into assembly). But in all likelihood, 50 kHz is the modulation frequency, you can easily use IR receiver with built-in demodulator or band-pass filter, so you don't have to sample the input signal at such rates. The demodulated output timing depends on IR particular protocol, it is usually slower (~milliseconds) and this can be recorded using interrupts. For example, there is already RC6 decoder and NEC protocol decoder.



#4 starlight

starlight

    New Member

  • Members
  • Pip
  • 5 posts

Posted 08 October 2011 - 08:18 PM

Thank you for your most helpful reply! :D It is good to know such limitations..they are just so astonishing at first that they are hard to believe! :rolleyes: have a good day




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users

home    hardware    projects    downloads    community    where to buy    contact Copyright © 2016 Wilderness Labs Inc.  |  Legal   |   CC BY-SA
This webpage is licensed under a Creative Commons Attribution-ShareAlike License.