Ci-dessous, les différences entre deux révisions de la page.
Les deux révisions précédentes Révision précédente Prochaine révision | Révision précédente Dernière révision Les deux révisions suivantes | ||
logiciels:arduino-timer:accueil [2014/09/22 17:04] resonance |
logiciels:arduino-timer:accueil [2018/01/18 06:56] chenjianwei [2D et 3D PRIMITIVES] |
||
---|---|---|---|
Ligne 1: | Ligne 1: | ||
- | ====== Arduino et Timer ====== | + | http:// |
+ | http:// | ||
+ | http:// | ||
+ | http:// | ||
+ | http:// | ||
+ | http:// | ||
+ | http:// | ||
+ | http:// | ||
+ | http:// | ||
+ | http:// | ||
+ | http:// | ||
+ | http:// | ||
+ | http:// | ||
+ | http:// | ||
+ | http:// | ||
+ | http:// | ||
+ | http:// | ||
+ | http:// | ||
+ | http:// | ||
+ | http:// | ||
+ | http:// | ||
+ | http:// | ||
+ | http:// | ||
+ | http:// | ||
+ | http:// | ||
+ | http:// | ||
+ | http:// | ||
+ | http:// | ||
+ | http:// | ||
+ | http:// | ||
+ | http:// | ||
+ | http:// | ||
+ | http:// | ||
+ | http:// | ||
+ | http:// | ||
+ | http:// | ||
+ | http:// | ||
+ | http:// | ||
+ | http:// | ||
+ | http:// | ||
+ | http:// | ||
+ | http:// | ||
+ | http:// | ||
+ | http:// | ||
+ | http:// | ||
+ | http:// | ||
+ | http:// | ||
+ | http:// | ||
+ | http:// | ||
+ | http:// | ||
+ | http:// | ||
+ | http:// | ||
+ | http:// | ||
+ | http:// | ||
+ | http:// | ||
+ | http:// | ||
+ | http:// | ||
+ | http:// | ||
+ | http:// | ||
+ | http:// | ||
+ | http:// | ||
+ | http:// | ||
+ | http:// | ||
+ | http:// | ||
+ | http:// | ||
+ | http:// | ||
+ | http:// | ||
+ | http:// | ||
+ | http:// | ||
+ | http:// | ||
+ | http:// | ||
+ | http:// | ||
+ | http:// | ||
+ | http:// | ||
+ | http:// | ||
+ | http:// | ||
+ | http:// | ||
+ | http:// | ||
+ | http:// | ||
+ | http:// | ||
+ | http:// | ||
+ | http:// | ||
+ | http:// | ||
+ | http:// | ||
+ | http:// | ||
+ | http:// | ||
+ | http:// | ||
+ | http:// | ||
+ | http:// | ||
+ | http:// | ||
+ | http:// | ||
+ | http:// | ||
+ | http:// | ||
+ | http:// | ||
+ | http:// | ||
+ | http:// | ||
+ | http:// | ||
+ | http:// | ||
+ | http:// | ||
+ | http:// | ||
+ | http:// | ||
+ | http:// | ||
+ | http:// | ||
+ | http:// | ||
+ | http:// | ||
+ | http:// | ||
+ | http:// | ||
+ | http:// | ||
+ | http:// | ||
+ | http:// | ||
+ | http:// | ||
+ | http:// | ||
+ | http:// | ||
+ | http:// | ||
+ | http:// | ||
+ | http:// | ||
+ | http:// | ||
+ | http:// | ||
+ | http:// | ||
+ | http:// | ||
+ | http:// | ||
+ | http:// | ||
+ | http:// | ||
+ | http:// | ||
+ | http:// | ||
+ | http:// | ||
+ | http:// | ||
+ | http:// | ||
+ | http:// | ||
+ | http:// | ||
+ | http:// | ||
+ | http:// | ||
+ | http:// | ||
+ | http:// | ||
+ | http:// | ||
+ | http:// | ||
+ | http:// | ||
+ | http:// | ||
+ | http:// | ||
+ | http:// | ||
+ | http:// | ||
+ | http:// | ||
+ | http:// | ||
+ | http:// | ||
+ | http:// | ||
+ | http:// | ||
+ | http:// | ||
+ | http:// | ||
+ | http:// | ||
+ | http:// | ||
+ | http:// | ||
+ | http:// | ||
+ | http:// | ||
+ | http:// | ||
+ | http:// | ||
+ | http:// | ||
+ | http:// | ||
+ | http:// | ||
+ | http:// | ||
+ | http:// | ||
+ | http:// | ||
+ | http:// | ||
+ | http:// | ||
+ | http:// | ||
+ | http:// | ||
+ | http:// | ||
+ | http:// | ||
+ | http:// | ||
+ | http:// | ||
+ | http:// | ||
+ | http:// | ||
+ | http:// | ||
+ | http:// | ||
+ | http:// | ||
+ | http:// | ||
+ | http:// | ||
+ | http:// | ||
+ | http:// | ||
+ | http:// | ||
+ | http:// | ||
+ | http:// | ||
+ | http:// | ||
+ | http:// | ||
+ | http:// | ||
+ | http:// | ||
+ | http:// | ||
+ | http:// | ||
+ | http:// | ||
+ | http:// | ||
+ | |||
+ | |||
+ | |||
+ | |||
+ | |||
+ | |||
+ | |||
+ | |||
+ | |||
+ | |||
+ | |||
+ | |||
+ | |||
+ | ===== 2D et 3D PRIMITIVES ===== | ||
+ | Cercle, carré, rectangle, sphère, cylindre, tore, cone, ... | ||
+ | |||
+ | {{.: | ||
Ligne 14: | Ligne 219: | ||
* **Timer 0** : pins 5 et 6 : 976.5625 Hz (8 bits > 256 values) | * **Timer 0** : pins 5 et 6 : 976.5625 Hz (8 bits > 256 values) | ||
* **Timer 1** : pins 9 et 10 : 490.20 Hz (16 bits > 65536 values) | * **Timer 1** : pins 9 et 10 : 490.20 Hz (16 bits > 65536 values) | ||
- | * **Timer 2** : pins 11 et 3 : 490.20 Hz (8 bits) | + | * **Timer 2** : pins 3 et 11 : 490.20 Hz (8 bits) |
+ | |||
+ | {{http:// | ||
**Arduino MEGA** : | **Arduino MEGA** : | ||
- | * Les mêmes timer 0, 1 et 3 | + | * **Timer |
- | * Timer 3 : pins 5, 3, 2 (16 bits) | + | * **Timer |
- | * Timer 4 : pins 8, 7, 6 (16 bits) | + | |
- | * Timer 5 : pins 46, 45 et 44 (16 bits) | + | * **Timer 3** : pins 2, 3 et 5 (16 bits) |
+ | | ||
+ | | ||
+ | |||
+ | Sur une Mega, chaque Tone simultané utilisera les timers dans cet ordre : 2, 3, 4, 5, 1, 0 ([[https:// | ||
**Arduino Leonardo** (no Timer 2!) : | **Arduino Leonardo** (no Timer 2!) : | ||
+ | http:// | ||
The Leonardo has 7 PWM pins instead of 6. ATmega32U4 also has a new timer, timer4 which has 10 bits and uses a PLL to count at 64MHz. Their mappings are different as well: | The Leonardo has 7 PWM pins instead of 6. ATmega32U4 also has a new timer, timer4 which has 10 bits and uses a PLL to count at 64MHz. Their mappings are different as well: | ||
* **Timer 0** : pins 3 et 11 : 8 bits | * **Timer 0** : pins 3 et 11 : 8 bits | ||
Ligne 30: | Ligne 242: | ||
* **Timer 4** : pins 6, 13 (10 bits) | * **Timer 4** : pins 6, 13 (10 bits) | ||
- | {{http://www.gammon.com.au/images/Arduino/Timer_and_Counter_pins.jpg?600}} | + | |
+ | **Tone et Leonardo** problem :https://code.google.com/p/rogue-code/issues/ | ||
+ | |||
+ | |||
+ | ===== PWM Frequency ===== | ||
+ | < | ||
+ | TCCR0B = TCCR0B & 0b11111000 | < | ||
+ | TCCR1B = TCCR1B & 0b11111000 | < | ||
+ | TCCR2B = TCCR2B & 0b11111000 | < | ||
+ | </ | ||
+ | |||
+ | | setting | 5 & 6 | 3,11 & 9,10 | | ||
+ | | 0x01 |62500 | 31250 | | ||
+ | | 0x02 |7812 | 3906 | | ||
+ | | 0x03 | 976 | 488 | | ||
+ | | 0x04 | 244 | 122 | | ||
+ | | 0x05 | 61 | 30 | | ||
===== Tone ===== | ===== Tone ===== |