Hi all. I am new program for EK-TM4C1294 XL board. I study follow "Work Book TM4C1294.pdf". I want to use timer with interrupt to generate precision time. But when i run program, cpu can not jump into Timer Interrupt Service Rountie. My code is below. I am using IAR IDE with preprocessor parameter are
"ewarm" and "TARGET_IS_TM4C129_RA0"
#include <stdbool.h>
#include <stdint.h>
#include "driverlib/inc/hw_memmap.h"
#include "driverlib/inc/hw_types.h"
#include "driverlib/inc/hw_nvic.h"
#include "driverlib/inc/hw_ints.h"
#include "driverlib/debug.h"
#include "driverlib/gpio.h"
#include "driverlib/rom.h"
#include "driverlib/rom_map.h"
#include "driverlib/sysctl.h"
#include "driverlib/systick.h"
#include "driverlib/interrupt.h"
#include "driverlib/timer.h"
/* Declaring Global Variables */
uint32_t sys_clock_hz;
/* Declaring Function Prototype */
void Timer_ISR(void);
int main(void)
{
/* Configure system clock using external clock and PLL */
sys_clock_hz = MAP_SysCtlClockFreqSet(SYSCTL_XTAL_25MHZ | SYSCTL_OSC_MAIN | SYSCTL_USE_PLL | SYSCTL_CFG_VCO_480,
120000000);
SysCtlPeripheralEnable(SYSCTL_PERIPH_GPION);
SysCtlPeripheralEnable(SYSCTL_PERIPH_TIMER0);
/* Configure led as output */
GPIOPinTypeGPIOOutput(GPIO_PORTN_BASE,GPIO_PIN_0);
/* Configure Timer with 100mS period */
TimerConfigure(TIMER0_BASE,TIMER_CFG_PERIODIC);
TimerLoadSet(TIMER0_BASE,TIMER_A,(sys_clock_hz/10)-1);
TimerIntRegister(TIMER0_BASE,TIMER_A,Timer_ISR);
TimerIntEnable(TIMER0_BASE,TIMER_TIMA_TIMEOUT);
IntEnable(INT_TIMER0A);
TimerEnable(TIMER0_BASE,TIMER_A);
IntMasterEnable();
/* Infinite Loop */
while(1)
{
}
}
void Timer_ISR(void)
{
/* Clear the timer interrupt */
TimerIntClear(TIMER0_BASE,TIMER_TIMA_TIMEOUT);
if(GPIOPinRead(GPIO_PORTN_BASE,GPIO_PIN_0))
{
GPIOPinWrite(GPIO_PORTN_BASE,GPIO_PIN_0,0x00);
}
else
{
GPIOPinWrite(GPIO_PORTN_BASE,GPIO_PIN_0,0xff);
}
}