| Datenblatt-Suchmaschine für elektronische Bauteile |
|
AN2841 Datenblatt(PDF) 19 Page - STMicroelectronics |
|
|
|||||||||||||||||||||||||||||
AN2841 Datenblatt(HTML) 19 Page - STMicroelectronics |
|
19 / 31 page ![]() 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% |
|
Link URL |
| War ALLDATASHEET hilfreich? [ DONATE ] |
Über Alldatasheet | Werbung | Kontakt | Privatsphäre und Datenschutz | Link zum Datenblatt | Linktausch | Hersteller 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 |