diff options
author | fauxpark <fauxpark@gmail.com> | 2019-08-09 06:12:12 +1000 |
---|---|---|
committer | Drashna Jaelre <drashna@live.com> | 2019-08-08 13:12:12 -0700 |
commit | 4d72aa428fb8dc72634bded428f78ffba2284fdc (patch) | |
tree | 4ff5ead1218accfb7650e79ec60697fb0ac22a2a /docs/feature_backlight.md | |
parent | 57540af102d034396c9f41a5a6e69ead8b10ba99 (diff) | |
download | firmware-4d72aa428fb8dc72634bded428f78ffba2284fdc.tar.gz firmware-4d72aa428fb8dc72634bded428f78ffba2284fdc.tar.bz2 firmware-4d72aa428fb8dc72634bded428f78ffba2284fdc.zip |
Improve backlight PWM pin support (#6202)
* Improve backlight PWM pin support
* I accidentally an equals sign
* Another typo
* Order by pin number
* Throw an error if backlight pin is C4 or C5 on 16/32U4
* Use else for clarity
* Minor alignment adjustments
Diffstat (limited to 'docs/feature_backlight.md')
-rw-r--r-- | docs/feature_backlight.md | 47 |
1 files changed, 23 insertions, 24 deletions
diff --git a/docs/feature_backlight.md b/docs/feature_backlight.md index 64c663076..2d9eea67b 100644 --- a/docs/feature_backlight.md +++ b/docs/feature_backlight.md @@ -30,32 +30,31 @@ You should then be able to use the keycodes below to change the backlight level. This feature is distinct from both the [RGB underglow](feature_rgblight.md) and [RGB matrix](feature_rgb_matrix.md) features as it usually allows for only a single colour per switch, though you can obviously use multiple different coloured LEDs on a keyboard. -Hardware PWM is only supported on certain pins of the MCU, so if the backlighting is not connected to one of them, a software PWM implementation triggered by hardware timer interrupts will be used. - Hardware PWM is supported according to the following table: -| Backlight Pin | Hardware timer | -|---------------|-------------------------| -|`B5` | Timer 1 | -|`B6` | Timer 1 | -|`B7` | Timer 1 | -|`C6` | Timer 3 | -|`D4` | Timer 1 (ATmega32A only)| -| other | Software PWM | - -The [audio feature](feature_audio.md) also uses hardware timers. Please refer to the following table to know what hardware timer the software PWM will use depending on the audio configuration: - -| Audio Pin(s) | Audio Timer | Software PWM Timer | -|--------------|-------------|--------------------| -| `C4` | Timer 3 | Timer 1 | -| `C5` | Timer 3 | Timer 1 | -| `C6` | Timer 3 | Timer 1 | -| `B5` | Timer 1 | Timer 3 | -| `B6` | Timer 1 | Timer 3 | -| `B7` | Timer 1 | Timer 3 | -| `Bx` & `Cx` | Timer 1 & 3 | None | - -When all timers are in use for [audio](feature_audio.md), the backlight software PWM will not use a hardware timer, but instead will be triggered during the matrix scan. In this case the backlight doesn't support breathing and might show lighting artifacts (for instance flickering), because the PWM computation might not be called with enough timing precision. +|Backlight Pin|AT90USB64/128|ATmega16/32U4|ATmega16/32U2|ATmega32A| +|-------------|-------------|-------------|-------------|---------| +|`B5` |Timer 1 |Timer 1 | | | +|`B6` |Timer 1 |Timer 1 | | | +|`B7` |Timer 1 |Timer 1 |Timer 1 | | +|`C4` |Timer 3 | | | | +|`C5` |Timer 3 | |Timer 1 | | +|`C6` |Timer 3 |Timer 3 |Timer 1 | | +|`D4` | | | |Timer 1 | +|`D5` | | | |Timer 1 | + +All other pins will use software PWM. If the [Audio](feature_audio.md) feature is disabled or only using one timer, the backlight PWM can be triggered by a hardware timer: + +|Audio Pin|Audio Timer|Software PWM Timer| +|---------|-----------|------------------| +|`C4` |Timer 3 |Timer 1 | +|`C5` |Timer 3 |Timer 1 | +|`C6` |Timer 3 |Timer 1 | +|`B5` |Timer 1 |Timer 3 | +|`B6` |Timer 1 |Timer 3 | +|`B7` |Timer 1 |Timer 3 | + +When both timers are in use for Audio, the backlight PWM will not use a hardware timer, but will instead be triggered during the matrix scan. In this case, breathing is not supported, and the backlight might flicker, because the PWM computation may not be called with enough timing precision. ## Configuration |