| Electronic Components Datasheet Search |
|
AN2841 Datasheet(PDF) 11 Page - STMicroelectronics |
|
|
|||||||||||||||||||||||||||||
AN2841 Datasheet(HTML) 11 Page - STMicroelectronics |
|
11 / 31 page ![]() 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 |
|
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 |
| 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 |