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

X  

AN2841 数据表(PDF) 21 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) 21 Page - STMicroelectronics

Back Button 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 AN2841 Datasheet HTML 24Page - STMicroelectronics AN2841 Datasheet HTML 25Page - STMicroelectronics Next Button
Zoom Inzoom in Zoom Outzoom out
 21 / 31 page
background image
AN2841
Dimming application using an STM32 microcontroller
21/31
Example of reduced lookup table generation
void performGenerateReducedLookUpTable(unsigned char *LEDmapIN,
int LEDcount, int PWMdepth, unsigned char **tableIN, unsigned
char **tableKeyIN, int *table_size){
int streamSize = LEDcount/8;
*table_size = differentValuesCount(LEDmapIN, LEDcount);
*tableKeyIN = SortAndReduce(LEDmapIN, LEDcount, *table_size);
*tableIN = malloc(streamSize * (*table_size)
* sizeof(unsigned char));
for(tmpdepth = 0; tmpdepth < (*table_size); tmpdepth++){
for(DATAchar = 0; DATAchar < streamSize; DATAchar++){
for(outputBIT = 0; outputBIT < 8; outputBIT++){
(*tableIN)[tmpdepth*streamSize + DATAchar] <<= 1;
if(LEDmapIN[(DATAchar*8) + outputBIT] >
(*tableKeyIN)[tmpdepth])
(*tableIN)[tmpdepth*streamSize + DATAchar] |= 0x01;
else
(*tableIN)[tmpdepth*streamSize + DATAchar] &= 0xFE;
}
}
}
}
.
Table 3.
LEDmap - requested LED brightness configuration
Outputs
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