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.

CCS/LAUNCHXL-F28379D: 5 different channels sampling and serial terminal output

Part Number: LAUNCHXL-F28379D
Other Parts Discussed in Thread: C2000WARE

Tool/software: Code Composer Studio

Hi,

I am very new to coding, so some of my questions may seem obvious to you. 

How can I sample 5 different channels (4 channels from ADCA and 1 channel from ADCB) simultaneously and display the 12-bit conversion data under the terminal function?  

I am using Example_F28379D_LaunchpadDemo.c as the basis for my project. 

  • Hi Alex,

    Please refer other examples like adc_soc_software_cpu01 from C2000Ware for configuring multiple ADC channels. Let me know if this helps.

    Thanks
    Vasudha
  • Thank you Vasudha for your suggestion, it has been very helpful. However, I still have a few doubts in mind.

    1. AdcaRegs.ADCSOCFRC1.all = 0x0003; //SOC0 and SOC1

    If I am using Adca SOC0 to 3 , should I change 0x0003 to 0x005?
    How do I know what register number should I place there?

    2. I have trouble understanding the code below, what amendments should I make for the code if I’m using SOC1 to 3?

    AdcaRegs.ADCINTSEL1N2.bit.INT1SEL = 1; //end of SOC1 will set INT1 flag
    AdcaRegs.ADCINTSEL1N2.bit.INT1E = 1; //enable INT1 flag
    AdcaRegs.ADCINTFLGCLR.bit.ADCINT1 = 1; //make sure INT1 flag is cleared

    3. If I would like to display the real-time output of the ADC channels, like the Example_F28379D_LaunchpadDemo.c file
    where I was able to display the 12bit converted data via the terminal mode. Which direction/file should I be looking at?

    Thank you.
  • Hi Alex,

    I think you should refer EPWM chapter in device TRM. Under registers section, you can get details about what value to configure for the desired configuration.

    1. AdcaRegs.ADCSOCFRC1.all = 0x0003; //SOC0 and SOC1

    If I am using Adca SOC0 to 3 , should I change 0x0003 to 0x005?
    How do I know what register number should I place there?

    [VB] AdcaRegs.ADCSOCFRC1.all = 0x000F; // forces SOC0 - SOC3

    2. I have trouble understanding the code below, what amendments should I make for the code if I’m using SOC1 to 3?

    AdcaRegs.ADCINTSEL1N2.bit.INT1SEL = 1; //end of SOC1 will set INT1 flag
    AdcaRegs.ADCINTSEL1N2.bit.INT1E = 1; //enable INT1 flag
    AdcaRegs.ADCINTFLGCLR.bit.ADCINT1 = 1; //make sure INT1 flag is cleared

    [VB] The SOCs are served in round robin. So the above setting selects which SOC conversion should trigger the inteuupt in order to read the converted values in ISR. In your case, it can be SOC3. So the software forces all the enabled SOCs. SOC0 associated channel would be sampled first and then the rest would follow. EOC3 signal would trigger interrupt 1.

    AdcaRegs.ADCINTSEL1N2.bit.INT1SEL = 3; //end of SOC3 will set INT1 flag

    AdcaRegs.ADCINTSEL1N2.bit.INT1E = 1; //enable INT1 flag
    AdcaRegs.ADCINTFLGCLR.bit.ADCINT1 = 1; //make sure INT1 flag is cleared

    alex chen95 said:
    3. If I would like to display the real-time output of the ADC channels, like the Example_F28379D_LaunchpadDemo.c file
    where I was able to display the 12bit converted data via the terminal mode. Which direction/file should I be looking at?

    [VB] I think you should refer launchpad example for the same.

    Thanks

    Vasudha

  • Thank you Mr Vasudha, I've rectified my problems.