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: tm4cgh6pm adc sample sequencer ss0

Part Number: TM4C123GH6PM


Tool/software:

Hi 

how to do the code like below for ss0 
because ss0 will sample 8 channels continuously 
how to get 8 sample data from ssfifo0 buffer, I am unable to proceed further in code 

all examples show, only for ss3 single channel

while(1) {


ADC0->PSSI |= (1<<3); /* Enable SS3 conversion or start sampling data from AN0 */

while((ADC0->RIS & 8) == 0) ; /* Wait untill sample conversion completed*/

adc_value = ADC0->SSFIFO3; /* read adc coversion result from SS3 FIFO*/

ADC0->ISC = 8; /* clear coversion clear flag bit*/

The above example, is for ss3, with single channel

i don't want to use ADCSequenceDataGet 

  • Hi,

      SS3 can only take one sample. If you want to take eight samples, you would need to use SS0. Below is an example to configure SS0 for three channels. You can extend to eight channels. I also notice that you are writing code in DRM (Direct Register Manipulation) style. This method of coding is not recommended. The TivaWare SDK provides drivers with APIs to easily configure the peripherals and the drivers are well tested and proven. Writing in DRM style is error prone and there is no need to reinvent the wheel when the drivers are provided.

    GPIOPinTypeADC(GPIO_PORTE_BASE, GPIO_PIN_3 | GPIO_PIN_2 | GPIO_PIN_1);

    ADCSequenceConfigure(ADC0_BASE, 0, ADC_TRIGGER_PROCESSOR, 0);

    ADCSequenceStepConfigure(ADC0_BASE, 0, 0, ADC_CTL_CH0 );

    ADCSequenceStepConfigure(ADC0_BASE, 0, 1, ADC_CTL_CH1 );

    ADCSequenceStepConfigure(ADC0_BASE, 0, 2, ADC_CTL_CH2 | ADC_CTL_IE |
    ADC_CTL_END);

    ADCSequenceEnable(ADC0_BASE, 0);

    ADCIntClear(ADC0_BASE, 0);

      

  • Hi

    charles ,i understood, 

    Thanks for your reply