数据搜索系统,热门电子元器件搜索
  Chinese  ▼
ALLDATASHEETCN.COM

X  

AN2841 数据表(PDF) 19 Page - STMicroelectronics

部件名 AN2841
功能描述  This application note deals with the general principles of LED dimming
PDF  31 Pages
Scroll/Zoom Zoom In 100%  Zoom Out
制造商  STMICROELECTRONICS [STMicroelectronics]
网页  http://www.st.com
标志 STMICROELECTRONICS - STMicroelectronics

AN2841 数据表(HTML) 19 Page - STMicroelectronics

Back Button AN2841 Datasheet HTML 15Page - STMicroelectronics AN2841 Datasheet HTML 16Page - STMicroelectronics AN2841 Datasheet HTML 17Page - STMicroelectronics AN2841 Datasheet HTML 18Page - STMicroelectronics AN2841 Datasheet HTML 19Page - STMicroelectronics AN2841 Datasheet HTML 20Page - STMicroelectronics AN2841 Datasheet HTML 21Page - STMicroelectronics AN2841 Datasheet HTML 22Page - STMicroelectronics AN2841 Datasheet HTML 23Page - STMicroelectronics Next Button
Zoom Inzoom in Zoom Outzoom out
 19 / 31 page
background image
AN2841
Dimming application using an STM32 microcontroller
19/31
In the above example, the waveform and program code are described in the following steps:
1.
The generation of the LE after entering the interrupt.
2.
Setting the DMA: source address, data length, and Start flag.
3.
Data is sent automatically by DMA.
4.
Data is sent automatically by DMA.
5.
DMA interrupt routine is called when the last byte is sent by DMA.
6.
Wait until the data from the SPI TX buffer is delivered to the driver.
(Step 6 can be exchanged with calculations that take the amount of time necessary for
the SPI transfer to be finished).
7.
LE generation.
3.2
Data preparation: redundant and non redundant use of
memory
3.2.1
Full lookup table (redundant)
The static lookup table generation is mentioned in Section 3.1.2. The lookup table
generation procedure is described in more detail in this section.
The lookup table row is computed for every PWM step (8-bit PWM means 256 rows for 256
steps). The C code of the full lookup table generation is given in the example below.
Example using a 4×8 LED matrix with an 8-bit PWM resolution
void generateLookUpTable(unsigned char *LEDmapIN){
unsigned int tmpdepth;
for(tmpdepth = 0; tmpdepth < 0xff; tmpdepth++){
for(DATAchar = 0; DATAchar < 4; DATAchar++){
for(outputBIT = 0; outputBIT < 8; outputBIT++){
LookUp[tmpdepth*4 + DATAchar] <<= 1;
if(LEDmapIN[(DATAchar*8) + outputBIT] > tmpdepth)
LookUp[tmpdepth*4 + DATAchar] |= 0x01;
else
LookUp[tmpdepth*4 + DATAchar] &= 0xFE;
}
}
}
}
Table 1.
LEDmap - requested LED brightness configuration
Output
LED 1
LED 2
LED 3
…
…
LED i
Duty cycle (brightness)
2 / 2n
6 / 2n
4 / 2n
100%



Html Pages

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31


数据表 下载

Go To PDF Page


链接网址



ALLDATASHEET是否为您带来帮助?  [ DONATE ] 

关于 Alldatasheet   |   广告服务   |   联系我们   |   隐私政策   |   数据表链接    |   链接交换   |   制造商名单
All Rights Reserved©Alldatasheet.com


Mirror Sites
English : Alldatasheet.com  |   English : Alldatasheet.net  |   Chinese : Alldatasheetcn.com  |   German : Alldatasheetde.com  |   Japanese : Alldatasheet.jp
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