#define GPTMCFG_TIMER0 (*((volatile unsigned long *)0x40030000)) //GPTMConfiguration #define GPTMCTL_TIMER0 (*((volatile unsigned long *)0x4003000c)) //:GPTMControl #define GPTMTAMR_TIMER0 (*((volatile unsigned long *)0x40030004)) //GPTMTimerAMode
#define RCGC_TIMER (*((volatile unsigned long *)0x400FE604)) //16/32-BitGeneral-PurposeTimerRunModeClockGatingControl (RCGCTIMER) #define GPTMTAILR_TIMER0 (*((volatile unsigned long *)0x40030028)) //:GPTMTimerAIntervalLoad #define GPTMRIS_TIMER0 (*((volatile unsigned long *)0x4003001c)) //:GPTMRawInterruptStatus #define GPTMICR_TIMER0 (*((volatile unsigned long *)0x40030024)) //:GPTMInterruptClear void SystemInit(void){ } void TimerModule_POWER() { RCGC_TIMER |= 0x01 ; //Giving clock to timer0 } void timer0_init() { GPTMCTL_TIMER0 |= (0<<0) | (0<< 8) ; //Disabling Timer bits for TimerA and TimerB GPTMCFG_TIMER0 = 0x00000000 ; GPTMTAMR_TIMER0 |= (0x2<<0) ;//Enabling for periodic mode GPTMTAMR_TIMER0 |= (1<<4) ; //for count up GPTMTAILR_TIMER0 = 0x0000f42400; //1 sec delay for 16MHz } void timer_delay() { GPTMCTL_TIMER0 |= (1<<0) | (1<<8) ; //Enabling TimerA and TimerB while(!(GPTMRIS_TIMER0 & 0x01)); //waiting for counter to match the value written in Interval Load register GPTMICR_TIMER0 |= (1<<0) ; } int main() { TimerModule_POWER() ; timer0_init() ; while(1) { GPIODATA_PORTE ^= 0x55 ; timer_delay(); } } /* Compilation is done without any error or warning but simulation in Keil is not running. In command window "*** error 65: access violation at 0x400FE604 : no 'read' permission ". What's the problem ?