Fred Flintstone

PIT questions (yes, I know these come up a lot :))

Discussion created by Fred Flintstone on Jan 5, 2007
Latest reply on Jan 8, 2007 by olivierm olivierm
Hello-
 
I was trying to get PIT0 working on the M52233Demo board.  Searching through the forums I found the main piece of advice was to make sure that the desired interrupts were unmasked.  I've done this and it doesn't work yet.  If I trigger a forced interrupt in software with MCF_INTC_INTFRCH then I can get into my ISR so I know I have it set up correctly at that end.  The code I'm using is as follows:
 
 MCF_PIT0_PCSR   = 0b0000111100011001; 
/* Sets up PIT0 as max prescale, interrupts inabled, rollover to 0xFFFF, timer enabled */ 

 MCF_INTC_ICR55(0x00) = 0b00111111;
/* Set up timer priority as 7/7 */
 
 MCF_INTC_IMRH(0x00)  = 0x0000;
 MCF_INTC_IMRL(0x00)  = 0x0000;
/* Unmask all interrupts */   
 
Have I left something out?
 
I'm also a little confused by some of these register-accessing macros.  It looks like the macros use the passed parameter as an offset from the base value of the register.  When would I ever use this?  For example, IMRH/L by themselves already reach all 63 interrupt sources, so why would I ever need to pass a nonzero value to the macro? 
 
Likewise with the control register ICRnx.  'X' already runs over the available 63 sources, so why would I ever use different values of 'N'? 

Outcomes