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: TIMER ON TIVA USE 2 ULTRASONIC IN SAME PORT

Part Number: TM4C123GH6PM

can help me i use to timer 0 and timer 3 it does not work  this is code 

void Timer0A_voidinit(void)
{

SET_BIT(SYSCTL_RCGCTIMER_R,Timer0A_CLK); // enable clock to Timer Block 0
GPIO_Init(GPIO_PORTB,GPIO_PIN_6);
GPIO_SetPinDirection(GPIO_PORTB,GPIO_PIN_6,GPIO_DIRECTION_INPUT_PUSH_PULL);
SET_BIT( GPIO_PORTB_AFSEL_R,GPIO_PIN_6); // use PB6 alternate function
GPIO_PORTB_PCTL_R &= (unsigned int)~PB6_TOCCP0; // configure PB6 for T0CCP0
SET_BIT(GPIO_PORTB_PCTL_R, 24);
SET_BIT(GPIO_PORTB_PCTL_R, 25);
SET_BIT(GPIO_PORTB_PCTL_R, 26);

// PB2 as a digital output signal to provide trigger signal
GPIO_Init(GPIO_PORTA,GPIO_PIN_4);
GPIO_SetPinDirection(GPIO_PORTA,GPIO_PIN_4,GPIO_DIRECTION_OUTPUT);

CLR_BIT(TIMER0_CTL_R,Timer0A_CLK); // disable timer0A during setup
TIMER0_CFG_R = timer_mode16bit; // 16-bit timer mode
SET_BIT(TIMER0_TAMR_R,countup_bit); // up-count
SET_BIT(TIMER0_TAMR_R,Capture_mode1); //capture mode
SET_BIT(TIMER0_TAMR_R,Capture_mode2);
SET_BIT(TIMER0_TAMR_R,Edge_Time_mode); //edge-time
SET_BIT(TIMER0_CTL_R,Both_edge1);
SET_BIT(TIMER0_CTL_R,Both_edge2);
SET_BIT(TIMER0_CTL_R,Timer0A_CLK); // enable timer0A
}


void Timer3A_voidinit(void)
{

SET_BIT(SYSCTL_RCGCTIMER_R,Timer3A_CLK); // enable clock to Timer Block 1
GPIO_Init(GPIO_PORTB,GPIO_PIN_2);
GPIO_SetPinDirection(GPIO_PORTB,GPIO_PIN_2,GPIO_DIRECTION_INPUT_PUSH_PULL);
SET_BIT( GPIO_PORTB_AFSEL_R,GPIO_PIN_2); //use PF2 alternate function
GPIO_PORTB_PCTL_R &= (unsigned int)~PB2_T3CCP0; // configure PF2 for T1CCP0
SET_BIT(GPIO_PORTB_PCTL_R, 8);
SET_BIT(GPIO_PORTB_PCTL_R, 9);
SET_BIT(GPIO_PORTB_PCTL_R, 10);

// PE3 as a digital output signal to provide trigger signal
GPIO_Init(GPIO_PORTD,GPIO_PIN_3);
GPIO_SetPinDirection(GPIO_PORTD,GPIO_PIN_3,GPIO_DIRECTION_OUTPUT);

CLR_BIT(TIMER3_CTL_R,0); // disable timer2A during setup
TIMER3_CFG_R = timer_mode16bit; // 16-bit timer mode
SET_BIT(TIMER3_TAMR_R,countup_bit); // up-count
SET_BIT(TIMER3_TAMR_R,Capture_mode1); //capture mode
SET_BIT(TIMER3_TAMR_R,Capture_mode2);
SET_BIT(TIMER3_TAMR_R,Edge_Time_mode); //edge-time
SET_BIT(TIMER3_CTL_R,Both_edge1); // capture the rising edge pin 2,3
SET_BIT(TIMER3_CTL_R,Both_edge2);
SET_BIT(TIMER3_CTL_R,0); // enable timer2A
}    please help me Each one run correct put when use with same it dose not work