NEC IR decoding issues (and another thread is closed)


Closed Thread
Results 1 to 5 of 5

Hybrid View

  1. #1
    Join Date
    Feb 2013
    Posts
    1,124


    Did you find this post helpful? Yes | No

    Default Re: NEC IR decoding issues (and another thread is closed)

    Fixed. Just dumped raw value of what is written BtnVal and it is either around 80 or 110, so I modified the code and now it works!
    But why so low values? due to slower PIC ?

  2. #2
    Join Date
    Oct 2005
    Location
    Sweden
    Posts
    3,612


    Did you find this post helpful? Yes | No

    Default Re: NEC IR decoding issues (and another thread is closed)

    The value returned by PULSIN for a specific pulse width is dependent of the speed at which the PIC runs.
    At 4MHz the resoulution is 10us, at 20MHz it's 2us (all according to the manual).

    This means that the PULSIN values corresponding to a logic "1" and "0" will be different depending on oscillator frequency.

    I reccon the code you copied comes from Bruce's post #18 in the thread? Is that correct?

  3. #3
    Join Date
    Feb 2013
    Posts
    1,124


    Did you find this post helpful? Yes | No

    Default Re: NEC IR decoding issues (and another thread is closed)

    Yes, correct.

    I tried to make this code respond faster, by changing the pause value from 1000 to 100 (works fine), but when I change it from 100 to 10, now it improperly detects half of the statements.

    I want to use this code to remote control a clock, and as I understand, PULSIN can't run in background, so it will be slowing down the clock routines, right? The clock code has to read from RTC, update display, check for alarms, adjust backlight leds and so on....

    As I understand, there will be a need to use timer somehow, for lead pulse detection, and based on it, interrupt will be generated and IR decoding code will be run?

  4. #4
    Join Date
    Nov 2003
    Location
    Greece
    Posts
    4,132


    Did you find this post helpful? Yes | No

    Default Re: NEC IR decoding issues (and another thread is closed)

    A fast ISR is the best way to go.

    But you may get away with other routes too.

    For example, if you read the RTC interrupt every second to update the time and test the other things you want. Finally read the IR code.

    Since IR transmission is not repeated quickly, you have plenty of time to do the above tasks. The worse that can happen is to loose one transmission but will grab the second.

    I believe your RTC does have an Interrupt output, so that MCU can be triggered, either poll or by interrupt regularly.

    Ioannis

Similar Threads

  1. Replies: 25
    Last Post: - 19th January 2018, 19:53
  2. 32 Bit NEC IR Constants/Variables
    By Zebryk in forum mel PIC BASIC Pro
    Replies: 3
    Last Post: - 23rd July 2013, 14:51
  3. Nec nl2432hc22-23b lcd touch screen
    By rondo2 in forum General
    Replies: 1
    Last Post: - 16th January 2011, 10:08
  4. NEC video character generator...
    By Brock in forum mel PIC BASIC Pro
    Replies: 0
    Last Post: - 7th November 2007, 22:58
  5. Closed loop control
    By BobEdge in forum General
    Replies: 0
    Last Post: - 16th February 2005, 09:49

Members who have read this thread : 1

You do not have permission to view the list of names.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts