| 数据搜索系统,热门电子元器件搜索 |
|
AN4460 数据表(PDF) 21 Page - STMicroelectronics |
|
|
|||||||||||||||||||||||||||||
AN4460 数据表(HTML) 21 Page - STMicroelectronics |
|
21 / 54 page ![]() DocID026129 Rev 1 21/54 AN4460 Firmware implementation 54 5 Firmware implementation The following section offers a view of the firmware implementation. For more details about the firmware, refer to the source code. The compiled portion of the firmware core is 3.5 Kbyte and the code size is ~12 Kbyte. Most of the code size is allocated to the debugging machine and general user interface (see Section 7.3 on page 28). The PWM algorithm and the OCP controls are entirely implemented in the SMED block, leaving the CPU free for control tasks such as: slow varying algorithmic compensations, the command line, and interrupt management. 5.1 Dimming algorithm The dimming algorithm controls the brightness of the LED string by modulating the amount of time, the LED is switched ON during a ~5 ms period. This period defines the dimming cycle, which operates with a ~200 Hz frequency. The longer the LED is ON during a single cycle, the brighter the LED results to human eyes. To turn ON a LED, the algorithm simply activates the SMED associated by setting the SMED's SWx event to active state. Once the desired on-time period is passed, the LED is turned OFF and the algorithm waits for the beginning of the next dimming cycle to turn ON the LED again. To optimize power, the dimming cycle in channel x is 90 degrees shifted respect to channel x-1. LED chains can be configured with different on-time length; however the dimming start period is fixed by design. In this way, the LEDs are always turned ON at different times, reducing current peaks on the power supply. The LED on-time is instead a multiple of 20 µs and is based on the STMR timer, which itself has 1 µs granularity. The software stores the time-on length in the onoff[8][2]structure, where the first byte indicates the channel and the PWM action (turn ON or OFF the LED) and the second byte specifies the time (up to 256 time units = 256 x 20 µs = 5120 µs) before the next event. The next example shows the activity of LED channels with different dimming on-times: DIMM1 is active at 87,5%, DIMM2 is active at 25%, DIMM3 is active at 75% and DIMM4 is active at 37.5%. When the dimming is ON the SMED output PWM is active and the LED light is ON. |
|
链接网址 |
| ALLDATASHEET是否为您带来帮助? [ DONATE ] |
关于 Alldatasheet | 广告服务 | 联系我们 | 隐私政策 | 数据表链接 | 链接交换 | 制造商名单 All Rights Reserved©Alldatasheet.com |
| Russian : Alldatasheetru.com | Korean : Alldatasheet.co.kr | Spanish : Alldatasheet.es | French : Alldatasheet.fr | Italian : Alldatasheetit.com Portuguese : Alldatasheetpt.com | Polish : Alldatasheet.pl | Vietnamese : Alldatasheet.vn Indian : Alldatasheet.in | Mexican : Alldatasheet.com.mx | British : Alldatasheet.co.uk | New Zealand : Alldatasheet.co.nz |
|
Family Site : ic2ic.com |
icmetro.com |