EDIT:
This is now available as library at GitHub
[Link]
The following Teensy 3 Pins are usable:
It chooses the correct timer & channel automatically.
Clock Source is FLL, so the lib is independend of F_CPU.
--------------------------------------------------
Hi,
more than 4 years ago, i published in a german forum (mikrocontroller.net) bit of source for an universal IR-receiver. The original code was for STM32.
This version is for Tennsy 3.
Theoretically it can handle almost any protocol.
The idea is to ignore the protocol, and instead to measure only the cycles. These are stored in a table, normalized, and processed with a 32-bit hash.
The "output" is this 32-Bit hash-value, so every key on your remote(s) has its own 32-Bit value.
Advantages over "normal" algorithms:
- Only at the end of the last bit a bit is calculated, so the CPU-usage is minimal. The interrupt (pin-change) uses the lowest priority.
- It works without change for almost every remote control, the manufacturer of the remote does not matter. Every family member can use his onw remote control
- very short code.
Mostly I've used a "Sony" remote control (for a DIY-webradio) with an TSOP1136 as receiver-ic.
This is now available as library at GitHub
[Link]
The following Teensy 3 Pins are usable:
Code:
IR_PIN 3 // FTM1_CH0
IR_PIN 4 // FTM1_CH1
IR_PIN 5 // FTM0_CH7
IR_PIN 6 // FTM0_CH4
IR_PIN 9 // FTM0_CH2
IR_PIN 10 // FTM0_CH3
IR_PIN 16 // FTM1_CH0
IR_PIN 17 // FTM1_CH1
IR_PIN 20 // FTM0_CH5
IR_PIN 21 // FTM0_CH6
IR_PIN 22 // FTM0_CH0
IR_PIN 23 // FTM0_CH1
IR_PIN 24 // FTM0_CH2
IR_PIN 25 // FTM2_CH1
IR_PIN 32 // FTM2_CH0
IR_PIN 33 // FTM0_CH1
It chooses the correct timer & channel automatically.
Clock Source is FLL, so the lib is independend of F_CPU.
--------------------------------------------------
Hi,
more than 4 years ago, i published in a german forum (mikrocontroller.net) bit of source for an universal IR-receiver. The original code was for STM32.
This version is for Tennsy 3.
Theoretically it can handle almost any protocol.
The idea is to ignore the protocol, and instead to measure only the cycles. These are stored in a table, normalized, and processed with a 32-bit hash.
The "output" is this 32-Bit hash-value, so every key on your remote(s) has its own 32-Bit value.
Advantages over "normal" algorithms:
- Only at the end of the last bit a bit is calculated, so the CPU-usage is minimal. The interrupt (pin-change) uses the lowest priority.
- It works without change for almost every remote control, the manufacturer of the remote does not matter. Every family member can use his onw remote control
- very short code.
Mostly I've used a "Sony" remote control (for a DIY-webradio) with an TSOP1136 as receiver-ic.
Last edited: