Skip to content

Commit b461363

Browse files
committed
Documentation
1 parent cda97b5 commit b461363

File tree

1 file changed

+18
-10
lines changed

1 file changed

+18
-10
lines changed

README.md

Lines changed: 18 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ This is a quite old but maybe useful wiki for this library.
4545

4646

4747
# Converting your 2.x program to the 3.x version
48-
Starting with the 3.1 version, **the generation of PWM is done by software**, thus saving the hardware timer and **enabling arbitrary output pins**.<br/>
48+
Starting with the 3.1 version, **the generation of PWM for sending is done by software**, thus saving the hardware timer and **enabling arbitrary output pins for sending**.<br/>
4949
If you use an (old) Arduino core that does not use the `-flto` flag for compile, you can activate the line `#define SUPPRESS_ERROR_MESSAGE_FOR_BEGIN` in IRRemote.h, if you get false error messages regarding begin() during compilation.
5050

5151
- Now there is an **IRreceiver** and **IRsender** object like the well known Arduino **Serial** object.
@@ -160,8 +160,11 @@ ReceiveDemo + SendDemo in one program. **Receiving while sending**.
160160
### ReceiveAndSend
161161
Record and play back last received IR signal at button press.
162162

163-
### MinimalReceiver + SmallReceiver
164-
If code size matters, look at these examples.<br/>
163+
### SmallReceiver
164+
If code size matters, look at these example.<br/>
165+
166+
### MinimalReceiver
167+
The MinimalReceiver example uses the **TinyReceiver** library which can **only receive NEC codes, but does not require any timer**.<br/>
165168
MinimalReceiver can be tested online with [WOKWI](https://wokwi.com/arduino/projects/299034264157028877).
166169
Click on the receiver while simulation is running to specify individual IR codes.
167170

@@ -228,16 +231,19 @@ Digispark boards are tested with the recommended [ATTinyCore](https://github.com
228231
- ATtiny84, 85, 167 (Digispark + Digispark Pro)
229232
- SAMD (Zero, MKR*, **but not DUE, which is SAM architecture**)
230233
- ESP32
231-
- ESP8266. [This fork](https://github.com/crankyoldgit/IRremoteESP8266) supports an [impressive set of protocols](https://github.com/crankyoldgit/IRremoteESP8266/blob/master/SupportedProtocols.md).
234+
- ESP8266. [This fork](https://github.com/crankyoldgit/IRremoteESP8266) supports an [impressive set of protocols and a lot of air conditioners](https://github.com/crankyoldgit/IRremoteESP8266/blob/master/SupportedProtocols.md).
232235
- Sparkfun Pro Micro
233236
- Nano Every, Uno WiFi Rev2, nRF5 BBC MicroBit, Nano33_BLE
234237

235238
We are open to suggestions for adding support to new boards, however we highly recommend you contact your supplier first and ask them to provide support from their side.
236239

237240
# Timer and pin usage
238-
The receiver sample interval is generated by a timer. On many boards this must be a hardware timer, on some a software timer is available and used. The code for the timer and the timer selection is located in [private/IRTimer.cpp.h](https://github.com/Arduino-IRremote/Arduino-IRremote/blob/master/src/private/IRTimer.cpp.h).<br/>
241+
The **receiver sample interval is generated by a timer**. On many boards this must be a hardware timer, on some, where a software timer is available, it is used. The code for the timer and the **timer selection** is located in [private/IRTimer.cpp.h](https://github.com/Arduino-IRremote/Arduino-IRremote/blob/master/src/private/IRTimer.cpp.h).<br/>
242+
**Be aware that the hardware timer used for receiving is also used for analogWrite()!** E.g. <br/>
243+
The MinimalReceiver example uses the **TinyReceiver** library which can **only receive NEC codes, but does not require any timer**.<br/>
239244
Every pin can be used for receiving.<br/>
240-
The send PWM signal is by default generated by software. **Therefore every pin can be used for sending**. The PWM pulse length is guaranteed to be constant by using `delayMicroseconds()`. Take care not to generate interrupts during sending with software generated PWM, otherwise you will get jitter in the generated PWM. E.g. wait for a former `Serial.print()` statement to be finished by `Serial.flush()`. Since the Arduino `micros()` function has a resolution of 4 us at 16 MHz, we always see a small jitter in the signal, which seems to be OK for the receivers.
245+
246+
The **send PWM signal** is by default generated by software. **Therefore every pin can be used for sending**. The PWM pulse length is guaranteed to be constant by using `delayMicroseconds()`. Take care not to generate interrupts during sending with software generated PWM, otherwise you will get jitter in the generated PWM. E.g. wait for a former `Serial.print()` statement to be finished by `Serial.flush()`. Since the Arduino `micros()` function has a resolution of 4 us at 16 MHz, we always see a small jitter in the signal, which seems to be OK for the receivers.
241247

242248
| Software generated PWM showing small jitter because of the limited resolution of 4 us of the Arduino core `micros()` function for an ATmega328 | Detail (ATmega328 generated) showing 33% Duty cycle |
243249
|-|-|
@@ -248,13 +254,15 @@ If you define `SEND_PWM_BY_TIMER`, the send PWM signal is generated by a hardwar
248254
Since each hardware timer has its dedicated output pins, you must change timer to change PWN output.<br/>
249255
The timer and the pin usage can be adjusted in [private/IRTimer.cpp.h](https://github.com/Arduino-IRremote/Arduino-IRremote/blob/master/src/private/IRTimer.cpp.h)
250256

251-
| Board/CPU | Hardware-PWM Pin | Timers |
252-
|--------------------------------------------------------------------------|---------------------|-------------------|
257+
| Board/CPU | Hardware-PWM Pin | Receive<br/>& PWM Timers | analogWrite()<br/>pins disabled |
258+
|--------------------------------------------------------------------------|---------------------|-------------------|-----------------------|
253259
| [ATtiny84](https://github.com/SpenceKonde/ATTinyCore) | **6** | **1** |
254-
| [ATtiny85 > 4 MHz](https://github.com/SpenceKonde/ATTinyCore) | **1**, 4 | **0**, 1 |
260+
| [ATtiny85 > 4 MHz](https://github.com/SpenceKonde/ATTinyCore) | **0**, 4 | **0**, 1 | **0**, 1 & 4 |
261+
| [ATtiny88 > 4 MHz](https://github.com/SpenceKonde/ATTinyCore) | **PB1 / 8** | **1** | **PB1 / 8 & PB2 / 9** |
262+
| [ATtiny167 > 4 MHz](https://github.com/SpenceKonde/ATTinyCore) | **9** | **1** | **8 - 15** |
255263
| [ATtiny1604](https://github.com/SpenceKonde/megaTinyCore) | **PA05** | **TCB0** |
256264
| [ATmega8](https://github.com/MCUdude/MiniCore) | **9** | **1** |
257-
| [ATmega48, ATmega88, ATmega168, **ATmega328**](https://github.com/MCUdude/MiniCore) | **3**, 9 | 1, **2** |
265+
| [ATmega168, **ATmega328**] | 9, **3** | 1, **2** | 9 & 10, **3 & 11** |
258266
| [ATmega1284](https://github.com/MCUdude/MightyCore) | 13, 14, 6 | 1, **2**, 3 |
259267
| [ATmega164, ATmega324, ATmega644](https://github.com/MCUdude/MightyCore) | 13, **14** | 1, **2** |
260268
| [ATmega8535 ATmega16, ATmega32](https://github.com/MCUdude/MightyCore) | **13** | **1** |

0 commit comments

Comments
 (0)