You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
ArduinoCIR provides the ir\_messaging library, a ready-to-use solution for sending/receiving consumer IR (remote-control) signals on the Arduino platform.
7
+
ArduinoCIR provides the ir\_messaging library, a ready-to-use solution for sending/receiving consumer IR (remote-control) signals on Arduino platforms.
8
8
9
9
<aname="SupportedHW"></a>
10
10
### Supported Hardware
11
11
12
-
Only a single chipset is supported at the moment: the ATmega2560. Nonetheless, ir\_messaging was designed to be extensible to other Arduino platforms. Of course, no effort was yet placed on the mechanics of *how* to conditionally build for different platforms.
13
-
14
-
- Arduino Mega 2560 / Arduino Mega ADK.
12
+
ArduinoCIR was designed to support multiple Atmel platforms. At the moment, only a few are supported:
13
+
14
+
- Atmel ATmega328/328P
15
+
- Arduino Uno
16
+
- Arduino Redboard (Tested)
17
+
- Arduino Pro
18
+
- Arduino Fio
19
+
- Arduino Mini
20
+
- Arduino Nano
21
+
- Arduino LilyPad
22
+
- Arduino BT
23
+
- Arduino Ethernet
24
+
- Atmel ATmega1280
25
+
- Arduino Mega
26
+
- Atmel ATmega2560
27
+
- Arduino Mega 2560 (Tested)
28
+
- Arduino Mega ADK (Tested)
15
29
16
30
### Supported Protocols
17
31
18
32
The list of supported protocols is listed below. Note that certain protocols might only be implemented for either transmit (tx) or receive (rx).
19
33
20
-
-**NEC**: (tx/untested rx).
34
+
-**NEC**: (tx/rx).
21
35
-**RC-MM**: (tx only).
22
36
-**RC-5**: (untested tx/untested rx).
23
37
-**Sony SIRC**: (untested tx/rx).
@@ -26,18 +40,18 @@ New protocols can be added to [libraries/ir\_messaging/ir\_protocol.cpp](librari
26
40
27
41
### Purpose (Is there not IRremote already?)
28
42
29
-
Indeed, the IRremote library already exists to interface Arduino platforms with consumer IR products. The main differating factor of the ir\_messaging library is that it does not hardcode which timer/IO pin is used.
43
+
Indeed, the IRremote library already exists to interface Arduino platforms with consumer IR products. The main differating factor of the ir\_messaging library is that it does not hardcode the allocation of hadware timers.
30
44
31
45
Here are a few advantages of ir\_messaging:
32
46
33
47
-*Designed* to simultaneously transmit & receive IR messages.
34
48
- Last version of IRremote I checked used the same timer hardware for both transmit & receive (contention). Moreover, the trival time-interleaved (tx ⇔ rx) solution is not very robust.
35
49
- Easier to select which timers & I/O pins to use for transmit/receive function.
36
50
- No need to read/modify core library files.
37
-
- Can be easily deduced from sample sketches (+ minimal info about hardware timers).
51
+
- Hardware select can be easily deduced from sample sketches (+ minimal knowldege of hardware timers).
38
52
- Uses `IRMsg` class to simplify API (protocol, data & message length stay together).
39
53
- More modular approach to supporting different chipsets.
40
-
- Seems to be a more robust solution (but cannot remember exact reason why that is).
54
+
- Seems to be a *slightly*more robust solution (but cannot remember exact reason why that is).
41
55
42
56
Untested advantages:
43
57
@@ -50,38 +64,28 @@ Untested advantages:
50
64
Definitely. There are a few reasons to use IRremote instead of the ir\_messaging library. Some that come to mind are listed below:
51
65
52
66
- At the moment, IRremote supports more IR protocols.
53
-
- Potentially a problem if the project *must* communicate with an un-supported protocol.
67
+
- Only an advantage if your project *must* communicate with a given (un-supported) protocol.
54
68
- NOTE: Possible to add support for other protocols in ir\_messaging.
55
69
- At the moment, IRremote supports more Arduino platforms.
56
-
- NOTE: Can use ATmega2560/ADK implementation as a model for adding platforms to ir\_messaging.
57
-
- IRremote uses `delayMicroseconds()` (Timer0) to modulate the transmit carrier (mark/space).
58
-
- Does not need a dedicated timer to implement modulation (less hardware).
59
-
- Might not be as comfortable making customizations to ir\_messaging library.
70
+
- Might not be as comfortable making customizations to the ir\_messaging library.
60
71
- Implementation makes heavy use of C++ constructs (ex: objects).
61
72
- Code is divided into more files (This might not fit the way you work).
62
73
- Object/module hierarchy is more elaborate than IRremote.
74
+
- Currently generates smaller binaries.
75
+
- Larger community for support.
63
76
64
77
## Sample Sketches
65
78
66
79
ir\_messaging provides 3 sample sketches under the [libraries/ir\_messaging/samples](libraries/ir_messaging/samples) sub-directory:
67
80
68
-
-**ir\_repeater**: Simple sketch that re-transmits valid incomming IR messages.
69
-
-**ir\_rx\_sniff**: Simple sketch that dumps recieved signal to serial output.
70
81
-**ir\_tx\_onbutton**: Simple sketch that transmits a hard-coded IR message when a button is pressed.
71
-
72
-
### Sample Sketch Pinouts
73
-
74
-
The sample sketches listed above come pre-configured for the ATmega2560/ADK using the following I/O configuration:
75
-
76
-
-**IR receiver module**: Pin 3.
77
-
-**IR transmitter diode**: Pin 5.
78
-
-**Push button**: Pin 2.
79
-
80
-
If, for whatever reason, this pin list cannot be located: simply load one of the sample sketches and read the serial monitor upon device reset. The sample sketches all dump the relevant software-configured pins.
82
+
-**ir\_rx\_sniff**: Simple sketch that dumps recieved signal to serial output.
83
+
-**ir\_repeater**: Simple sketch that re-transmits valid incomming IR messages.
84
+
- Note that this sketch only supports the Arduino Mega platforms. Due to interrupt priorities, platforms that use the system clock (Timer0) for modulating the IR output will not successfully receive all incomming signals. This task requires a bit more synchronization of the IR traffic.
81
85
82
86
## Usage Tips
83
87
84
-
### Atmel `timer0`: Time & Delays
88
+
### Atmel Timer0: Time & Delays
85
89
86
90
On what appears to be all Atmel chipsets, the Arduino software uses `timer0` to measure time & implement delays (`delay()`, `delayMicroseconds()`, `millis()`, `micros()`). Better not appropriate this timer for anything else.
87
91
@@ -114,9 +118,17 @@ Similarly, a wiring diagram for the *push button* signal required by the ir\_tx\
114
118
<aname="HWPinout"></a>
115
119
### Hardware/Pinout Selection
116
120
117
-
The ir\_messaging library is very flexible. It allows the user to control which timers/pin drive the IR transmitter, and which are used by the IR receiver.
121
+
The ir\_messaging library is relatively flexible. The IR receiver software can be configured to listen on any available pin. However, the **transmitter output pin** is controlled by whatever timer generates the **output carrier**:
118
122
119
-
Please refer to the appropriate [datasheet](#ArduinoDatasheets) for more details regarding the capabilities of your particular Arduino platform.
123
+
- ATmega328/328P
124
+
- Timer2: Pin 3.
125
+
- ATmega1280/2560
126
+
- Timer1: Pin 11.
127
+
- Timer2: Pin 9.
128
+
- Timer3: Pin 5.
129
+
- Timer4: Pin 6.
130
+
131
+
Please refer to the appropriate [datasheet](#Datasheets) for more details regarding the capabilities of your particular Arduino platform.
120
132
121
133
## Libraries (Dependencies)
122
134
@@ -137,6 +149,7 @@ The following lists a few key classes:
137
149
-**`IRCtrl::IRProtocol::pktInfo[]`**: Details how each consumer IR protocol transmits/receives IR messages.
138
150
139
151
And some low-level classes that might be useful for supporting more hardware:
152
+
140
153
-**`ArduinoHW::Timer16b::Timer` class**: Facilitates the control of 16-bit timers (hopefully works for most arduino platforms).
141
154
142
155
## Compiling
@@ -146,12 +159,15 @@ The ir\_messaging library was tested on the version 1.0.5+dfsg2-2 (Linux) of the
146
159
## Known Limitations
147
160
148
161
- IR receiver currently only works using a 16-bit timer (`IRCtrl::Timer16b::RxHw`).
149
-
- IR transmitter currently only works using *two* 16-bit timers (`IRCtrl::Timer16b::TxHw`).
162
+
- IR transmitter currently supports two resource allocations:
163
+
- System clock (Timer0) + an 8-bit timer (`IRCtrl::Timer8b::TxHw`),
164
+
- or *two* 16-bit timers (`IRCtrl::Timer16b::TxHw`).
150
165
- ...
151
166
152
167
## Resources/Acknowledgments
153
168
154
-
### Ken Shirriff
169
+
<aname="Shirriff_et_al"></a>
170
+
### Ken Shirriff (et al.)
155
171
156
172
Ken Shirriff's IRremote library provides an interesting solution to consumer IR (remote-control) communication. Ken's library is very inspiring:
157
173
@@ -169,12 +185,13 @@ The SB-Projects website contains useful information on selected consumer IR (rem
169
185
170
186
-**IR Remote Control Theory**: <http://www.sbprojects.net/knowledge/ir/index.php>
171
187
172
-
<aname="ArduinoDatasheets"></a>
173
-
### Arduino Datasheets
188
+
<aname="Datasheets"></a>
189
+
### Datasheets
174
190
175
-
The following list provides hyperlinks to some useful Arduino datasheets. Please note the chipset corresponding to your particular Arduino platform.
191
+
The following lists a few datasheets might be of use.
0 commit comments