lpc824 LpcOpen Stopwatch and RIT ... possible problem

取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 

lpc824 LpcOpen Stopwatch and RIT ... possible problem

516 次查看
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by efiLabs on Sun Dec 14 22:18:07 MST 2014

friends :

after creating my own timer class i had to revisit StopWatch_Init() and StopWatch_Start() where i took a few ideas from

my code didn't work right on timer over-runs and i stared  at the LpcOpen code until i noticed that the 31 bit mask had one "F" to few and afterwards my code worked

sample copied from LpcOpen

in StopWatch_Init() :

Chip_MRT_SetInterval(LPC_MRT_CH1, 0x7ffffff | MRT_INTVAL_LOAD);

in StopWatch_Start() :

return 0x7ffffff - Chip_MRT_GetTimer(LPC_MRT_CH1);

unless lpcopen has something else in mind, i consider it wrong it should contain 0x7FFFFFFF

it works for me now

cheers efiLabs
标签 (1)
0 项奖励
回复
0 回复数