Hi there, could there anybody help me out for this problem with some working example for this timer mode?
I saw a lot of similiar questions in this forum but I nowhere found one simple example. In Stellarisware one could find only examples for oneshot_16bit, periodic_16bit and pwm. Pwm is the timer's working method which seems to be closest to this I need ..
I have stolen the example "timers" from Stellarisware/boards and adopted it to my requirements - I have an LM4F232 dev-kit and I try to count square in 1 KHz range waves by the help of CC timers which I lead to port PL0 and PL1 which should be unused on my board.
By the way; why are all function-calls prefixed with ROM_ in the Stellarisware-examples ?
------
here comes the (semi-)code
void
Timer0IntHandler(void)
{
ROM_TimerIntClear(TIMER0_BASE, TIMER_TIMA_TIMEOUT);
HWREGBITW(&g_ulFlags, 0) ^= 1;
g_ulCounter++;
}
//*****************************************************************************
//
// The interrupt handler for the second timer interrupt.
//
//*****************************************************************************
void
Timer1IntHandler(void)
{
ROM_TimerIntClear(TIMER1_BASE, TIMER_TIMA_TIMEOUT);
HWREGBITW(&g_ulFlags, 1) ^= 1;
g_ulCounter++;
}
in main() I do this ...
ROM_FPULazyStackingEnable();
ROM_SysCtlClockSet(SYSCTL_SYSDIV_1 | SYSCTL_USE_OSC | SYSCTL_OSC_MAIN |
SYSCTL_XTAL_16MHZ);
FAL96x64x16Init();
GrContextInit(&g_sContext, &g_sCFAL96x64x16);
ROM_SysCtlPeripheralEnable(SYSCTL_PERIPH_TIMER0); //
//ROM_IntMasterEnable();
SysCtlPeripheralEnable(SYSCTL_PERIPH_GPIOP);
GPIOPinConfigure(GPIO_PL0_T0CCP0);
GPIOPinConfigure(GPIO_PL1_T0CCP1);
GPIOPinTypeTimer(GPIO_PORTL_BASE, GPIO_PIN_0);
GPIOPinTypeTimer(GPIO_PORTL_BASE, GPIO_PIN_1);
TimerConfigure(TIMER0_BASE, (
TIMER_CFG_SPLIT_PAIR
| TIMER_CFG_A_CAP_TIME
| TIMER_CFG_B_CAP_TIME
));
TimerControlEvent( TIMER0_BASE, TIMER_BOTH, TIMER_EVENT_BOTH_EDGES );
TimerLoadSet(TIMER0_BASE, TIMER_A, SysCtlClockGet());
TimerLoadSet(TIMER0_BASE, TIMER_B, SysCtlClockGet() / 1000000);
IntMasterEnable();
TimerIntEnable(TIMER0_BASE, ( TIMER_CAPA_EVENT | TIMER_CAPB_EVENT ));
IntEnable( INT_TIMER0A | INT_TIMER0B);
TimerEnable(TIMER0_BASE, TIMER_A);
TimerEnable(TIMER0_BASE, TIMER_B);
while(1)
{}
I have a breakpoint in every ISR but never fall into.
Could I have something twisted in the init-sequence?
Thanks in advance
--jens