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.

TMS320F280039C: Analog Input

Part Number: TMS320F280039C
Other Parts Discussed in Thread: SYSCONFIG

Hi,

I am using  the board "TMDSCNCD 280039C" with Docking station.

I was reading Analog using  example  "adc_ex1_soc_software". In the example the four input pin reading OK from A0,A1,C2, C3.

I am not able to read different pin like A2,A3.. etc.

Can you please provide which part need to change exactly to read any analog pin. 

///////////////////////////////////My code////////////////////

while(1)
{
//
// Convert, wait for completion, and store results
//
ADC_forceMultipleSOC(myADC0_BASE, (ADC_FORCE_SOC0|ADC_FORCE_SOC1|ADC_FORCE_SOC2|ADC_FORCE_SOC3));

//
// Wait for ADCA to complete, then acknowledge flag
//
while(ADC_getInterruptStatus(myADC0_BASE, ADC_INT_NUMBER1) == false)
{
}
ADC_clearInterruptStatus(myADC0_BASE, ADC_INT_NUMBER1);

// ADC_forceMultipleSOC(myADC1_BASE, (ADC_FORCE_SOC0 | ADC_FORCE_SOC1));
// //
// // Wait for ADCC to complete, then acknowledge flag
// //
// while(ADC_getInterruptStatus(myADC1_BASE, ADC_INT_NUMBER1) == false)
// {
// }
// ADC_clearInterruptStatus(myADC1_BASE, ADC_INT_NUMBER1);

//
// Store results
//
myADC0Result0 = ADC_readResult(ADCARESULT_BASE, ADC_SOC_NUMBER3);


// myADC0Result1 = ADC_readResult(ADCARESULT_BASE, ADC_SOC_NUMBER1);
// myADC1Result0 = ADC_readResult(ADCCRESULT_BASE, ADC_SOC_NUMBER0);
// myADC1Result1 = ADC_readResult(ADCCRESULT_BASE, ADC_SOC_NUMBER1);

//
// Software breakpoint. At this point, conversion results are stored in
// myADC0Result0, myADC0Result1, myADC1Result0, and myADC1Result1.
//
// Hit run again to get updated conversions.
//
ESTOP0;
}

///////////////////////////////////////////////////////////////

Regards-

sudip

  • Hello Sudip,

    To modify the channel to convert, modify the SOC (Start of Conversion) configuration:

    1. Open SysConfig (double-click adc_ex1_soc_software.syscfg in the project explorer)
    2. Select ADC on the right under Analog
    3. Select which ADC configuration you wish to modify (myADC0 or myADC1)
    4. Open the SOC configurations dropdown, and open the SOC you wish to modify
    5. Select the new channel from the "SOCn channel" dropdown
    6. Repeat for any other SOC configurations you wish to modify
    7. Rebuild your project

    If you wish to see the generated code, you can look in Generated Source > SysConfig > board.c after building. The ADC_init() function will contain ADC_setupSOC() calls for each SOC that specify what channel to convert.

    On this device, each ADC can have up to 16 SOC configurations. Each SOC configuration specifies a trigger source, what channel to convert, and the acquisition window size.

    Best regards,
    Ibukun