전자부품 데이터시트 검색엔진
  Korean  ▼
ALLDATASHEET.CO.KR

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
Logo 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


링크 URL



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