I can't synchronize two timer on my mcu. I have tried two methods. First one is the way you would think it would work:
MAP_SysCtlPeripheralEnable(SYSCTL_PERIPH_WTIMER0); // Configure timers to input edge time mode and counting up MAP_TimerConfigure(WTIMER0_BASE, (TIMER_CFG_SPLIT_PAIR | TIMER_CFG_A_CAP_TIME_UP | TIMER_CFG_B_CAP_TIME_UP)); // Configure to capture the rising edge MAP_TimerControlEvent(WTIMER0_BASE, TIMER_BOTH, TIMER_EVENT_POS_EDGE); // Enable interrupts MAP_TimerIntEnable(WTIMER0_BASE, (TIMER_CAPA_EVENT | TIMER_CAPB_EVENT)); MAP_TimerControlStall(WTIMER0_BASE, TIMER_A, true); MAP_TimerEnable(WTIMER0_BASE, TIMER_BOTH); MAP_TimerConfigure(WTIMER1_BASE, (TIMER_CFG_SPLIT_PAIR | TIMER_CFG_B_PERIODIC_UP)); // Set period to maximum MAP_TimerLoadSet(WTIMER1_BASE, TIMER_B, 0xFFFFFFFF); // Set first match to half period MAP_TimerMatchSet(WTIMER1_BASE, TIMER_B, START_HALF_PERIOD); // Enable interrupt MAP_TimerIntEnable(WTIMER1_BASE, TIMER_TIMB_MATCH); MAP_TimerControlStall(WTIMER1_BASE, TIMER_B, true); // Enable timer MAP_TimerEnable(WTIMER1_BASE, TIMER_B); // Synchronize the clock MAP_TimerSynchronize(WTIMER1_BASE, WTIMER_0A_SYNC | WTIMER_1B_SYNC);
This way nothing happens. The clocks are running but not synchronized. Then I tried the other way with TIMER0_BASE. The code before is the same only the sync part has changed
MAP_SysCtlPeripheralEnable(TIMER0_BASE); MAP_TimerSynchronize(TIMER0_BASE, WTIMER_0A_SYNC | WTIMER_1B_SYNC); MAP_TimerSynchronize(TIMER0_BASE, 0);
But then the whole thing crashes on the first synchronize function to exception.
This is what is in exception register:
SYSEXC_RIS_FPIXCRIS 1 Floating-Point Inexact Exception Raw Interrupt Status
So the question is what am I doing wrong? Or is it not possible to synchronize the clocks?
BR
JHi