lpcware

LPCOpen MRT sample errors

Discussion created by lpcware Employee on Jun 15, 2016
Latest reply on Jun 15, 2016 by lpcware
Content originally posted in LPCWare by R2D2 on Wed Jan 07 00:08:56 MST 2015
LPCXpresso LPC1549 board LPCOpen V2.08c - periph_mrt sample is including several inversion errors...

Wrong:
setupMRT(2, MRT_MODE_ONESHOT, 2);/* Will fire in 0.5 seconds */
...
setupMRT(0, MRT_MODE_REPEAT, 2);/* 2Hz rate */

Corrected:
setupMRT(2, MRT_MODE_ONESHOT, 2);/* Will [color=#f00]not[/color] fire in 0.5 seconds */
...
setupMRT(0, MRT_MODE_REPEAT, 2);/* [color=#f00]no[/color] 2Hz rate */


Surprisingly enough, setting interval time to (MainClockRate / 2) isn't working  :((

Instead expected 72E6 / 2 = 36E6 interval timer is set to 2445568 (= 36E6 AND 0xFFFFFF) , causing a 29 Hz rate  ;-)

I'm not sure why these timers are 24bit in a 32bit world, but obviously that's still surprising  :~

Outcomes