I had been trying to use the second 32bit timer on a LPC11C24 for the whole previous day but hadn't been to able to succeed. Finally, I' ve noticed that there was a small bug which prevented the clock from being activated. As you see, following function will never return with the clock for the CT32B1. First "else if" block must be updated with LPC_TIMER32_1 and SYSCTL_CLOCK_CT32B1 symbols.
/* Returns the clock from the speicifc timer base address */
static CHIP_SYSCTL_CLOCK_T Chip_Timer_GetClock(LPC_TIMER_T *pTMR) { CHIP_SYSCTL_CLOCK_T clk;
if (pTMR == LPC_TIMER32_0) { clk = SYSCTL_CLOCK_CT32B0; }
else if (pTMR == LPC_TIMER32_0) { clk = SYSCTL_CLOCK_CT32B0; }
else if (pTMR == LPC_TIMER16_0) { clk = SYSCTL_CLOCK_CT16B0; }
else { clk = SYSCTL_CLOCK_CT16B1; }
return clk;
}
Cheers,
Utku Genc
Yes, this is a bug (ehh - cut and paste?). Someone submitted a tracker issue @ http://www.lpcware.com/content/bugtrackerissue/lpc11xx-timer-initialization-issue
This will be fixed in the next release and the issue has been listed in the known issue lsit for the v1.03 release @ http://www.lpcware.com/content/page/lpcopen-releases-and-versioning-information
This is defintely a bug.