Electronic Components Datasheet Search
  New Zealand  ▼
ALLDATASHEET.CO.NZ

X  

AN2841 Datasheet(PDF) 11 Page - STMicroelectronics

Part # AN2841
Description  This application note deals with the general principles of LED dimming
PDF  31 Pages
Scroll/Zoom Zoom In 100%  Zoom Out
Manufacturer  STMICROELECTRONICS [STMicroelectronics]
Direct Link  http://www.st.com
Logo STMICROELECTRONICS - STMicroelectronics

AN2841 Datasheet(HTML) 11 Page - STMicroelectronics

Back Button AN2841 Datasheet HTML 7Page - STMicroelectronics AN2841 Datasheet HTML 8Page - STMicroelectronics AN2841 Datasheet HTML 9Page - STMicroelectronics AN2841 Datasheet HTML 10Page - STMicroelectronics AN2841 Datasheet HTML 11Page - STMicroelectronics AN2841 Datasheet HTML 12Page - STMicroelectronics AN2841 Datasheet HTML 13Page - STMicroelectronics AN2841 Datasheet HTML 14Page - STMicroelectronics AN2841 Datasheet HTML 15Page - STMicroelectronics Next Button
Zoom Inzoom in Zoom Outzoom out
 11 / 31 page
background image
AN2841
Dimming application using an STM32 microcontroller
11/31
Figure 8.
Conversion of
LEDmap array to LEDdriverDATAbuffer
Example using a 4×8 LED matrix with an 8-bit PWM resolution
while(1)
for(depth = 1; depth<=0xff; depth++){
for(DATAchar = 0; DATAchar < 4; DATAchar++){
for(outputBIT = 0; outputBIT < 8; outputBIT++){
LEDdriverDATAbuffer[DATAchar] <<= 1;
if(LEDmap[(DATAchar*8) + outputBIT] > depth)
LEDdriverDATAbuffer[DATAchar] |= 0x0001;
else
LEDdriverDATAbuffer[DATAchar] &= 0xFFFE;
}
SPI_SendData(SPI1, LEDdriverDATAbuffer[DATAchar]);
}
LE_LOW();
LE_HIGH();
LE_LOW();
}
Even though the dynamic data preparation consumes a minimum of system memory, it
takes a lot of computational time. This approach is only recommended for low LED count
applications. A dynamic data preparation approach can reach 100 Hz for 32 LEDs (with
maximum code optimization in C compiler on the STM32 evaluation board).
LEDmap[0] > depth =
0
LEDmap[1] > depth =
1
LEDmap[2] > depth =
1
LEDmap[3] > depth =
0
LEDmap[4] > depth =
1
LEDmap[6] > depth =
1
LEDmap[7] > depth =
0
LEDmap[8] > depth =
0
for one time stamp depth = 50
LEDmap= { 20, 60, 75, 22, 100, 255, 0, 5}
LEDdriverDATAbuffer[0]
LED driver
for outputBIT from 0 to 7
SPI
AM00347



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


Datasheet Download

Go To PDF Page


Link URL



Does ALLDATASHEET help your business so far?  [ DONATE ] 

About Alldatasheet   |   Advertisement   |   Contact us   |   Privacy Policy   |   Link to Datasheet    |   Link Exchange   |   Manufacturer List
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