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

X  

AN3140 数据表(PDF) 9 Page - STMicroelectronics

部件名 AN3140
功能描述  How to configure the SPEAr3xx general purpose timers
PDF  14 Pages
Scroll/Zoom Zoom In 100%  Zoom Out
制造商  STMICROELECTRONICS [STMicroelectronics]
网页  http://www.st.com
标志 STMICROELECTRONICS - STMicroelectronics

AN3140 数据表(HTML) 9 Page - STMicroelectronics

Back Button AN3140 Datasheet HTML 5Page - STMicroelectronics AN3140 Datasheet HTML 6Page - STMicroelectronics AN3140 Datasheet HTML 7Page - STMicroelectronics AN3140 Datasheet HTML 8Page - STMicroelectronics AN3140 Datasheet HTML 9Page - STMicroelectronics AN3140 Datasheet HTML 10Page - STMicroelectronics AN3140 Datasheet HTML 11Page - STMicroelectronics AN3140 Datasheet HTML 12Page - STMicroelectronics AN3140 Datasheet HTML 13Page - STMicroelectronics Next Button
Zoom Inzoom in Zoom Outzoom out
 9 / 14 page
background image
AN3140
3-read software workaround
Doc ID 16997 Rev 1
9/14
5
3-read software workaround
Below you can see a proposal for a software workaround that works for the scenario
described in the previous section. This workaround works well in case of the previously
described scenario, where READ_Clk is much faster than CNT_Clk, as well as when they
have similar frequencies.
In the first case the MAX_DIFF should be defined as ‘1’, while in the second case (similar
frequencies) a higher value should be selected. This value should be fine tuned depending
to the two real frequencies.
Example code
/*
* The following routine implents the 3-read workaround.
* MAX_DIFF equals to 5 should work in case of READ_Clk==75MHz and
* CNT_Clk==48MHz.
*/
#define MAX_DIFF 5
bool Timer_Read_Workaround(UINT32 *valid_timer_cnt_value)
{
UINT32 timer_value1, timer_value2, timer_value3;
UINT32 valid_timer_cnt_value;
/* To avoid any interrupt that might delay the reading. */
DISABLE_ALL_INTERRUPT;
timer_value1 =
READ_TIMER_CNT();
timer_value2 =
READ_TIMER_CNT();
timer_value3 =
READ_TIMER_CNT();
ENABLE_ALL_INTERRUPT;
if ((timer_value2 – timer_value1) <= MAX_DIFF) {
*valid_timer_cnt_value = timer_value2;
}
else if ((timer_value3 – timer_value1) <= MAX_DIFF) {
*valid_timer_cnt_value = timer_value3;
}
else if ((timer_value3 – timer_value2) <= MAX_DIFF) {
*valid_timer_cnt_value = timer_value2;
}
else
return FALSE;
return TRUE;
}



Html Pages

1 2 3 4 5 6 7 8 9 10 11 12 13 14


数据表 下载

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