Tool/software: Code Composer Studio
I am using PC6 on my TM4c123gh6pm microntroller and the issue is that the code works and i am getting a time capture from Wtimer but in its ISR the flag is not setting. ? Code composer studio shows me (*) asteriks at that position and in watch window it shows me type as: READNONE/WRITE NONE. Why is it doing that? Whats the problem and the solution.
void PeriodMeasure_Init(void){
// Enable pin PC6 for WTIMER1 WT1CCP0= WTimer1 A
noInterrupts();
SYSCTL_RCGCGPIO_R |= (1<<2); // activate port C CLOCK
SYSCTL_RCGCWTIMER_R |= (1<<1); // activate Wtimer1 CLOCK
//GPIOPinUnlockGPIO(GPIO_PORTC_BASE, GPIO_PIN_6); // Unlock the PD7 GPIO
GPIO_PORTC_DIR_R &= ~(1<<6); // make PC6 input
GPIO_PORTC_AFSEL_R |= (1<<6); // enable alt funct
GPIO_PORTC_DEN_R |= (1<<6); // enable Digital Function
GPIO_PORTC_PCTL_R = (GPIO_PORTC_PCTL_R & 0xF0FFFFFF)+0x07000000; //Configured as WTimer on Pin6
WTIMER1_CTL_R &= ~0x00000001; // disable timer1A during setup
WTIMER1_CFG_R = 0x00000004; // configure for 32-bit capture mode
WTIMER1_TAMR_R = 0x00000017; // configure for rising edge event
WTIMER1_CTL_R &= ~0x0000000C; // rising edge
WTIMER1_TAILR_R = 0x00000000; // start value
WTIMER1_TAPR_R = 0xFFFF; // activate prescale, PreScaler Counts: 65535 Time to Reset: 3.518
WTIMER1_IMR_R |= 0x00000004; // enable capture match interrupt
WTIMER1_ICR_R |= (1<<2); // clear timer0A capture match flag //Clear Flag
WTIMER1_CTL_R |= 0x00000001; // timer0A 24-b, +edge, interrupts
NVIC_PRI24_R = (NVIC_PRI24_R & 0xFFFFFF1F) | (1<<5); //WTimer1A->priority 1
NVIC_EN3_R |= 0x1; // enable interrupt 96 in NVIC
interrupts();
}
void WideTimer1A_Handler(void){
if(FirstRun==1){
WTIMER1_ICR_R = 0x00000004; // clear timer0A capture match flag //Clear Flag
Periodlong = (WTIMER1_TAR_R - INT_TIME) & 0xFFFFFFFF; // 32-bit, 12.5ns resolution
Time=Periodlong*12.5e-9;
INT_TIME = WTIMER1_TAR_R; // setup for next
}
FirstRun = 1; // set semaphore
WTIMER1_ICR_R = 0x00000004; // clear timer0A capture match flag //Clear Flag
}