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/TMS320F28379D: run time error

Part Number: TMS320F28379D
Other Parts Discussed in Thread: CONTROLSUITE, C2000WARE,

Tool/software: Code Composer Studio

Hi 

I am trying to read the adc result through pin A0, the program compiles without any error.But during run time, if i press the resume botton, it immediately stops and turns green again without any output in register.Please sort out the problem.

Thank you

  • Hi Mishra,

    To get better help with your debug issues, it is good to provide the following as it would help us understand what issues you are running into:

    - What program are you loading? Is it one of the examples released as part of C2000Ware/ControlSUITE?

    - What hardware are you using? Is it launchpad/control card or do you have your custom board design?

    - Did you verify your setup?  Is the part getting the correct VREF and did you verify/measure voltages on VREFHI and A0?  Are supply voltages correct?

    - If you wrote the code, did you verify the ADC setup to be correct (clocks, SOC settings, S+H, channel settings ... etc) 

    Best regards,

    Joseph

  • Thank you for your time.
    The program is the temperature sensor ADC program, and i am using TMS320F28379D.
    While building the program it shows an core distribution error, but still it runs with some value 90-100 as ADC.Result0. i am supplying a voltage 0f 3.3V from the board itself to the pin A0.
    Please try to resolve it.
    regards
    D.Mishra
  • Hi Debashish,

    Can you please explain what you meant by "core distribution error"?  In your response, you also indicated that the code is from tempsensor.  The temperature sensor code connects the temperature sensor internally to ADC channel A13 when bit TSNSCTL is enabled.  In the code that you modified, did you change the channel assignment of the particular SOC you are using to channel A0, instead of channel A13.  Can you also verify or measure the VREFHI voltage fed to ADC module A?

    Best regards,

    Joseph

  • Thanks Joseph,

    I am facing the error that, " No source available for 0x3ff16a", while i try to run it.

    I have connected pin A0 with voltage 3.3 board, please verify it as i am attaching

    #include "F28x_Project.h" // Device Headerfile and Examples Include File

    void ConfigureADC(void);
    void ConfigureEPWM(void);
    void SetupADCEpwm(Uint16 channel);
    interrupt void adca1_isr(void);

    //buffer for storing conversion results
    #define RESULTS_BUFFER_SIZE 256
    Uint16 AdcaResults[RESULTS_BUFFER_SIZE];
    Uint16 resultsIndex;
    volatile Uint16 bufferFull;

    void main(void)
    {
    // Step 1. Initialize System Control:
    // PLL, WatchDog, enable Peripheral Clocks
    // This example function is found in the F2837xS_SysCtrl.c file.
    InitSysCtrl();

    // Step 2. Initialize GPIO:
    // This example function is found in the F2837xS_Gpio.c file and
    // illustrates how to set the GPIO to it's default state.
    InitGpio(); // Skipped for this example

    // Step 3. Clear all interrupts and initialize PIE vector table:
    // Disable CPU interrupts
    DINT;

    // Initialize the PIE control registers to their default state.
    // The default state is all PIE interrupts disabled and flags
    // are cleared.
    // This function is found in the F2837xS_PieCtrl.c file.
    InitPieCtrl();

    // Disable CPU interrupts and clear all CPU interrupt flags:
    IER = 0x0000;
    IFR = 0x0000;

    // Initialize the PIE vector table with pointers to the shell Interrupt
    // Service Routines (ISR).
    // This will populate the entire table, even if the interrupt
    // is not used in this example. This is useful for debug purposes.
    // The shell ISR routines are found in F2837xS_DefaultIsr.c.
    // This function is found in F2837xS_PieVect.c.
    InitPieVectTable();

    //Map ISR functions
    EALLOW;
    PieVectTable.ADCA1_INT = &adca1_isr; //function for ADCA interrupt 1
    EDIS;

    //Configure the ADC and power it up
    ConfigureADC();

    //Configure the ePWM
    ConfigureEPWM();

    //Setup the ADC for ePWM triggered conversions on channel 0
    SetupADCEpwm(0);

    //Enable global Interrupts and higher priority real-time debug events:
    IER |= M_INT1; //Enable group 1 interrupts
    EINT; // Enable Global interrupt INTM
    ERTM; // Enable Global realtime interrupt DBGM

    //Initialize results buffer
    for(resultsIndex = 0; resultsIndex < RESULTS_BUFFER_SIZE; resultsIndex++)
    {
    AdcaResults[resultsIndex] = 0;
    }
    resultsIndex = 0;
    bufferFull = 0;

    //enable PIE interrupt
    PieCtrlRegs.PIEIER1.bit.INTx1 = 1;

    //sync ePWM
    EALLOW;
    CpuSysRegs.PCLKCR0.bit.TBCLKSYNC = 1;

    //take conversions indefinitely in loop
    do
    {
    //start ePWM
    EPwm1Regs.ETSEL.bit.SOCAEN = 1; //enable SOCA
    EPwm1Regs.TBCTL.bit.CTRMODE = 0; //unfreeze, and enter up count mode

    //wait while ePWM causes ADC conversions, which then cause interrupts,
    //which fill the results buffer, eventually setting the bufferFull
    //flag
    while(!bufferFull);
    bufferFull = 0; //clear the buffer full flag

    //stop ePWM
    EPwm1Regs.ETSEL.bit.SOCAEN = 0; //disable SOCA
    EPwm1Regs.TBCTL.bit.CTRMODE = 3; //freeze counter

    //at this point, AdcaResults[] contains a sequence of conversions
    //from the selected channel

    //software breakpoint, hit run again to get updated conversions
    asm(" NOP");
    }while(1);
    }

    //Write ADC configurations and power up the ADC for both ADC A and ADC B
    void ConfigureADC(void)
    {
    EALLOW;

    //write configurations
    AdcaRegs.ADCCTL2.bit.PRESCALE = 6; //set ADCCLK divider to /4
    AdcSetMode(ADC_ADCA, ADC_RESOLUTION_12BIT, ADC_SIGNALMODE_SINGLE);

    //Set pulse positions to late
    AdcaRegs.ADCCTL1.bit.INTPULSEPOS = 1;

    //power up the ADC
    AdcaRegs.ADCCTL1.bit.ADCPWDNZ = 1;

    //delay for 1ms to allow ADC time to power up
    DELAY_US(1000);

    EDIS;
    }

    void ConfigureEPWM(void)
    {
    EALLOW;
    // Assumes ePWM clock is already enabled
    EPwm1Regs.ETSEL.bit.SOCAEN = 0; // Disable SOC on A group
    EPwm1Regs.ETSEL.bit.SOCASEL = 4; // Select SOC on up-count
    EPwm1Regs.ETPS.bit.SOCAPRD = 1; // Generate pulse on 1st event
    EPwm1Regs.CMPA.bit.CMPA = 0x0800; // Set compare A value to 2048 counts
    EPwm1Regs.TBPRD = 0x1000; // Set period to 4096 counts
    EPwm1Regs.TBCTL.bit.CTRMODE = 3; // freeze counter
    EDIS;
    }

    void SetupADCEpwm(Uint16 channel)
    {
    Uint16 acqps;

    //determine minimum acquisition window (in SYSCLKS) based on resolution
    if(ADC_RESOLUTION_12BIT == AdcaRegs.ADCCTL2.bit.RESOLUTION){
    acqps = 14; //75ns
    }
    else { //resolution is 16-bit
    acqps = 63; //320ns
    }

    //Select the channels to convert and end of conversion flag
    EALLOW;
    AdcaRegs.ADCSOC0CTL.bit.CHSEL = channel; //SOC0 will convert pin A0
    AdcaRegs.ADCSOC0CTL.bit.ACQPS = acqps; //sample window is 100 SYSCLK cycles
    AdcaRegs.ADCSOC0CTL.bit.TRIGSEL = 5; //trigger on ePWM1 SOCA/C
    AdcaRegs.ADCINTSEL1N2.bit.INT1SEL = 0; //end of SOC0 will set INT1 flag
    AdcaRegs.ADCINTSEL1N2.bit.INT1E = 1; //enable INT1 flag
    AdcaRegs.ADCINTFLGCLR.bit.ADCINT1 = 1; //make sure INT1 flag is cleared
    }

    interrupt void adca1_isr(void)
    {
    AdcaResults[resultsIndex++] = AdcaResultRegs.ADCRESULT0;
    if(RESULTS_BUFFER_SIZE <= resultsIndex)
    {
    resultsIndex = 0;
    bufferFull = 1;
    }

    AdcaRegs.ADCINTFLGCLR.bit.ADCINT1 = 1; //clear INT1 flag
    PieCtrlRegs.PIEACK.all = PIEACK_GROUP1;
    }

    Thank you for your valuable time

  • Hi Debashish,

    If you are getting that message:

    it means there is no code loaded in the part.  After successful compilation of your code, can you walk me through the steps you have gone through in CCS to load the code?  Let us start first with the program loading and how you executed the code before debugging the ADC issue.

    Regards,

    Joseph

  • Thank you Joseph,

    I am using the following steps

    Build > Debug > Run; Its the standard way , i am using the process.

    I doubt, is there any syntax in the code i am using which stops the execution.I have referred the code of temprature sensor from control suite , and as i remember while importing the code from v210, two options were there for dual core i.e. CPU01 and CPU02, where i selected the CPU02.Is this problem related to that.

    Please resolve the issue as i have spent quite a long time to get rid about these.

  • Hi Debahish,

    The error code you are getting , " No source available for 0x3ff16a" points to CPU1.  You need to make sure that you load your code to the correct CPU.

    Regards,

    Joseph