Skip to content

Commit

Permalink
New Timer Pin Tables
Browse files Browse the repository at this point in the history
  • Loading branch information
photodude committed Apr 11, 2019
1 parent bf023ae commit 87188aa
Showing 1 changed file with 33 additions and 1 deletion.
34 changes: 33 additions & 1 deletion README.md
Expand Up @@ -155,6 +155,8 @@ get reliable current measurements. If `analogWrite` uses a frequency of 490&nbs

Version History
---------------
- 2019-03-28 Now officially in the Arduino Library Manager
- 3.0.2-dualshields (2018-12-02): Fix default pins for motor 2 _CS4
- 3.0.1-dualshields (2018-06-14): Fix Semver naming for Arduino Library Manager
- 3.0.0.dualshields (2018-05-12): Allow PWM remapping (use analogWrite if PWM pins remapped). Follows PWM remapping changes in source library pololu/dual-vnh5019-motor-shield, possibly backwards compatable change to allow use with old versions of the Arduino IDE
- 2.0.0.dualshields (2016-08-20): Updated library to work with the Arduino Library Manager
Expand Down Expand Up @@ -216,12 +218,42 @@ well, you would add the capacitor between M2CS and GND.
- The Uno has 3 Timers and 6 PWM output pins 3, 5, 6, 9, 10, and 11
- timer 0 —– Pins 5, 6 (time functions like millis(), and delay() )
- timer 1 —– Pins 9, 10 (servo library)
- timer 2 —– Pins 11, 3
- timer 2 —– Pins 11, 3 (tone(), notone() functions)

| Uno Timer | Timer output OCRnx | Timer bit mode | PWM pin output | Conflicts |
|:---------:|:------------------:|:--------------:|:--------------:|:----------------:|
| Timer 1 | OCR1A | 16 bit | 9 | servo library |
| Timer 1 | OCR1B | 16 bit | 10 | servo library |
| Timer 2 | OCR2A | 8 bit | 11 | tone(), notone(), MOSI/SPI |
| Timer 2 | OCR2B | 8 bit | 3 | tone(), notone() |

- The Arduino Mega has 6 timers and 15 PWM outputs pins 2 to 13 and 44 to 46
- timer 0 —– pin 4, 13 (time functions like millis(), and delay() )
- timer 1 —– pin 11, 12
- timer 2 —– pin 9, 10 (tone(), notone() functions)
- timer 3 —– pin 2, 3, 5
- timer 4 —– pin 6, 7, 8
- timer 5 —– pin 44, 45, 46 (servo library)

| Mega Timer | Timer output OCRnx | Timer bit mode | PWM pin output | Conflicts |
|:----------:|:------------------:|:-------------:|:--------------:|:----------------:|
| Timer 1 | OCR1A | 16 bit | 11 | - |
| Timer 1 | OCR1B | 16 bit | 12 | - |
| Timer 2 | OCR2A | 8 bit | 10 | tone(), notone() |
| Timer 2 | OCR2B | 8 bit | 9 | tone(), notone() |
| Timer 3 | OCR3A | 16 bit | 5 | - |
| Timer 3 | OCR3B | 16 bit | 2 | - |
| Timer 3 | OCR3C | 16 bit | 3 | - |
| Timer 4 | OCR4A | 16 bit | 6 | - |
| Timer 4 | OCR4B | 16 bit | 7 | - |
| Timer 4 | OCR4C | 16 bit | 8 | - |
| Timer 5 | OCR5A | 16 bit | 46 | servo library |
| Timer 5 | OCR5B | 16 bit | 45 | servo library |
| Timer 5 | OCR5C | 16 bit | 44 | servo library |

- The Arduino Leonardo has 4 timers and 7 PWM outputs
- timer 0 —– Pins 3, 11 (time functions like millis(), and delay() )
- timer 1 —– Pins 9, 10 (servo library)
- timer 3 —– pin 5
- timer 4 —– pin 6,13
- [You can manually implement a sudo PWM on any digital pin by repeatedly turning the pin on and off for the desired times](http://www.arduino.cc/en/Tutorial/SecretsOfArduinoPWM)

0 comments on commit 87188aa

Please sign in to comment.