Recent

Author Topic: ccrause / fpc-avr: IR Example code, enough results for a IF statement?  (Read 1795 times)

pascalbythree

  • Sr. Member
  • ****
  • Posts: 292
https://github.com/ccrause/fpc-avr/blob/master/src/examples/IRcapture/ircapture.pp

Are these incoming values enough to start a IF statement  ? Or are there other problems seen with these results ?

If right, anybody got a example ?

Greets, Wouter van Wegen, PascalByThree

ccrause

  • Hero Member
  • *****
  • Posts: 1116
Re: ccrause / fpc-avr: IR Example code, enough results for a IF statement?
« Reply #1 on: October 15, 2023, 08:08:46 pm »
The common way is to decode the timing results into "marks" and "spaces", then interpret the mark/space sequences as bits, then check which button was pressed using its byte or word signature. Different protocols use different timings and encoding conventions, so identifying the protocol is useful to decoding the rest of the timing data.  This site has a good overview of IR remote control theory.  Details of a few protocols: SIRC, XSAT.  The XSAT timings look promising, but your timing data seems about 13% shorter (but this could just be the inaccuracy of the oscilllator of either your controller, or the IR remote).

If you cannot identify the protocol, you can still use a mark of ~480 us and a space of either 400 us for a "0" and 1200 us for a "1".  There appears to be a quiet space of 1300 us before (I assume) a repeat signal starts, with a signal header consisting of a 6800 us mark and a 1600 ms space. These timings are based on the screenshot in you first post.

pascalbythree

  • Sr. Member
  • ****
  • Posts: 292
Re: ccrause / fpc-avr: IR Example code, enough results for a IF statement?
« Reply #2 on: October 16, 2023, 10:11:35 am »
Shit, to difficult. Anybody got another unit? if i may ask ?  8-)

pascalbythree

  • Sr. Member
  • ****
  • Posts: 292
Re: ccrause / fpc-avr: IR Example code, enough results for a IF statement?
« Reply #3 on: October 16, 2023, 03:43:22 pm »
What is the MHZ to run the Controller?

ccrause

  • Hero Member
  • *****
  • Posts: 1116
Re: ccrause / fpc-avr: IR Example code, enough results for a IF statement?
« Reply #4 on: October 17, 2023, 06:57:33 am »
What is the MHZ to run the Controller?
The example assumes a CPU frequency of 16 MHz (see timer1 config). If the CPU frequency is not 16 MHz, the conversion of the timer ticks to time (here and here) needs to be adjusted to get accurate timing results.

 

TinyPortal © 2005-2018