Hi,
////////////Common Header Files #include <stdbool.h> #include <stdint.h> #include "inc/hw_memmap.h" #include "driverlib/pin_map.h" #include "driverlib/sysctl.h" /////////Peripheral Header File #include "driverlib/timer.h" #include "driverlib/gpio.h" #include "driverlib/interrupt.h" #include "inc/hw_ints.h" int toggle; void timer_B_0_Int(void) { TimerIntClear(TIMER0_BASE, TIMER_TIMB_TIMEOUT); toggle ^=0x00000002; GPIOPinWrite(GPIO_PORTF_BASE, GPIO_PIN_1, toggle); } int main(void) { SysCtlClockSet(SYSCTL_SYSDIV_10 | SYSCTL_USE_PLL | SYSCTL_OSC_MAIN | SYSCTL_XTAL_16MHZ); SysCtlPeripheralEnable(SYSCTL_PERIPH_GPIOF); GPIOPinTypeGPIOOutput(GPIO_PORTF_BASE, GPIO_PIN_3|GPIO_PIN_2|GPIO_PIN_1); SysCtlPeripheralEnable(SYSCTL_PERIPH_TIMER0); TimerConfigure(TIMER0_BASE, TIMER_CFG_B_PERIODIC); TimerClockSourceSet(TIMER0_BASE,TIMER_CLOCK_SYSTEM); TimerLoadSet(TIMER0_BASE, TIMER_B, SysCtlClockGet()); IntEnable(INT_TIMER0B); TimerIntEnable(TIMER0_BASE, TIMER_TIMB_TIMEOUT); toggle = 0x00000000; TimerEnable(TIMER0_BASE, TIMER_B); while(1) { } }
1) In the above code i cant able to get the output
2) which I use the timer interrupt for TIMER A , the above code is working. its not working in TIMER B