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: ADC Multichannel

Part Number: TM4C123GH6PM

Hello everyone,

Q.1.There are two ADC Modules i.e. ADC0 and ADC1 in Tiva TM4C123GH6PM. I want  to connect 6 sensors at a time.So I want to know whether can  I use  SS0 and SS0 for both the modules i.e. ADC0 and ADC1?

Q.2.In the block diagram of ADC module of Tiva  there are blocks of SS0,Sample Sequencer 0 , so what is the difference between these two?

Q.3. What is the use of Control/Status block?

These block descriptions are not given properly in the datasheet.

I have attached the diagram below.

#include <stdint.h>
#include <stdbool.h>
#include "inc/hw_memmap.h"
#include "inc/hw_types.h"
#include "driverlib/debug.h"
#include "driverlib/sysctl.h"
#include "driverlib/adc.h"
int main(void)
{
uint32_t ui32ADC0Value[4];
volatile uint32_t ui32TempAvg;
volatile uint32_t ui32TempValueC;
volatile uint32_t ui32TempValueF;
SysCtlClockSet(SYSCTL_SYSDIV_5|SYSCTL_USE_PLL|SYSCTL_OSC_MAIN|SYSCTL_XTAL_16MHZ);
SysCtlPeripheralEnable(SYSCTL_PERIPH_ADC0);
ADCSequenceConfigure(ADC0_BASE, 1, ADC_TRIGGER_PROCESSOR, 0);
ADCSequenceStepConfigure(ADC0_BASE, 1, 0, ADC_CTL_TS);
ADCSequenceStepConfigure(ADC0_BASE, 1, 1, ADC_CTL_TS);
ADCSequenceStepConfigure(ADC0_BASE, 1, 2, ADC_CTL_TS);
ADCSequenceStepConfigure(ADC0_BASE,1,3,ADC_CTL_TS|ADC_CTL_IE|ADC_CTL_END);
ADCSequenceEnable(ADC0_BASE, 1);
while(1)
{
}
}

  • Abhishek Dutta said:
    Q.1.There are two ADC Modules i.e. ADC0 and ADC1 in Tiva TM4C123GH6PM. I want  to connect 6 sensors at a time.So I want to know whether can  I use  SS0 and SS0 for both the modules i.e. ADC0 and ADC1?

    Yes, you can. See below figure. The ADINx are shared between the two ADC modules.

    Abhishek Dutta said:
    Q.2.In the block diagram of ADC module of Tiva  there are blocks of SS0,Sample Sequencer 0 , so what is the difference between these two?

    What do you mean by blocks of SS0. I don't see that in the diagram. There are four sample sequencer, SS0, SS1, SS2 and SS3 shown in the diagram. Each one supports a different number of samples. For example, SS0 can support 8 samples while SS3 can only support 1 sample. If you have six sensors to sample then you want to choose SS0.

    Abhishek Dutta said:
    Q.3. What is the use of Control/Status block?

    For each sample sequencer you will need to properly configure them before you can use them. I will suggest you go through these registers in the datasheet. Even better, I will suggest you look at the TivaWare library adc examples and you will get a better understanding on how to configure the ADC. The TivaWare library API will abstract the configuration for you so you don't need to exactly know how each control register is configured.