NEC IR remote code

This conference allows discussion on any subject not already covered in another PICmicro conference. If a topic becomes popular enough, a new conference will be created for it.

Re: NEC IR remote code

Postby yeryant » Thu Nov 01, 2018 1:46 pm

ric wrote:
Entropy wrote:
ric wrote:So do you know what to do now?

not yet, that toggle bit is a problem for me, ... _Protocol/ that purple thing between field and address

Have you got the concept that it toggles between zero and one, every time there is a new keypress?
Therefore, if a key is held down, it keeps sending the same code without the toggle bit changing. It still may be 0 or 1, depending upon the number of previous key presses.

even Saleae is confused by it, this is a few tries I did for long button press and short clicks: , notice at the short clicks where the toggle is different, Saleae analyzer dont know where the adsress-command is anymore.

That is probably because the toggle bit is twice the width of the rest of the databits, as documented on that page.

Yesterday I was thinking for a normal bit:
1. check the status of the pin if is low or high
2. start a timer up to 883µs
3. if an intrerrupt occurs and the timer is bellow lets say 490µs then check the status of the pin again
4. make a small case scenario like HIGH then LOW = 1 LOW->HIGH = 0 and store the result somewhere
5. 398µs after the intrerupt, it mean that the bit is done and resets the timer from point 2. Also this can be used to recalibrate(sync?) the timers. I notice that the timers vary even 5µs between bits. Puting 883µs on a fix loop probably will go wild after a while

Yes, you need to be tolerant of speed variation, so resynchronising on each edge is a good idea.

I also get your Point Thanks!
Posts: 1
Joined: Thu Nov 01, 2018 1:43 pm


Return to Other PICmicro topics

Who is online

Users browsing this forum: No registered users and 2 guests