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.

RTOS/DK-TM4C129X: ROM_GPIOADCTriggerEnable() Use ADC

Part Number: DK-TM4C129X

Tool/software: TI-RTOS

Use the touch example .

void
TouchScreenInit(uint32_t ui32SysClock)

it function work well.

but i'm not want ADC_TRIGGER use timer. i want gpio.

so, make new function

yb_TouchScreenInit

{

g_ui32TSState = TS_STATE_INIT;

//
// There is no touch screen handler initially.
//
g_pfnTSHandler = 0;

//
// Enable the peripherals used by the touch screen interface.
//
ROM_SysCtlPeripheralEnable(SYSCTL_PERIPH_ADC0);
ROM_SysCtlPeripheralEnable(SYSCTL_PERIPH_TIMER5);

//TRIGGER_EXTERNAL Pin configuration
ROM_GPIOADCTriggerEnable(GPIO_PORTB_BASE,GPIO_PIN_7);
ROM_GPIOPinTypeGPIOOutput(GPIO_PORTB_BASE,GPIO_PIN_7);

//
// Configure the ADC sample sequence used to read the touch screen reading.
//
ROM_ADCHardwareOversampleConfigure(ADC0_BASE, 4);
ROM_ADCSequenceConfigure(ADC0_BASE, 3, ADC_TRIGGER_EXTERNAL, 0);
ROM_ADCSequenceStepConfigure(ADC0_BASE, 3, 0,
TS_YP_ADC | ADC_CTL_END | ADC_CTL_IE);
ROM_ADCSequenceEnable(ADC0_BASE, 3);

//
// Enable the ADC sample sequence interrupt.
//
ROM_ADCIntEnable(ADC0_BASE, 3);
ROM_IntEnable(INT_ADC0SS3);

I think PB7 toggle then  ADC trigger.

( ROM_GPIOPinWrite(GPIO_PORTB_BASE,GPIO_PIN_7,GPIO_PIN_7);  ROM_GPIOPinWrite(GPIO_PORTB_BASE,GPIO_PIN_7,0);

but write PB7, die program.

i have question.

1. ROM_GPIOADCTriggerEnable don't use ROM_GPIOPinTypeGPIOOutput?

2. i'm not have equipment for change pb7 voltage value.

    So how do i use the ADC_TRIGGER_EXTERNAL?


please help me.

thank you

  • You must enable GPIO port B before using it.

        SysCtlPeripheralEnable(SYSCTL_PERIPH_GPIOB);
    

  • I'm use function void DK_TM4C129X_initGeneral(void)

    {
        SysCtlPeripheralEnable(SYSCTL_PERIPH_GPIOA);
        SysCtlPeripheralEnable(SYSCTL_PERIPH_GPIOB);
        SysCtlPeripheralEnable(SYSCTL_PERIPH_GPIOC);
        SysCtlPeripheralEnable(SYSCTL_PERIPH_GPIOD);
        SysCtlPeripheralEnable(SYSCTL_PERIPH_GPIOE);
        SysCtlPeripheralEnable(SYSCTL_PERIPH_GPIOF);
        SysCtlPeripheralEnable(SYSCTL_PERIPH_GPIOG);
        SysCtlPeripheralEnable(SYSCTL_PERIPH_GPIOH);
        SysCtlPeripheralEnable(SYSCTL_PERIPH_GPIOJ);
        SysCtlPeripheralEnable(SYSCTL_PERIPH_GPIOK);
        SysCtlPeripheralEnable(SYSCTL_PERIPH_GPIOL);
        SysCtlPeripheralEnable(SYSCTL_PERIPH_GPIOM);
        SysCtlPeripheralEnable(SYSCTL_PERIPH_GPION);
        SysCtlPeripheralEnable(SYSCTL_PERIPH_GPIOP);
        SysCtlPeripheralEnable(SYSCTL_PERIPH_GPIOQ);
        SysCtlPeripheralEnable(SYSCTL_PERIPH_GPIOR);
        SysCtlPeripheralEnable(SYSCTL_PERIPH_GPIOS);
        SysCtlPeripheralEnable(SYSCTL_PERIPH_GPIOT);
    }

    It still does not work.
  • Can you describe the behavior in more detail? Is the CPU going to a fault ISR?
  • I have not heard back from you. I assume you have resolved this issue. If not, please respond to this thread.