Example Usage Flow
EALLOW; // This is needed to write to EALLOW protected registers
PieVectTable.TINT0 = &cpu_timer0_isr;
EDIS; // This is needed to disable write to EALLOW protected registers
// Include application specific functions. This is for this example:
// Configure CPU-Timer 0 to interrupt every second:
ConfigCpuTimer(&CpuTimer0, 100, 1000000); // 100MHz CPU Freq, 1 second
// Period (in uSeconds)
StartCpuTimer0();
// Enable CPU INT1 which is connected to CPU-Timer 0:
IER |= M_INT1;
// Enable TINT0 in the PIE: Group 1 interrupt 7
PieCtrlRegs.PIEIER1.bit.INTx7 = 1;
// Enable global Interrupts and higher priority real-time debug events:
EINT; // Enable Global interrupt INTM
ERTM; // Enable Global realtime interrupt DBGM
// Step 6. IDLE loop. Just sit and loop forever (optional):
for(;;);
}
// Step 7. Insert all local Interrupt Service Routines (ISRs) and functions
here:
// If local ISRs are used, reassign vector addresses in vector table as
// shown in Step 5
interrupt void cpu_timer0_isr(void)
{
CpuTimer0.InterruptCount++;
// Acknowledge this interrupt to recieve more interrupts from group 1
PieCtrlRegs.PIEACK.all = PIEACK_GROUP1;
}
3 - 14 C28x - Peripheral Registers Header Files