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.

LP-AM263P: ADC Sampling in the SDK

Part Number: LP-AM263P
Other Parts Discussed in Thread: SYSCONFIG

Tool/software:

Hello,

     I am trying to implement the ADC_forceMultipleSOC() function. In the SDK, the comments say to pass in (for example)  (ADC_FORCE_SOC0 | ADC_FORCE_SOC1 | ADC_FORCE_SOC2) into socMask. The available ADC_FORCE_SOCX option ranges from 0-15. However in the syscfg, you can initialize 6 input pins for each of the 5 available ADC instances, which means 30 pins can be initialized. So what do each of the force options correspond to? How do you pick the right ADC_FORCE_SOCX option to access the intended pin?

     Thank You,

         Saanvi

  • Hi Saanvi

    I think there's a misunderstanding here about what SOC (Start of Conversion) refers to in the context of ADC on the AM263P. Let me clarify this for you

    SOC (Start of Conversion) and ADC input pins are completely different concepts:

    What SOC Actually Means:
    - SOC0-SOC15 are conversion sequence numbers within each ADC instance
    - Each SOC is a configurable conversion sequence that can sample from any available ADC input channel
    - Think of SOCs as "conversion slots"
    - You configure each SOC to specify which input channel it should sample from

    What ADC Input Pins Are:
    - Physical input pins on the ADC (like AIN0, AIN1, AIN2, etc.)
    - Each ADC instance typically has 6 input channels (AIN0-AIN5)
    - These are the actual analog input pins you connect your signals to

    How the Mapping Works:

    // Example configuration for ADC0
    // SOC0 configured to sample from AIN0 (input pin 0)
    // SOC1 configured to sample from AIN1 (input pin 1)
    // SOC2 configured to sample from AIN0 (same pin as SOC0!)
    // SOC3 configured to sample from AIN3 (input pin 3)

    Using ADC_forceMultipleSOC():

    When you call:
    ADC_forceMultipleSOC(adcBaseAddr, (ADC_FORCE_SOC0 | ADC_FORCE_SOC1 | ADC_FORCE_SOC2));

    You're telling the ADC to:
    1. Start conversion on SOC0 (which samples whatever input channel SOC0 is configured for)
    2. Start conversion on SOC1 (which samples whatever input channel SOC1 is configured for)  
    3. Start conversion on SOC2 (which samples whatever input channel SOC2 is configured for)

    How to Choose the Right SOC:

    1. Configure each SOC in SysConfig or code to specify which input channel it samples
    2. Use the SOC number that corresponds to the input channel you want to sample
    3. If you want to sample input pin AIN2, use whichever SOC you've configured to sample from AIN2

    Example Scenario:
    - You have 5 ADC instances × 6 input pins = 30 total input pins
    - Each ADC instance has 16 SOCs (SOC0-SOC15) available
    - You could configure SOC0-SOC5 on each ADC to sample from AIN0-AIN5 respectively
    - Then use `ADC_FORCE_SOC0` to sample from AIN0, `ADC_FORCE_SOC1` to sample from AIN1, etc.

    The key is that the SOC number doesn't directly correspond to a pin number - it corresponds to a conversion sequence that you've configured to sample from a specific pin.

    Hope this clarifies the relationship between SOCs and input pins for you, also highly recommend you to go thrrough the ADC TRM chapter.

    Regards,
    Akshit