This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

TM4C123gh6pm Interrupts and GPIO output mismatch

Other Parts Discussed in Thread: BOOSTXL-K350QVG-S1, SW-TM4C

Hello, I am using  the TM4C123gh6pm evaluation board along with CCS 6.1.2 and Tivaware 2.1.2.111.

I was hoping you could give me some pointers to what is causing a mismatch in the values of my outputs.

I use the following interruptions:

PINB0              Set to be triggered by both edges, connected to a zero crossing detection circuit. Triggers an interruption of Timer2A or Timer3A.
Timer2A           Writes to PC4 or PC5 and triggers Timer4A
Timer3A           Writes to PC6 or PC7 and triggers Timer4A
Timer4A           Clears PC4 PC5 PC6 PC7


Hibernation      Set to generate an interrupt at RTC match, writes to PB1, PB2, PB3, PD2, PD3, PD6, PE3, PE4,  PF3, These are the outputs that do not match the                                  value that is written to them.

The main cycle checks the ADC and compares the output to a variable called temp_obj, if its over that value it writes 1 to flag_tobj otherwise it writes 0.


So far I tried disabling the interrupts when the RTC interrupt is triggered, and my outputs have keep their values more consistely but ocassionaly other values show up.


Im using the LCD BOOSTXL-K350QVG-S1, could it be causing an interference?

This is the code that I use in the hibernate interrupt handler:

void Hibernate_Handler(void)
{

	uint32_t ui32Status;
	ui32Status = HibernateIntStatus(1);
	HibernateIntClear(ui32Status);

	IntPendClear(INT_GPIOB);IntPendClear(INT_TIMER2A);IntPendClear(INT_TIMER3A);IntPendClear(INT_TIMER4A);
	IntDisable(INT_TIMER2A);IntDisable(INT_TIMER3A); GPIOIntDisable(GPIO_PORTB_BASE,GPIO_INT_PIN_0);

if(flag_tobj==1)
{
	switch(Sig_Proceso) {

			   case 0x00  ://PF3 PA7
						//3
					Sig_Proceso=0x01;

					GPIOPinWrite(GPIO_PORTA_BASE, GPIO_PIN_6|GPIO_PIN_7, 0x7F);
					GPIOPinWrite(GPIO_PORTB_BASE, GPIO_PIN_1|GPIO_PIN_2|GPIO_PIN_3, 0xFF);
					GPIOPinWrite(GPIO_PORTD_BASE, GPIO_PIN_2|GPIO_PIN_3|GPIO_PIN_6, 0xFF);
					GPIOPinWrite(GPIO_PORTE_BASE, GPIO_PIN_3|GPIO_PIN_4, 0xFF);
					GPIOPinWrite(GPIO_PORTF_BASE, GPIO_PIN_3, 0xF7);

					Tiempo_Proceso=5;
					HibernateRTCSet(0);
					HibernateRTCMatchSet(0,HibernateRTCGet()+Tiempo_Proceso);

					break;

                            case 0x01  :	 PB1 		PB3			 PA7

		 		    Sig_Proceso=0x02;

		 		    GPIOPinWrite(GPIO_PORTA_BASE, (GPIO_PIN_6|GPIO_PIN_7), 0x7F);
		 		    GPIOPinWrite(GPIO_PORTB_BASE, (GPIO_PIN_1|GPIO_PIN_2|GPIO_PIN_3), 0xF5);
		 		    GPIOPinWrite(GPIO_PORTD_BASE, (GPIO_PIN_2|GPIO_PIN_3|GPIO_PIN_6), 0xFF);
		 		    GPIOPinWrite(GPIO_PORTE_BASE, (GPIO_PIN_3|GPIO_PIN_4),0xFF);
		 		    GPIOPinWrite(GPIO_PORTF_BASE, GPIO_PIN_3, 0xFF);

		 		    Tiempo_Proceso=5;
		 	     	    HibernateRTCSet(0);
		 		    HibernateRTCMatchSet(0,HibernateRTCGet()+Tiempo_Proceso);

		 		   break;

}
}else
	{
	Tiempo_Proceso=05;
	HibernateRTCSet(0);
	HibernateRTCMatchSet(0,HibernateRTCGet()+Tiempo_Proceso);
    }

IntPendClear(INT_GPIOB);IntPendClear(INT_TIMER2A);IntPendClear(INT_TIMER3A);IntPendClear(INT_TIMER4A);
IntEnable(INT_TIMER2A);IntEnable(INT_TIMER3A); GPIOIntEnable(GPIO_PORTB_BASE,GPIO_INT_PIN_0);
}