Hi
I need to use F28035's CPU Timer1 and Timer2 to generate 2 interrupt routines
to demostrate that Timer1's interrupt breaks into timer2's interrupt routine.
So I set Timer1's period to 10us and Timer2's period to 100us. And I also wrote
a while loop to delay about 35us at Timer2's interrupt routine. In this way, Timer2's
interrupt routine can be interrupted by Timer1 several times.
To my surprise, Timer1 cannot interrupt Timer2's interrupt routine, Only Timer2
can interrupt Timer1's interrupt routine.
I checked SPRUGL8C, Timer1's interrupt priority is 17, and Timer2's interrupt
priority is 18, so Timer1 has a higher priority than Timer2. I don't know if there are
some mistakes in my program.
thanks,
Jiakai
PS: The initialization program is as follows:
const volatile struct CPUTIMER_REGS* aryCpuTimer[3] = {&CpuTimer0Regs, &CpuTimer1Regs, &CpuTimer2Regs};
void PS_InitTimer(int timerNo, Uint32 interval, PINT vec)
{
struct CPUTIMER_REGS *pTimer = (struct CPUTIMER_REGS *)aryCpuTimer[timerNo];
pTimer->PRD.all = interval - 1;
pTimer->TPR.bit.TDDR = 0; // make it to CPU clock
pTimer->TPRH.bit.TDDRH = 0;
pTimer->TCR.all = 0x4030; // reload/interrupt but not start
// pTimer->TCR.bit.TIE = 1; // interrupt enable bit, 1: enable
// pTimer->TCR.bit.TRB = 1; // timer reload bit.
// pTimer->TCR.bit.SOFT = 0; // Timer free run
// pTimer->TCR.bit.FREE = 0; // Timer Free Run
// pTimer->TCR.bit.TSS = 1; // 0: Start Timer, 1: Stop timer
EALLOW; // This is needed to write to EALLOW protected registers
PieVectTable.TINT1 = vec;
IER |= (timerNo == 0) ? M_INT1 : ((timerNo == 1) ? M_INT13 : M_INT14);
EDIS; // This is needed to disable write to EALLOW protected registers
pTimer->TCR.bit.TSS = 0; // 0: Start Timer, 1: Stop timer
}