Mark Minich

PEx TimerUnit_LDD Counter restart config says "Unassigned peripheral"... why?

Discussion created by Mark Minich on May 26, 2015

I'm trying to set up a Kinetis PIT counter as a free-running 32 bit counter for use like QueryPerformanceCounter() and QueryPerformanceFrequency() on Microsoft Windows. For this purpose, the interrupt is disabled (PIT_TCTRLn[TIE] is 0) and the PIT_LDVALn reload value would be 0xffffffff (i.e. wrap from 0 to all-ones), and I read the current counter value from PIT_CVALn (just like QueryPerformanceCounter() on Windows). At 24 MHz, that should give me sub-microsecond resolution (actually sub-tenths-of-a-microsecond), and with 32 bits that should give me a wraparound period of about 178 seconds, which is more than sufficient for most embedded applications. Unfortunately in the Processor Expert configuration, in the Properties->Counter restart tab, when I configure the counter restart to be "On-overrun" (i.e. just let it free-run), the Overrun period entry says "Unassigned peripheral". The PEx User Guide says nothing about what that means, and no mouse-hover (tooltip) describes what it means either. What does "Unassigned peripheral" mean in this context, and how can I clear that error?


As an alternative, I tried setting "Counter restart" to "On-match", but what I would put in the Period entry is completely unclear: If I select "timer-ticks", it won't let me type in 0xffffffff... OH, MAN... It lets me type in 4294967296. Obviously Processor Expert was designed by art majors who don't understand hexadecimal. Processor Expert should be smart enough to translate "On-overrun" to set PIT_LDVALn to 0xffffffff (or 4294967296 for you art majors) automatically.


So I guess this is a non-question, but it documents something so stupid about Processor Expert that I feel obligated to post it anyway.