| 数据搜索系统,热门电子元器件搜索 |
|
AN4460 数据表(PDF) 23 Page - STMicroelectronics |
|
|
|||||||||||||||||||||||||||||
AN4460 数据表(HTML) 23 Page - STMicroelectronics |
|
23 / 54 page ![]() DocID026129 Rev 1 23/54 AN4460 Firmware implementation 54 interrupt is received when the next dimming even is required, as specified in the onoff[][] structure. When the interrupt routine sets a SMED ON, the startup flag for the ADC delayed acquisition (using the AWU peripheral) is also set. SMEDx_ISR(): SMED interrupt The interrupt is used to stop the SMED when an OCP problem is detected. The interrupt is generated by a SMED on exit from S3. The SMED is in S3 only if event(1) is received during S1. The interrupt routines stop the SMED by changing the SWx bit and giving the fault signal to the main function, which turns on the red “fault” LED. The SMED is reactivated on its next dimming cycle and if the OCP problem is not removed then the SMED evolves into S3, triggering the SMEDx_ISR interrupt again. Auto-wakeup unit. The auto-wakeup unit is used while the CPU waits for the current startup and LED voltage settlement time before starting the ADC acquisition. For a correct FOT implementation the ADC measures the VCOMx voltage when the PWM is ON and when the VLED has a correct value. This time is fixed to around 100 µs after the SMED start. When the AWU time expires, the interrupt starts the ADC channel acquisition. ADC_ISR(): ADC interrupt The routine samples, for each channel, VLED_PW and VCOMx, 4 times respectively. The values are then averaged and stored. The ADC sampling routine occurs 100 µs after the start of the PWM dimming. Should the PWM dimming time be smaller than 100 µs, the ADC samples incorrect voltage values and therefore the samples are discarded. This protection (inconsistent voltage protection) is implemented via the SMED_Active bit. The interrupt routine uses the adc_eoc flag to inform the main function that the ADC operation is completed and that new data is available. As a consequence, the software discards the ADC value. The interrupt routine uses the adc_eoc flag to inform the main function that the ADC operation is completed and that new data is available. Get_Key() This routine is used to detect if the board buttons are pressed. The STLUX385A uses the ADC (ADCIN[7], pin 31) to sense the button status. Since the ADC is used also to read VCOMx and VPWR, a protection is set to avoid conflicts. Comp_PWM() It computes the new SMED’s operating parameters as calculated by the adaptive voltage compensation mechanism.The new values are updated on the SMED registers only during the next STOP phases (using the upd_flags variable with UPD_PWMx flags). Comp_DUTY() This routine is invoked when the user changes the dimming period. The routine computes a new dimming period based on the ontime[] structures and stores the result on tmp_onoff[][] structures. The update is performed at the beginning of the next dimming period (using the upd_flags variable with UPD_DUTY flags) and when the dimming is OFF. During the update, the tmp_off[][] structure is copied into the onoff[][] structure. The tasks displayed in the previous picture refer to the PWM and dimming control operations only. The STLUX385A firmware handles other tasks such as the command line, |
|
链接网址 |
| 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 |