Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- CpuTimer0Regs.PRD.all = 2400; // Period: 2400 = 5 kHz @ 12 MHz
- CpuTimer0Regs.TPR.bit.TDDR = 0; // Divide Down Register: 0 => prescaler = 1
- CpuTimer0Regs.TPRH.bit.TDDRH = 0;
- CpuTimer0Regs.TCR.bit.FREE = 0; // Halt at breakpoints
- CpuTimer0Regs.TCR.bit.SOFT = 0; // Stop after the nect timer cycle at breakpoints
- CpuTimer0Regs.TCR.bit.TIF = 1; // Clear the interrupt flag
- CpuTimer0Regs.TCR.bit.TIE = 1; // Enable interrupts
- CpuTimer0Regs.TCR.bit.TRB = 1; // Reload the timer registers
- CpuTimer0Regs.TCR.bit.TSS = 0; // Start/enable the timer
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement