Hi,
I'm trying to setup Timer1 to use as a milli-timer on our system (the Logic PD Zoom Development board with the C6748 SOM). My configuration is as follow:
- C6748 DSP
- CCS 5.1.1 with DSP/BIOS v5.41.11.38, Code generation tools v7.3.2
- EDMA3 LLD v1.11.03.01
- PSP drivers v1.30.01 for the C6748
I'm using the PSP drivers for the I2C0 peripheral drivers and the CSLR macros to access the Timer1 registers. My goal is to toggle an LED through the port expander (I2C0) and then measure the time between toggles with Timer1 in 32-bit unchained mode. However, the problem is that I can't seem to get all of these to work together. From my understanding DSP/BIOS uses Timer0 by default and should not affect Timer1 in any other way unless specifically configured that way. I suspect that it might have something to do with the pinmux, but I'm not sure. Here is my configuration of Timer1:
_timer1_prd = timer_period;
// Set TM64P_OUT12 and TM64P_IN12 as GPIO pins
CSL_FINST(tmr1_regs->GPINTGPEN, TMR_GPINTGPEN_GPENO12, GPIO);
CSL_FINST(tmr1_regs->GPINTGPEN, TMR_GPINTGPEN_GPENI12, GPIO);
// Configure TM64P_OUT12 and TM64P_IN12 as ouputs in GPIO mode
CSL_FINST(tmr1_regs->GPDATGPDIR, TMR_GPDATGPDIR_GPDIRO12, OUTPUT);
CSL_FINST(tmr1_regs->GPDATGPDIR, TMR_GPDATGPDIR_GPDIRI12, OUTPUT);
// Stop and reset Timer1
tmr1_regs->TGCR = 0x00000000;
tmr1_regs->TCR = 0x00000000;
// Disable and clear all interrupts
tmr1_regs->INTCTLSTAT = 0x00000000;
// Set emulation to free run mode
CSL_FINST(tmr1_regs->EMUMGT, TMR_EMUMGT_SOFT, INCREMENT);
CSL_FINST(tmr1_regs->EMUMGT, TMR_EMUMGT_FREE, FREE);
// Configure Timer1 for 32-bit unchained mode
CSL_FINST(tmr1_regs->TGCR, TMR_TGCR_TIMMODE, 32BIT_UNCHAIN);
CSL_FINS(tmr1_regs->TGCR, TMR_TGCR_PSC34, 0x1);
// Set the period for Timer1 3:4
tmr1_regs->TIM34 = 0x00000000;
tmr1_regs->PRD34 = _timer1_prd;
// Enable Timer1 3:4 for continuous reload mode
CSL_FINST(tmr1_regs->TCR, TMR_TCR_ENAMODE34, EN_CONT);
// Take Timer1 3:4 out of reset
CSL_FINST(tmr1_regs->TGCR, TMR_TGCR_TIM34RS, NO_RESET);
Can someone please provide me with some insight into the problem??
Regards
Reinier
EDIT: I do not want to use interrupts in any way on Timer1, I just want to read TIM34 and deduce the elapsed milli-seconds from the reading, based on the previous reading.