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.

TMS320F28027F: ADC sampling observed at every 2 PWM cycles instead of one

Part Number: TMS320F28027F
Other Parts Discussed in Thread: LAUNCHXL-F28027F

Hi

I am using the LaunchXL-F28027F. 

I'm trying to trigger ADC sampling through ePWM. I want each ADC sampled at the center of the PWM on pulse. My PWM configuration and ADC configuration is shown below.

I have configured a GPIO interrupt inside adc_isr() to indicate the sampled instances. But when I look at the oscilloscope waveforms I see that the ADC is sampled every other PWM cycle instead of every PWM cycle. How can I fix this? Could you please help? 

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

///ADC COnfig

EALLOW;

//
// ADCINT1 trips after AdcResults latch
//
AdcRegs.ADCCTL1.bit.INTPULSEPOS = 1;

AdcRegs.INTSEL1N2.bit.INT1E = 1; // Enabled ADCINT1
AdcRegs.INTSEL1N2.bit.INT1CONT = 0; // Disable ADCINT1 Continuous mode

//
// setup EOC2 to trigger ADCINT1 to fire
//
AdcRegs.INTSEL1N2.bit.INT1SEL = 2;

//
// set SOC0 channel select to ADCINA4
//
AdcRegs.ADCSOC0CTL.bit.CHSEL = 4;

//
// set SOC1 channel select to ADCINA4
//
AdcRegs.ADCSOC1CTL.bit.CHSEL = 4;

//
// set SOC1 channel select to ADCINA2
//
AdcRegs.ADCSOC2CTL.bit.CHSEL = 2;

//
// set SOC0 start trigger on EPWM1A, due to round-robin SOC0 converts first
// then SOC1
//
AdcRegs.ADCSOC0CTL.bit.TRIGSEL = 5;

//
// set SOC1 start trigger on EPWM1A, due to round-robin SOC0 converts first
// then SOC1
//
AdcRegs.ADCSOC1CTL.bit.TRIGSEL = 5;

//
// set SOC2 start trigger on EPWM1A, due to round-robin SOC0 converts first
// then SOC1, then SOC2
//
AdcRegs.ADCSOC2CTL.bit.TRIGSEL = 5;

//
// set SOC0 S/H Window to 7 ADC Clock Cycles, (6 ACQPS plus 1)
//
AdcRegs.ADCSOC0CTL.bit.ACQPS = 6;

//
// set SOC1 S/H Window to 7 ADC Clock Cycles, (6 ACQPS plus 1)
//
AdcRegs.ADCSOC1CTL.bit.ACQPS = 6;

//
// set SOC2 S/H Window to 7 ADC Clock Cycles, (6 ACQPS plus 1)
//
AdcRegs.ADCSOC2CTL.bit.ACQPS = 6;

//Enable PWM clock here for enabling SOC trigger by ePWM1.
CLK_enablePwmClock(myClk, PWM_Number_1);
EDIS;


//
// Assumes ePWM1 clock is already enabled in InitSysCtrl();
//
EPwm1Regs.ETSEL.bit.SOCAEN = 1; // Enable SOC on A group

//
// Select SOC from from CPMA on upcount
//
EPwm1Regs.ETSEL.bit.SOCASEL = 3;  // for zero and load triggering

EPwm1Regs.ETPS.bit.SOCAPRD = 1; // Generate pulse on 1st event


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

//PWM Config

void
HRPWM1_Config(Uint16 period, Uint16 CoarseDuty)
{
CLK_enablePwmClock(myClk, PWM_Number_1);

//
// ePWM1 register configuration with HRPWM
// ePWM1A toggle low/high with MEP control on Rising edge
//
PWM_setPeriodLoad(myPwm1, PWM_PeriodLoad_Immediate);
PWM_setPeriod(myPwm1, 300); // Set timer period
PWM_setCmpA(myPwm1, 250);
PWM_setCmpAHr(myPwm1, (1 << 8));

PWM_setPhase(myPwm1, 0x0000); // Phase is 0
PWM_setCount(myPwm1, 0x0000); // Clear counter

PWM_setCounterMode(myPwm1, PWM_CounterMode_UpDown); // Count up
PWM_disableCounterLoad(myPwm1); // Disable phase loading
PWM_setSyncMode(myPwm1, PWM_SyncMode_Disable);

//
// Clock ratio to SYSCLKOUT
//
PWM_setHighSpeedClkDiv(myPwm1, PWM_HspClkDiv_by_1);

PWM_setClkDiv(myPwm1, PWM_ClkDiv_by_1);

//
// Load registers every ZERO
//
PWM_setShadowMode_CmpA(myPwm1, PWM_ShadowMode_Shadow);

PWM_setShadowMode_CmpB(myPwm1, PWM_ShadowMode_Shadow);
PWM_setLoadMode_CmpA(myPwm1, PWM_LoadMode_Zero);
PWM_setLoadMode_CmpB(myPwm1, PWM_LoadMode_Zero);


PWM_setActionQual_CntUp_CmpA_PwmA(myPwm1, PWM_ActionQual_Set);
PWM_setActionQual_CntUp_CmpB_PwmA(myPwm1, PWM_ActionQual_Clear);

//
// MEP control on Rising edge
//
PWM_setHrEdgeMode(myPwm1, PWM_HrEdgeMode_Falling);

PWM_setHrControlMode(myPwm1, PWM_HrControlMode_Duty);
PWM_setHrShadowMode(myPwm1, PWM_HrShadowMode_CTR_EQ_0);
}

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

Thank you,

Shamanth

  • I have more to add to this question. 

    Firstly, the code for PWM config that I have posted here is incorrect. Below is the correct code. 

    Also, I observed that if I reduce the PWM frequency to lower than 85 or so, I get proper ADC sampling at every PWM cycle. But if I increase it above 85, I start losing samples after a few PWM cycles and at 100kHz, I see sampling at every 2nd PWM cycle instead of every PWM cycle. Some screenshots have been attached below. 

    I am not sure why this is happening? Is it because of the ADC sampling, hold and conversion time getting too close to the PWM period? 

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

    //Correct PWM config, CoarseDuty input is 0-100 and period input is number of counts as per 60MHz table. 

    void
    HRPWM1_Config(Uint16 period, Uint16 CoarseDuty)
    {
    CLK_enablePwmClock(myClk, PWM_Number_1);

    //
    // ePWM1 register configuration with HRPWM
    // ePWM1A toggle low/high with MEP control on Rising edge
    //
    PWM_setPeriodLoad(myPwm1, PWM_PeriodLoad_Immediate);
    PWM_setPeriod(myPwm1, (period-1)*0.5); // Period is set to number of counts as per 60MHz. Multiply 0.5 here to account for up down count mode. 
    PWM_setCmpA(myPwm1, ((period-1)*0.5)*(1-(CoarseDuty*0.01)));  //Coarseduty input provided in percentage values
    PWM_setCmpAHr(myPwm1, (1 << 8));
    PWM_setCmpB(myPwm1, period * (CoarseDuty*0.01));
    PWM_setPhase(myPwm1, 0x0000); // Phase is 0
    PWM_setCount(myPwm1, 0x0000); // Clear counter

    PWM_setCounterMode(myPwm1, PWM_CounterMode_UpDown); // Count up
    PWM_disableCounterLoad(myPwm1); // Disable phase loading
    PWM_setSyncMode(myPwm1, PWM_SyncMode_Disable);

    //
    // Clock ratio to SYSCLKOUT
    //
    PWM_setHighSpeedClkDiv(myPwm1, PWM_HspClkDiv_by_1);

    PWM_setClkDiv(myPwm1, PWM_ClkDiv_by_1);

    //
    // Load registers every ZERO
    //
    PWM_setShadowMode_CmpA(myPwm1, PWM_ShadowMode_Shadow);
    PWM_setShadowMode_CmpB(myPwm1, PWM_ShadowMode_Shadow);
    PWM_setLoadMode_CmpA(myPwm1, PWM_LoadMode_Zero);
    PWM_setLoadMode_CmpB(myPwm1, PWM_LoadMode_Zero);

    PWM_setActionQual_CntUp_CmpA_PwmA(myPwm1, PWM_ActionQual_Set);
    PWM_setActionQual_CntDown_CmpA_PwmA(myPwm1, PWM_ActionQual_Clear);

    //
    // MEP control on Rising edge
    //
    PWM_setHrEdgeMode(myPwm1, PWM_HrEdgeMode_Falling);

    PWM_setHrControlMode(myPwm1, PWM_HrControlMode_Duty);
    PWM_setHrShadowMode(myPwm1, PWM_HrShadowMode_CTR_EQ_0);
    }

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

    Waveforms at 85kHz, (Blue is GPIO toggle in the ADC ISR and Yellow is PWM) - ADC Sampled correctly at every PWM interval. 

    Waveform at 90kHz, (Blue is GPIO toggle in the ADC ISR and Yellow is PWM) - Samples missed after every 8 cycles.

    Waveform at 100kHz, (Blue is GPIO toggle in the ADC ISR and Yellow is PWM) - Sampled only at every alternate cycle. 

  • I think you attempted to attach some waveforms, but it looks like the images didn't come through. Try again?

    There are some timing diagrams in the device's technical reference manual that will allow you to calculate the time it takes from the conversion trigger to the interrupt pulse and result latch, so you can compare it to the PWM period.

    Do you mind sharing your adc_isr? Is there anything in there that would be taking too long to execute? Any other interrupts in the system?

    Whitney

  • Hello, 

    Apologies for the late response. The screenshots are posted again at the bottom of this post. 

    There is only the ADC and PWM running. So no extra interrupts. 

    My adc_isr() function is posted below: 

    __interrupt void
    adc_isr(void)
    {
    //
    // discard ADCRESULT0 as part of the workaround to the 1st sample errata
    // for rev0
    //
    Voltage1[ConversionCount] = AdcResult.ADCRESULT1;
    Voltage2[ConversionCount] = AdcResult.ADCRESULT2;

    GPIO_toggle(myGpio, GPIO_Number_19);
    //
    // If 20 conversions have been logged, start over
    //
    if(ConversionCount == 9)
    {
    ConversionCount = 0;
    }
    else
    {
    ConversionCount++;
    }

    //
    // Clear ADCINT1 flag reinitialize for next SOC
    //
    AdcRegs.ADCINTFLGCLR.bit.ADCINT1 = 1;

    //
    // Acknowledge interrupt to PIE
    //
    PieCtrlRegs.PIEACK.all = PIEACK_GROUP1;

    return;
    }

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

    Waveform screenshots at different frequencies. 

    Waveforms at 85kHz, (Blue is GPIO toggle in the ADC ISR and Yellow is PWM) - ADC Sampled correctly at every PWM interval. 

    Waveform at 90kHz, (Blue is GPIO toggle in the ADC ISR and Yellow is PWM) - Samples missed after every 7 cycles.

    Waveform at 100kHz, (Blue is GPIO toggle in the ADC ISR and Yellow is PWM) - Sampled only at every alternate cycle. 

  • Can you see the ADCINTOVF flag getting set? If so can you clear it in your ISR and see what effect that has? ADCINTOVF being set can disrupt the normal generation of interrupts.

    Whitney

  • Thank you for the response. 

    Yes. The ADCINTOVF flag was being set. 

    I cleared this flag right after I clear ADCINT1 at the bottom of the ISR ,and there seems to be little improvement in that I can't see the Overflow flag being set in the watch window (when execution paused), but my sampling still takes 2 cycles every now and then. Screenshot below:

    Updated code snippet:

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

    //
    // Clear ADCINT1 flag reinitialize for next SOC
    //
    AdcRegs.ADCINTFLGCLR.bit.ADCINT1 = 1;

    AdcRegs.ADCINTOVFCLR.bit.ADCINT1 = 1;
    AdcRegs.ADCINTOVFCLR.bit.ADCINT2 = 1;

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

    Clearing this anywhere else doesn't seem to solve the problem. 

    Any suggestion?  Do you need anymore information from my side? 

    Thanks,
    Shamanth

  • Thanks for your patience while I was out of the office. The fact that the overflow flag is getting set in the first place does seem to indicate that the conversions and interrupt handling aren't quite getting handled in time. Can you share the rest of your ADC configuration? Maybe share a screen capture of the ADC registers in the CCS Registers view? Are you just calling InitAdc() and AdcOffsetSelfCal() before the code you've shared above?

    Whitney

  • Attachment of the full C file with PWM and ADC configuration below:

    //*******************************************************************
    //
    //  File:   PWM_Generator_Example.c
    //
    //  Title:  PWM Generation Example code
    //
    //
    //
    //  -# PWM Freq = SYSCLK/(period=10),
    //         ePWM1A toggle low/high with MEP control on rising edge
    //         PWM Freq = SYSCLK/(period=10),
    //         ePWM1B toggle low/high with NO HRPWM control
    //
    //
    //  Monitor ePWM1-ePWM4 pins on an oscilloscope.
    //
    //    - ePWM1A is GPIO0
    //    - ePWM1B is GPIO1
    //
    //    - ePWM2A is GPIO2
    //    - ePWM2B is GPIO3
    //
    //
    //#############################################################################
    // $TI Release: F2802x Support Library v3.03.00.00 $
    // $Release Date: Sun Oct  4 16:04:01 IST 2020 $
    // $Copyright:
    // Copyright (C) 2009-2020 Texas Instruments Incorporated - http://www.ti.com/
    //
    // Redistribution and use in source and binary forms, with or without 
    // modification, are permitted provided that the following conditions 
    // are met:
    // 
    //   Redistributions of source code must retain the above copyright 
    //   notice, this list of conditions and the following disclaimer.
    // 
    //   Redistributions in binary form must reproduce the above copyright
    //   notice, this list of conditions and the following disclaimer in the 
    //   documentation and/or other materials provided with the   
    //   distribution.
    // 
    //   Neither the name of Texas Instruments Incorporated nor the names of
    //   its contributors may be used to endorse or promote products derived
    //   from this software without specific prior written permission.
    // 
    // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 
    // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 
    // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
    // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 
    // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 
    // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 
    // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
    // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
    // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 
    // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 
    // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
    // $
    //#############################################################################
    
    //
    // Included Files
    //
    #include "DSP28x_Project.h"         // F2802x Headerfile
    #include "F2802x_Device.h"         // f2802x Headerfile
    #include "f2802x_examples.h" // f2802x Examples Headerfile
    
    #include "clk.h"
    #include "flash.h"
    #include "gpio.h"
    #include "pie.h"
    #include "pll.h"
    #include "pwm.h"
    #include "wdog.h"
    
    //
    // Function prototypes
    //
    void HRPWM1_Config(Uint16, Uint16);
    //ADC
    __interrupt void adc_isr(void);
    void Adc_Config(void);
    
    
    //
    // General System nets - Useful for debug
    //
    Uint16 i, j, DutyFine, n, update, CoarseDuty, Period;
    Uint32 temp;
    uint16_t LoopCount;
    uint16_t ConversionCount;
    uint16_t Voltage1[10];
    uint16_t Voltage2[10];
    
    
    //
    // Globals
    //
    CLK_Handle myClk;
    FLASH_Handle myFlash;
    GPIO_Handle myGpio;
    PIE_Handle myPie;
    PWM_Handle myPwm1, myPwm2;
    
    //
    // Main
    //
    void main(void)
    {
        CPU_Handle myCpu;
        PLL_Handle myPll;
        WDOG_Handle myWDog;
    
        //
        // Initialize all the handles needed for this application
        //
        myClk = CLK_init((void *)CLK_BASE_ADDR, sizeof(CLK_Obj));
        myCpu = CPU_init((void *)NULL, sizeof(CPU_Obj));
        myFlash = FLASH_init((void *)FLASH_BASE_ADDR, sizeof(FLASH_Obj));
        myGpio = GPIO_init((void *)GPIO_BASE_ADDR, sizeof(GPIO_Obj));
        myPie = PIE_init((void *)PIE_BASE_ADDR, sizeof(PIE_Obj));
        myPll = PLL_init((void *)PLL_BASE_ADDR, sizeof(PLL_Obj));
        myPwm1 = PWM_init((void *)PWM_ePWM1_BASE_ADDR, sizeof(PWM_Obj));
        myPwm2 = PWM_init((void *)PWM_ePWM2_BASE_ADDR, sizeof(PWM_Obj));
        myWDog = WDOG_init((void *)WDOG_BASE_ADDR, sizeof(WDOG_Obj));
    
        //
        // Perform basic system initialization
        //
        WDOG_disable(myWDog);
        CLK_enableAdcClock(myClk);
        (*Device_cal)();
        CLK_disableAdcClock(myClk);
    
        //
        // Select the internal oscillator 1 as the clock source
        //
        CLK_setOscSrc(myClk, CLK_OscSrc_Internal);
    
        //
        // Setup the PLL for x12 /2 which will yield 60Mhz = 10Mhz * 12 / 2
        //
        PLL_setup(myPll, PLL_Multiplier_12, PLL_DivideSelect_ClkIn_by_2);
    
    
        //
        // Disable the PIE and all interrupts
        //
        PIE_disable(myPie);
        PIE_disableAllInts(myPie);
        CPU_disableGlobalInts(myCpu);
        CPU_clearIntFlags(myCpu);
    
        //
        // If running from flash copy RAM only functions to RAM
        //
    #ifdef _FLASH
        memcpy(&RamfuncsRunStart, &RamfuncsLoadStart, (size_t)&RamfuncsLoadSize);
    #endif
    
        //
        // For this case just init GPIO pins for EPwm1, EPwm2, EPwm3, EPwm4
        //
        GPIO_setPullUp(myGpio, GPIO_Number_0, GPIO_PullUp_Disable);
        GPIO_setPullUp(myGpio, GPIO_Number_1, GPIO_PullUp_Disable);
        GPIO_setMode(myGpio, GPIO_Number_0, GPIO_0_Mode_EPWM1A);
        GPIO_setMode(myGpio, GPIO_Number_1, GPIO_1_Mode_EPWM1B);
    
        GPIO_setPullUp(myGpio, GPIO_Number_2, GPIO_PullUp_Disable);
        GPIO_setPullUp(myGpio, GPIO_Number_3, GPIO_PullUp_Disable);
        GPIO_setMode(myGpio, GPIO_Number_2, GPIO_2_Mode_EPWM2A);
        GPIO_setMode(myGpio, GPIO_Number_3, GPIO_3_Mode_EPWM2B);
    
    
        GPIO_setPullUp(myGpio, GPIO_Number_19, GPIO_PullUp_Disable);
        GPIO_setMode(myGpio, GPIO_Number_19, GPIO_19_Mode_GeneralPurpose);
        GPIO_setDirection(myGpio, GPIO_Number_19, GPIO_Direction_Output);
        GPIO_setHigh(myGpio, GPIO_Number_19);
    
        //
        // Setup a debug vector table and enable the PIE
        //
        PIE_setDebugIntVectorTable(myPie);
    
        PIE_enable(myPie);
    
        update =1;
        DutyFine =0;
    
        CLK_disableTbClockSync(myClk);
        ////////////////////////////////////////////////////
        //
        // Interrupts that are used in this example are re-mapped to
        // ISR functions found within this file.
        //
        EALLOW;             // This is needed to write to EALLOW protected register
        PieVectTable.ADCINT1 = &adc_isr;
        EDIS;      // This is needed to disable write to EALLOW protected registers
    
        //
        // Step 4. Initialize all the Device Peripherals
        //
        InitAdc();  // For this example, init the ADC
        AdcOffsetSelfCal();
    
        ////////////////////////////////////////////////////
        //
        // Step 5. User specific code, enable interrupts:
        // Enable ADCINT1 in PIE
        //
        PieCtrlRegs.PIEIER1.bit.INTx1 = 1; // Enable INT 1.1 in the PIE
        IER |= M_INT1;                     // Enable CPU Interrupt 1
        EINT;                              // Enable Global interrupt INTM
        ERTM;                              // Enable Global realtime interrupt DBGM
    
    
        LoopCount = 0;
        ConversionCount = 0;
    
    
    
    
    
    
    
        ////////////////////////////////////////////////////////////////////////////////////////////
        // Configure ADC
        // Note: Channel ADCINA4  will be double sampled to workaround the ADC 1st
        // sample issue for rev0 silicon errata
        //
        EALLOW;
    
        //
        // ADCINT1 trips after AdcResults latch
        //
        AdcRegs.ADCCTL1.bit.INTPULSEPOS = 1;
    
        AdcRegs.INTSEL1N2.bit.INT1E     = 1;    // Enabled ADCINT1
        AdcRegs.INTSEL1N2.bit.INT1CONT  = 1;    // Disable ADCINT1 Continuous mode
    
        //
        // setup EOC0 to trigger ADCINT1 to fire
        //
        AdcRegs.INTSEL1N2.bit.INT1SEL   = 0;
    
        //
        // set SOC0 channel select to ADCINA4
        //
        AdcRegs.ADCSOC0CTL.bit.CHSEL    = 4;
        
        //
        // set SOC1 channel select to ADCINA4
        //
        AdcRegs.ADCSOC1CTL.bit.CHSEL    = 4;
        
        //
        // set SOC1 channel select to ADCINA2
        //
        AdcRegs.ADCSOC2CTL.bit.CHSEL    = 2;
        
        //
        // set SOC0 start trigger on EPWM1A, due to round-robin SOC0 converts first
        // then SOC1
        //
        AdcRegs.ADCSOC0CTL.bit.TRIGSEL  = 5;
        
        //
        // set SOC1 start trigger on EPWM1A, due to round-robin SOC0 converts first
        // then SOC1
        //
        AdcRegs.ADCSOC1CTL.bit.TRIGSEL  = 5;
        
        //
        // set SOC2 start trigger on EPWM1A, due to round-robin SOC0 converts first
        // then SOC1, then SOC2
        //
        AdcRegs.ADCSOC2CTL.bit.TRIGSEL  = 5;
        
        //
        // set SOC0 S/H Window to 7 ADC Clock Cycles, (6 ACQPS plus 1)
        //
        AdcRegs.ADCSOC0CTL.bit.ACQPS    = 6;
        
        //
        // set SOC1 S/H Window to 7 ADC Clock Cycles, (6 ACQPS plus 1)
        //
        AdcRegs.ADCSOC1CTL.bit.ACQPS    = 6;
        
        //
        // set SOC2 S/H Window to 7 ADC Clock Cycles, (6 ACQPS plus 1)
        //
        AdcRegs.ADCSOC2CTL.bit.ACQPS    = 6;
    
        //Enable PWM clock here for enabling SOC trigger by ePWM1.
        CLK_enablePwmClock(myClk, PWM_Number_1);
        EDIS;
    
    
    
    
    
    
    
        //////////////////////////////////////////////////////////////////////////////////////////
    
        //
        // Some useful Period vs Frequency values
        //  SYSCLKOUT =     60 MHz
        //
        //    Period            Frequency
        //    1000               60 kHz  
        //    800                75 kHz
        //    750                80 kHz
        //    706                85 kHz
        //    600                100 kHz 
        //    500                120 kHz 
        //    250                240 kHz 
        //    200                300 kHz 
        //    100                600 kHz 
        //    50                 1.2 Mhz 
        //    25                 2.4 Mhz 
        //    20                 3.0 Mhz 
        //    12                 5.0 MHz 
        //    10                 6.0 MHz 
        //    9                  6.7 MHz 
        //    8                  7.5 MHz 
        //    7                  8.6 MHz 
        //    6                  10.0 MHz
        //    5                  12.0 MHz
        //
    
        //Set Coarse Duty cycle in percentage. (integer values)
        CoarseDuty = 20;
        // Refer above table to set frequency
        Period     = 600;
        //
        // ePWM and HRPWM register initialization
        //
        HRPWM1_Config(Period, CoarseDuty);
    
        CLK_enableTbClockSync(myClk);
    
        //
        // Assumes ePWM1 clock is already enabled in InitSysCtrl();
        //
        EPwm1Regs.ETSEL.bit.SOCAEN  = 1;        // Enable SOC on A group
    
        //
        // Select SOC from from CPMA on upcount
        //
        EPwm1Regs.ETSEL.bit.SOCASEL = 3;
    
        EPwm1Regs.ETPS.bit.SOCAPRD  = 1;            // Generate pulse on 1st event
    
        // Adjust fine duty cycle control. 
        DutyFine = 200;         // Full Dutycycle in percentage = CoarseDuty in percentage + (DutyFine*(1.4e-3))
                                //The number 1.4e-3 is approximate based on the MEP step size. (150 - 310 ps)
    
        PWM_setCmpAHr(myPwm1, DutyFine << 8);
    
        //
        // Dummy delay between MEP changes
        //
    
        for (i=0;i<10000;i++)
        {
    
        }
    
        while (1)
        {
         // Add dynamic changes to coarse duty cycle and fine duty cycle here using PWM_setCmpA() and PWM_setCmpAHr().
    
    
            // Example code to read ADC voltage and modify duty cycle proportionally.
    //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
    //        if ((Voltage2[0] > 2490) && (Voltage2[0] < 2499))  // Input voltage equal to 2V
    //      {
    //            CoarseDuty = 35;
    //            PWM_setCmpA(myPwm1, ((Period-1)*0.5)*(1-(CoarseDuty*0.01)));
    //        }
    //
    //        if ((Voltage2[0] > 3103) && (Voltage2[0] < 3120))   // Input voltage equal to 2.5V
    //        {
    //            CoarseDuty = 75;
    //           PWM_setCmpA(myPwm1, ((Period-1)*0.5)*(1-(CoarseDuty*0.01)));
    //        }
    //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
        }
    }
    
    //
    // adc_isr -
    //
    __interrupt void
    adc_isr(void)
    {
        //
        // discard ADCRESULT0 as part of the workaround to the 1st sample errata
        // for rev0
        //
    
        Voltage1[ConversionCount] = AdcResult.ADCRESULT1;
        Voltage2[ConversionCount] = AdcResult.ADCRESULT2;
    
    
        //
        // If 20 conversions have been logged, start over
        //
        if(ConversionCount == 9)
        {
            ConversionCount = 0;
        }
        else
        {
            ConversionCount++;
        }
    
        //
        // Clear ADCINT1 flag reinitialize for next SOC
        //
        AdcRegs.ADCINTFLGCLR.bit.ADCINT1 = 1;
    
        AdcRegs.ADCINTOVFCLR.bit.ADCINT1 = 1;
        AdcRegs.ADCINTOVFCLR.bit.ADCINT2 = 1;
    
        GPIO_toggle(myGpio, GPIO_Number_19);
    
    
        //
        // Acknowledge interrupt to PIE
        //
        PieCtrlRegs.PIEACK.all = PIEACK_GROUP1;
    
    
    
    return;
    }
    
    
    //
    // HRPWM1_Config - 
    //
    void
    HRPWM1_Config(Uint16 period, Uint16 CoarseDuty)
    {
        CLK_enablePwmClock(myClk, PWM_Number_1);
    
        //
        // ePWM1 register configuration with HRPWM
        // ePWM1A toggle low/high with MEP control on Rising edge
        //
        PWM_setPeriodLoad(myPwm1, PWM_PeriodLoad_Immediate);
        PWM_setPeriod(myPwm1, (period-1)*0.5);    // Set timer period, 0.5 since up-down count mode.
        PWM_setCmpA(myPwm1, ((period-1)*0.5)*(1-(CoarseDuty*0.01)));
        PWM_setCmpAHr(myPwm1, (1 << 8));
        //PWM_setCmpB(myPwm1, period * (CoarseDuty*0.01));
        PWM_setPhase(myPwm1, 0x0000);       // Phase is 0
        PWM_setCount(myPwm1, 0x0000);       // Clear counter
    
        PWM_setCounterMode(myPwm1, PWM_CounterMode_UpDown);  // Count up
        //PWM_disableCounterLoad(myPwm1);                  // Disable phase loading
        //PWM_setSyncMode(myPwm1, PWM_SyncMode_Disable);
        
        //
        // Clock ratio to SYSCLKOUT
        //
        PWM_setHighSpeedClkDiv(myPwm1, PWM_HspClkDiv_by_1);
        
        PWM_setClkDiv(myPwm1, PWM_ClkDiv_by_1);
    
        //
        // Load registers every ZERO
        //
        PWM_setShadowMode_CmpA(myPwm1, PWM_ShadowMode_Shadow);
        
        PWM_setShadowMode_CmpB(myPwm1, PWM_ShadowMode_Shadow);
        PWM_setLoadMode_CmpA(myPwm1, PWM_LoadMode_Zero);
        PWM_setLoadMode_CmpB(myPwm1, PWM_LoadMode_Zero);
    
        //PWM_setActionQual_Zero_PwmA(myPwm1, PWM_ActionQual_Set);
        PWM_setActionQual_CntUp_CmpA_PwmA(myPwm1, PWM_ActionQual_Set);
        PWM_setActionQual_CntDown_CmpA_PwmA(myPwm1, PWM_ActionQual_Clear);
        //PWM_setActionQual_Zero_PwmB(myPwm1, PWM_ActionQual_Set);
        //PWM_setActionQual_CntUp_CmpB_PwmB(myPwm1, PWM_ActionQual_Clear);
    
        //
        // MEP control on Rising edge
        //
        PWM_setHrEdgeMode(myPwm1, PWM_HrEdgeMode_Rising);
        
        PWM_setHrControlMode(myPwm1, PWM_HrControlMode_Duty);
        PWM_setHrShadowMode(myPwm1, PWM_HrShadowMode_CTR_EQ_0);
    }
    
    
    //
    // End of File
    //
    
    

  • Thanks for sharing your code. Could you still share a screen capture of your ADC registers though? I unfortunately don't have a F28027F board with me at the moment and can't try out your code myself.

    Whitney

  • As I have been testing more on this, I have more information to provide:

    The issue seems to happen when I switch to execute from Flash instead of RAM. 

    So I started from the example code, Example_F2802xAdcSoc:

    When I run the code from RAM, I get what I need without any overflow. 

    But.

    When I change the execution to Flash, I see missed samples with overflow.

    Is there some function that I need to move to RAM? I need the code to be executed from Flash itself. 

    Thanks,
    Shamanth

  • Try clearing the ADCINTSOCSEL registers. If additional SOCs are being triggered by INT1, it could be causing a delay in when the ones you're actually interested in are ready.

    You may want to move your ADC ISR to RAM too to make sure it's executing as quickly as possible.

    Whitney

  • Hello, 

    I tried both the above recommendations and it did not work. 

    Attached is the updated code. I tried clearing ADCINTSOCSEL both in main and the IDC_ISR. 

    I also added a #pragma to move adc_isr() to RAM. I can confirm that ADC_ISR Is in RAM from the map file that has been generated. Also attached. 

    Something about moving the code to Flash is making the whole thing to fail. 

    //#############################################################################
    //
    //  File:   Example_F2802xAdcSoc.c
    //
    //  Title:  F2802x ADC Start-Of-Conversion (SOC) Example Program.
    //
    //! \addtogroup example_list
    //!  <h1>ADC Start-Of-Conversion (SOC)</h1>
    //!
    //!   Interrupts are enabled and the ePWM1 is setup to generate a periodic
    //!   ADC SOC - ADCINT1. Two channels are converted, ADCINA4 and ADCINA2.
    //!
    //!   Watch Variables:
    //!
    //!   - Voltage1[10] - Last 10 ADCRESULT0 values
    //!   - Voltage2[10] - Last 10 ADCRESULT1 values
    //!   - ConversionCount - Current result number 0-9
    //!   - LoopCount - Idle loop counter
    //
    //#############################################################################
    // $TI Release: F2802x Support Library v3.03.00.00 $
    // $Release Date: Sun Oct  4 16:04:01 IST 2020 $
    // $Copyright:
    // Copyright (C) 2009-2020 Texas Instruments Incorporated - http://www.ti.com/
    //
    // Redistribution and use in source and binary forms, with or without 
    // modification, are permitted provided that the following conditions 
    // are met:
    // 
    //   Redistributions of source code must retain the above copyright 
    //   notice, this list of conditions and the following disclaimer.
    // 
    //   Redistributions in binary form must reproduce the above copyright
    //   notice, this list of conditions and the following disclaimer in the 
    //   documentation and/or other materials provided with the   
    //   distribution.
    // 
    //   Neither the name of Texas Instruments Incorporated nor the names of
    //   its contributors may be used to endorse or promote products derived
    //   from this software without specific prior written permission.
    // 
    // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 
    // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 
    // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
    // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 
    // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 
    // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 
    // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
    // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
    // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 
    // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 
    // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
    // $
    //#############################################################################
    
    //
    // Included Files
    //
    
    #include "DSP28x_Project.h"     // Device Headerfile and Examples Include File
    
    #include "common/include/adc.h"
    #include "common/include/clk.h"
    #include "common/include/flash.h"
    #include "common/include/gpio.h"
    #include "common/include/pie.h"
    #include "common/include/pll.h"
    #include "common/include/pwm.h"
    #include "common/include/wdog.h"
    
    //
    // Function Prototypes
    //
    __interrupt void adc_isr(void);
    void Adc_Config(void);
    
    //
    // Globals
    //
    uint16_t LoopCount;
    uint16_t ConversionCount;
    uint16_t Voltage1[10];
    uint16_t Voltage2[10];
    
    ADC_Handle myAdc;
    CLK_Handle myClk;
    FLASH_Handle myFlash;
    GPIO_Handle myGpio;
    PIE_Handle myPie;
    PWM_Handle myPwm;
    
    //
    // Main
    //
    void main(void)
    {
        CPU_Handle myCpu;
        PLL_Handle myPll;
        WDOG_Handle myWDog;
    
        //
        // Initialize all the handles needed for this application
        //
        myAdc = ADC_init((void *)ADC_BASE_ADDR, sizeof(ADC_Obj));
        myClk = CLK_init((void *)CLK_BASE_ADDR, sizeof(CLK_Obj));
        myCpu = CPU_init((void *)NULL, sizeof(CPU_Obj));
        myFlash = FLASH_init((void *)FLASH_BASE_ADDR, sizeof(FLASH_Obj));
        myGpio = GPIO_init((void *)GPIO_BASE_ADDR, sizeof(GPIO_Obj));
        myPie = PIE_init((void *)PIE_BASE_ADDR, sizeof(PIE_Obj));
        myPll = PLL_init((void *)PLL_BASE_ADDR, sizeof(PLL_Obj));
        myPwm = PWM_init((void *)PWM_ePWM1_BASE_ADDR, sizeof(PWM_Obj));
        myWDog = WDOG_init((void *)WDOG_BASE_ADDR, sizeof(WDOG_Obj));
    
        //
        // Perform basic system initialization
        //
        WDOG_disable(myWDog);
        CLK_enableAdcClock(myClk);
        (*Device_cal)();
        CLK_disableAdcClock(myClk);
    
        //
        // Select the internal oscillator 1 as the clock source
        //
        CLK_setOscSrc(myClk, CLK_OscSrc_Internal);
    
        //
        // Setup the PLL for x10 /2 which will yield 50Mhz = 10Mhz * 10 / 2
        //
        PLL_setup(myPll, PLL_Multiplier_12, PLL_DivideSelect_ClkIn_by_2);
    
        //
        // Disable the PIE and all interrupts
        //
        PIE_disable(myPie);
        PIE_disableAllInts(myPie);
        CPU_disableGlobalInts(myCpu);
        CPU_clearIntFlags(myCpu);
    
        //
        // If running from flash copy RAM only functions to RAM
        //
    #ifdef _FLASH
        memcpy(&RamfuncsRunStart, &RamfuncsLoadStart, (size_t)&RamfuncsLoadSize);
    #endif
    
    
        //Initialize the GPIO
        //GPIO Initialize
        GPIO_setPullUp(myGpio, GPIO_Number_0, GPIO_PullUp_Disable);
        GPIO_setMode(myGpio, GPIO_Number_0, GPIO_0_Mode_EPWM1A);
    
        GPIO_setPullUp(myGpio, GPIO_Number_19, GPIO_PullUp_Disable);
        GPIO_setMode(myGpio, GPIO_Number_19, GPIO_19_Mode_GeneralPurpose);
        GPIO_setDirection(myGpio, GPIO_Number_19, GPIO_Direction_Output);
        GPIO_setHigh(myGpio, GPIO_Number_19);
    
    
        //
        // Setup a debug vector table and enable the PIE
        //
        PIE_setDebugIntVectorTable(myPie);
        PIE_enable(myPie);
    
        CLK_disableTbClockSync(myClk);
        //
        // Register interrupt handlers in the PIE vector table
        //
        PIE_registerPieIntHandler(myPie, PIE_GroupNumber_10, PIE_SubGroupNumber_1, 
                                    (intVec_t)&adc_isr);
    
        //
        // Initialize the ADC
        //
    
        InitAdc();  // For this example, init the ADC
        AdcOffsetSelfCal();
    
        //
        // Enable ADCINT1 in PIE
        //
        PIE_enableAdcInt(myPie, ADC_IntNumber_1);
        
        //
        // Enable CPU Interrupt 1
        //
        CPU_enableInt(myCpu, CPU_IntNumber_10);
        
        //
        // Enable Global interrupt INTM
        //
        CPU_enableGlobalInts(myCpu);
        
        //
        // Enable Global realtime interrupt DBGM
        //
        CPU_enableDebugInt(myCpu);
    
        LoopCount = 0;
        ConversionCount = 0;
    
        //
        // Configure ADC
        //
        
        //
        // Note: Channel ADCINA4  will be double sampled to workaround the ADC 1st 
        // sample issue for rev0 silicon errata
        //
        
        //
        // ADCINT1 trips after AdcResults latch
        //
        ADC_setIntPulseGenMode(myAdc, ADC_IntPulseGenMode_Prior);
        
        ADC_enableInt(myAdc, ADC_IntNumber_1);              // Enabled ADCINT1
        
        //
        // Disable ADCINT1 Continuous mode
        //
        ADC_setIntMode(myAdc, ADC_IntNumber_1, ADC_IntMode_ClearFlag);
        
        //
        // setup EOC2 to trigger ADCINT1 to fire
        //
        ADC_setIntSrc(myAdc, ADC_IntNumber_1, ADC_IntSrc_EOC0);
        
        //
        // set SOC0 channel select to ADCINA4
        //
        ADC_setSocChanNumber (myAdc, ADC_SocNumber_0, ADC_SocChanNumber_A4);
        
        //
        // set SOC2 channel select to ADCINA2
        //
        ADC_setSocChanNumber (myAdc, ADC_SocNumber_2, ADC_SocChanNumber_A2);
        
        //
        // set SOC1 channel select to ADCINA4
        //
        ADC_setSocChanNumber (myAdc, ADC_SocNumber_1, ADC_SocChanNumber_A4);
        
        //
        // set SOC0 start trigger on EPWM1A, due to round-robin SOC0 converts first 
        // then SOC1
        //
        ADC_setSocTrigSrc(myAdc, ADC_SocNumber_0, ADC_SocTrigSrc_EPWM1_ADCSOCA);
        
        //
        // set SOC1 start trigger on EPWM1A, due to round-robin SOC0 converts first
        // then SOC1
        //
        ADC_setSocTrigSrc(myAdc, ADC_SocNumber_1, ADC_SocTrigSrc_EPWM1_ADCSOCA);
        
        //
        // set SOC2 start trigger on EPWM1A, due to round-robin SOC0 converts first
        // then SOC1, then SOC2
        //
        ADC_setSocTrigSrc(myAdc, ADC_SocNumber_2, ADC_SocTrigSrc_EPWM1_ADCSOCA);
        
        //
        // set SOC0 S/H Window to 14 ADC Clock Cycles, (13 ACQPS plus 1)
        //
        ADC_setSocSampleWindow(myAdc, ADC_SocNumber_0, 
                               ADC_SocSampleWindow_7_cycles);
        //
        // set SOC1 S/H Window to 14 ADC Clock Cycles, (13 ACQPS plus 1)
        //
        ADC_setSocSampleWindow(myAdc, ADC_SocNumber_1, 
                               ADC_SocSampleWindow_7_cycles);
        
        //
        // set SOC2 S/H Window to 14 ADC Clock Cycles, (13 ACQPS plus 1)
        //
        ADC_setSocSampleWindow(myAdc, ADC_SocNumber_2, 
                               ADC_SocSampleWindow_7_cycles);
    
        //
        // Setup each SOC's ADCINT trigger source
        //
        AdcRegs.ADCINTSOCSEL1.all  = 0x00;    //No ADCINT will trigger SOCx.
        AdcRegs.ADCINTSOCSEL2.all  = 0x00;    //No ADCINT will trigger SOCx.
    
        //
        // Enable PWM clock
        //
        CLK_enablePwmClock(myClk, PWM_Number_1);
    
        //
        // Setup PWM
        //
        PWM_enableSocAPulse(myPwm);                     // Enable SOC on A group
        
        //
        // Select SOC from from CPMA on upcount
        //
        PWM_setSocAPulseSrc(myPwm, PWM_SocPulseSrc_CounterEqualCmpAIncr);
        
        //
        // Generate pulse on 1st event
        //    
        PWM_setSocAPeriod(myPwm, PWM_SocPeriod_FirstEvent);
    
    
        PWM_setPeriodLoad(myPwm, PWM_PeriodLoad_Immediate);
        PWM_setPeriod(myPwm, 0x258);                    // Set period for ePWM1
        PWM_setCmpA(myPwm, 0x100);                      // Set compare A value
        PWM_setPhase(myPwm, 0x0000);       // Phase is 0
        PWM_setCount(myPwm, 0x0000);
        PWM_setCounterMode(myPwm, PWM_CounterMode_Up);   // count up and start
    
        //
        // Clock ratio to SYSCLKOUT
        //
        PWM_setHighSpeedClkDiv(myPwm, PWM_HspClkDiv_by_1);
    
        PWM_setClkDiv(myPwm, PWM_ClkDiv_by_1);
    
    
           // Clear counter
    
        //
        // Load registers every ZERO
        //
        PWM_setShadowMode_CmpA(myPwm, PWM_ShadowMode_Shadow);
    
        PWM_setShadowMode_CmpB(myPwm, PWM_ShadowMode_Shadow);
        PWM_setLoadMode_CmpA(myPwm, PWM_LoadMode_Zero);
        PWM_setLoadMode_CmpB(myPwm, PWM_LoadMode_Zero);
    
        PWM_setActionQual_CntUp_CmpA_PwmA(myPwm, PWM_ActionQual_Clear);
        PWM_setActionQual_Period_PwmA(myPwm, PWM_ActionQual_Set);
    
        CLK_enableTbClockSync(myClk);
        //
        // Wait for ADC interrupt
        //
        for(;;)
        {
            LoopCount++;
        }
    }
    
    //
    // adc_isr -
    //
    #pragma CODE_SECTION(adc_isr, "ramfuncs");
    __interrupt void 
    adc_isr(void)
    {
        //
        // discard ADCRESULT0 as part of the workaround to the 1st sample errata 
        // for rev0
        //
        Voltage1[ConversionCount] = ADC_readResult(myAdc, ADC_ResultNumber_1);
        Voltage2[ConversionCount] = ADC_readResult(myAdc, ADC_ResultNumber_2);
    
        GPIO_toggle(myGpio, GPIO_Number_19);
        //
        // If 10 conversions have been logged, start over
        //
        if(ConversionCount == 9)
        {
            ConversionCount = 0;
        }
        else
        {
            ConversionCount++;
        }
    
        //
        // Clear ADCINT1 flag reinitialize for next SOC
        //
        ADC_clearIntFlag(myAdc, ADC_IntNumber_1);
        
    
        //
        // Acknowledge interrupt to PIE
        //
        PIE_clearInt(myPie, PIE_GroupNumber_10);
    
        AdcRegs.ADCINTSOCSEL1.all  = 0x00;    //No ADCINT will trigger SOCx.
        AdcRegs.ADCINTSOCSEL2.all  = 0x00;    //No ADCINT will trigger SOCx.
    
        return;
    }
    
    //
    // End of File
    //
    
    

    ******************************************************************************
                 TMS320C2000 Linker PC v18.12.4                    
    ******************************************************************************
    >> Linked Wed Jan 13 09:36:53 2021
    
    OUTPUT FILE NAME:   <Example_F2802xAdcSoc.out>
    ENTRY POINT SYMBOL: "code_start"  address: 003f7ff6
    
    
    MEMORY CONFIGURATION
    
             name            origin    length      used     unused   attr    fill
    ----------------------  --------  ---------  --------  --------  ----  --------
    PAGE 0:
      RAMM0                 00000050   000003b0  00000040  00000370  RWIX
      OTP                   003d7800   00000400  00000000  00000400  RWIX
      FLASHB                003f6000   00001000  00000000  00001000  RWIX
      FLASHA                003f7000   00000f80  00000a12  0000056e  RWIX
      CSM_RSVD              003f7f80   00000076  00000000  00000076  RWIX
      BEGIN                 003f7ff6   00000002  00000002  00000000  RWIX
      CSM_PWL_P0            003f7ff8   00000008  00000000  00000008  RWIX
      IQTABLES              003fe000   00000b50  00000000  00000b50  RWIX
      IQTABLES2             003feb50   0000008c  00000000  0000008c  RWIX
      IQTABLES3             003febdc   000000aa  00000000  000000aa  RWIX
      ROM                   003ff27c   00000d44  00000000  00000d44  RWIX
      RESET                 003fffc0   00000002  00000000  00000002  RWIX
      VECTORS               003fffc2   0000003e  00000000  0000003e  RWIX
    
    PAGE 1:
      BOOT_RSVD             00000000   00000050  00000000  00000050  RWIX
      RAMM1                 00000400   00000400  0000022d  000001d3  RWIX
      DEV_EMU               00000880   00000105  00000004  00000101  RWIX
      SYS_PWR_CTL           00000985   00000003  00000003  00000000  RWIX
      FLASH_REGS            00000a80   00000060  00000008  00000058  RWIX
      CSM                   00000ae0   00000010  00000010  00000000  RWIX
      ADC_RESULT            00000b00   00000020  00000020  00000000  RWIX
      CPU_TIMER0            00000c00   00000008  00000008  00000000  RWIX
      CPU_TIMER1            00000c08   00000008  00000008  00000000  RWIX
      CPU_TIMER2            00000c10   00000008  00000008  00000000  RWIX
      PIE_CTRL              00000ce0   00000020  0000001a  00000006  RWIX
      PIE_VECT              00000d00   00000100  00000100  00000000  RWIX
      COMP1                 00006400   00000020  00000011  0000000f  RWIX
      COMP2                 00006420   00000020  00000011  0000000f  RWIX
      EPWM1                 00006800   00000040  00000040  00000000  RWIX
      EPWM2                 00006840   00000040  00000040  00000000  RWIX
      EPWM3                 00006880   00000040  00000040  00000000  RWIX
      EPWM4                 000068c0   00000040  00000040  00000000  RWIX
      ECAP1                 00006a00   00000020  00000020  00000000  RWIX
      GPIOCTRL              00006f80   00000040  00000040  00000000  RWIX
      GPIODAT               00006fc0   00000020  00000020  00000000  RWIX
      GPIOINT               00006fe0   00000020  0000000a  00000016  RWIX
      SYSTEM                00007010   00000020  0000001f  00000001  RWIX
      SPIA                  00007040   00000010  00000010  00000000  RWIX
      SCIA                  00007050   00000010  00000010  00000000  RWIX
      NMIINTRUPT            00007060   00000010  00000010  00000000  RWIX
      XINTRUPT              00007070   00000010  00000010  00000000  RWIX
      ADC                   00007100   00000080  00000051  0000002f  RWIX
      I2CA                  00007900   00000040  00000022  0000001e  RWIX
      RAML0                 00008000   00000400  00000000  00000400  RWIX
      PARTID                003d7fff   00000001  00000001  00000000  RWIX
      CSM_PWL               003f7ff8   00000008  00000008  00000000  RWIX
    
    
    SECTION ALLOCATION MAP
    
     output                                  attributes/
    section   page    origin      length       input sections
    --------  ----  ----------  ----------   ----------------
    ramfuncs   0    003f7000    00000040     RUN ADDR = 00000050
                      003f7000    0000003c     Example_2802xAdcSoc.obj (ramfuncs:retain)
                      003f703c    00000004     driverlib.lib : f2802xx_asmfuncs.obj (ramfuncs)
    
    .econst    0    003f78f8    00000100     
                      003f78f8    00000100     driverlib.lib : pie.obj (.econst:_PIE_tableDebugInit)
    
    .cinit     0    003f79f8    0000001a     
                      003f79f8    0000000e     rts2800_ml.lib : exit.c.obj (.cinit)
                      003f7a06    00000005                    : _lock.c.obj (.cinit:__lock)
                      003f7a0b    00000005                    : _lock.c.obj (.cinit:__unlock)
                      003f7a10    00000002     --HOLE-- [fill = 0]
    
    codestart 
    *          0    003f7ff6    00000002     
                      003f7ff6    00000002     driverlib.lib : f2802xx_codestartbranch.obj (codestart)
    
    DevEmuRegsFile 
    *          1    00000880    00000004     UNINITIALIZED
                      00000880    00000004     driverlib.lib : F2802xX_GlobalVariableDefs.obj (DevEmuRegsFile)
    
    SysPwrCtrlRegsFile 
    *          1    00000985    00000003     UNINITIALIZED
                      00000985    00000003     driverlib.lib : F2802xX_GlobalVariableDefs.obj (SysPwrCtrlRegsFile)
    
    FlashRegsFile 
    *          1    00000a80    00000008     UNINITIALIZED
                      00000a80    00000008     driverlib.lib : F2802xX_GlobalVariableDefs.obj (FlashRegsFile)
    
    CsmRegsFile 
    *          1    00000ae0    00000010     UNINITIALIZED
                      00000ae0    00000010     driverlib.lib : F2802xX_GlobalVariableDefs.obj (CsmRegsFile)
    
    AdcResultFile 
    *          1    00000b00    00000020     UNINITIALIZED
                      00000b00    00000020     driverlib.lib : F2802xX_GlobalVariableDefs.obj (AdcResultFile)
    
    CpuTimer0RegsFile 
    *          1    00000c00    00000008     UNINITIALIZED
                      00000c00    00000008     driverlib.lib : F2802xX_GlobalVariableDefs.obj (CpuTimer0RegsFile)
    
    CpuTimer1RegsFile 
    *          1    00000c08    00000008     UNINITIALIZED
                      00000c08    00000008     driverlib.lib : F2802xX_GlobalVariableDefs.obj (CpuTimer1RegsFile)
    
    CpuTimer2RegsFile 
    *          1    00000c10    00000008     UNINITIALIZED
                      00000c10    00000008     driverlib.lib : F2802xX_GlobalVariableDefs.obj (CpuTimer2RegsFile)
    
    PieCtrlRegsFile 
    *          1    00000ce0    0000001a     UNINITIALIZED
                      00000ce0    0000001a     driverlib.lib : F2802xX_GlobalVariableDefs.obj (PieCtrlRegsFile)
    
    PieVectTableFile 
    *          1    00000d00    00000100     UNINITIALIZED
                      00000d00    00000100     driverlib.lib : F2802xX_GlobalVariableDefs.obj (PieVectTableFile)
    
    EmuKeyVar 
    *          1    00000d00    00000001     UNINITIALIZED
                      00000d00    00000001     driverlib.lib : F2802xX_GlobalVariableDefs.obj (EmuKeyVar)
    
    EmuBModeVar 
    *          1    00000d01    00000001     UNINITIALIZED
                      00000d01    00000001     driverlib.lib : F2802xX_GlobalVariableDefs.obj (EmuBModeVar)
    
    FlashCallbackVar 
    *          1    00000d02    00000002     UNINITIALIZED
                      00000d02    00000002     driverlib.lib : F2802xX_GlobalVariableDefs.obj (FlashCallbackVar)
    
    FlashScalingVar 
    *          1    00000d04    00000002     UNINITIALIZED
                      00000d04    00000002     driverlib.lib : F2802xX_GlobalVariableDefs.obj (FlashScalingVar)
    
    Comp1RegsFile 
    *          1    00006400    00000011     UNINITIALIZED
                      00006400    00000011     driverlib.lib : F2802xX_GlobalVariableDefs.obj (Comp1RegsFile)
    
    Comp2RegsFile 
    *          1    00006420    00000011     UNINITIALIZED
                      00006420    00000011     driverlib.lib : F2802xX_GlobalVariableDefs.obj (Comp2RegsFile)
    
    EPwm1RegsFile 
    *          1    00006800    00000040     UNINITIALIZED
                      00006800    00000040     driverlib.lib : F2802xX_GlobalVariableDefs.obj (EPwm1RegsFile)
    
    EPwm2RegsFile 
    *          1    00006840    00000040     UNINITIALIZED
                      00006840    00000040     driverlib.lib : F2802xX_GlobalVariableDefs.obj (EPwm2RegsFile)
    
    EPwm3RegsFile 
    *          1    00006880    00000040     UNINITIALIZED
                      00006880    00000040     driverlib.lib : F2802xX_GlobalVariableDefs.obj (EPwm3RegsFile)
    
    EPwm4RegsFile 
    *          1    000068c0    00000040     UNINITIALIZED
                      000068c0    00000040     driverlib.lib : F2802xX_GlobalVariableDefs.obj (EPwm4RegsFile)
    
    ECap1RegsFile 
    *          1    00006a00    00000020     UNINITIALIZED
                      00006a00    00000020     driverlib.lib : F2802xX_GlobalVariableDefs.obj (ECap1RegsFile)
    
    GpioCtrlRegsFile 
    *          1    00006f80    00000040     UNINITIALIZED
                      00006f80    00000040     driverlib.lib : F2802xX_GlobalVariableDefs.obj (GpioCtrlRegsFile)
    
    GpioDataRegsFile 
    *          1    00006fc0    00000020     UNINITIALIZED
                      00006fc0    00000020     driverlib.lib : F2802xX_GlobalVariableDefs.obj (GpioDataRegsFile)
    
    GpioIntRegsFile 
    *          1    00006fe0    0000000a     UNINITIALIZED
                      00006fe0    0000000a     driverlib.lib : F2802xX_GlobalVariableDefs.obj (GpioIntRegsFile)
    
    SysCtrlRegsFile 
    *          1    00007010    0000001f     UNINITIALIZED
                      00007010    0000001f     driverlib.lib : F2802xX_GlobalVariableDefs.obj (SysCtrlRegsFile)
    
    SpiaRegsFile 
    *          1    00007040    00000010     UNINITIALIZED
                      00007040    00000010     driverlib.lib : F2802xX_GlobalVariableDefs.obj (SpiaRegsFile)
    
    SciaRegsFile 
    *          1    00007050    00000010     UNINITIALIZED
                      00007050    00000010     driverlib.lib : F2802xX_GlobalVariableDefs.obj (SciaRegsFile)
    
    NmiIntruptRegsFile 
    *          1    00007060    00000010     UNINITIALIZED
                      00007060    00000010     driverlib.lib : F2802xX_GlobalVariableDefs.obj (NmiIntruptRegsFile)
    
    XIntruptRegsFile 
    *          1    00007070    00000010     UNINITIALIZED
                      00007070    00000010     driverlib.lib : F2802xX_GlobalVariableDefs.obj (XIntruptRegsFile)
    
    AdcRegsFile 
    *          1    00007100    00000051     UNINITIALIZED
                      00007100    00000051     driverlib.lib : F2802xX_GlobalVariableDefs.obj (AdcRegsFile)
    
    I2caRegsFile 
    *          1    00007900    00000022     UNINITIALIZED
                      00007900    00000022     driverlib.lib : F2802xX_GlobalVariableDefs.obj (I2caRegsFile)
    
    PartIdRegsFile 
    *          1    003d7fff    00000001     UNINITIALIZED
                      003d7fff    00000001     driverlib.lib : F2802xX_GlobalVariableDefs.obj (PartIdRegsFile)
    
    CsmPwlFile 
    *          1    003f7ff8    00000008     UNINITIALIZED
                      003f7ff8    00000008     driverlib.lib : F2802xX_GlobalVariableDefs.obj (CsmPwlFile)
    
    .pinit     0    003f7000    00000000     UNINITIALIZED
    
    .stack     1    00000400    00000200     UNINITIALIZED
                      00000400    00000200     --HOLE--
    
    .reset     0    003fffc0    00000002     DSECT
                      003fffc0    00000002     rts2800_ml.lib : boot28.asm.obj (.reset)
    
    vectors    0    003fffc2    00000000     DSECT
    
    .text      0    003f7040    000008b8     
                      003f7040    0000022e     f2802x_adc.obj (.text)
                      003f726e    000001da     Example_2802xAdcSoc.obj (.text)
                      003f7448    00000054     rts2800_ml.lib : boot28.asm.obj (.text)
                      003f749c    00000048     driverlib.lib : gpio.obj (.text:_GPIO_setMode)
                      003f74e4    00000029                   : gpio.obj (.text:_GPIO_setDirection)
                      003f750d    00000029                   : gpio.obj (.text:_GPIO_setPullUp)
                      003f7536    00000029     rts2800_ml.lib : exit.c.obj (.text)
                      003f755f    00000024                    : cpy_tbl.c.obj (.text)
                      003f7583    00000022     driverlib.lib : adc.obj (.text:_ADC_setIntMode)
                      003f75a5    00000022                   : adc.obj (.text:_ADC_setIntSrc)
                      003f75c7    0000001d     rts2800_ml.lib : memcpy.c.obj (.text)
                      003f75e4    00000019                    : args_main.c.obj (.text)
                      003f75fd    00000017     driverlib.lib : adc.obj (.text:_ADC_enableInt)
                      003f7614    00000015                   : pll.obj (.text:_PLL_setup)
                      003f7629    00000014                   : gpio.obj (.text:_GPIO_setHigh)
                      003f763d    00000014                   : gpio.obj (.text:_GPIO_toggle)
                      003f7651    00000014                   : pie.obj (.text:_PIE_enableAdcInt)
                      003f7665    00000012                   : adc.obj (.text:_ADC_setSocChanNumber)
                      003f7677    00000012                   : adc.obj (.text:_ADC_setSocSampleWindow)
                      003f7689    00000012                   : adc.obj (.text:_ADC_setSocTrigSrc)
                      003f769b    00000011                   : adc.obj (.text:_ADC_setIntPulseGenMode)
                      003f76ac    00000011                   : pie.obj (.text:_PIE_disableAllInts)
                      003f76bd    00000011                   : pie.obj (.text:_PIE_setDebugIntVectorTable)
                      003f76ce    0000000f                   : pie.obj (.text:_PIE_registerPieIntHandler)
                      003f76dd    0000000a                   : adc.obj (.text:_ADC_init)
                      003f76e7    0000000a                   : pie.obj (.text:_PIE_init)
                      003f76f1    0000000a                   : f2802xx_asmfuncs.obj (.text)
                      003f76fb    00000009                   : clk.obj (.text:_CLK_enablePwmClock)
                      003f7704    00000009                   : pwm.obj (.text:_PWM_setActionQual_CntUp_CmpA_PwmA)
                      003f770d    00000009                   : pwm.obj (.text:_PWM_setActionQual_Period_PwmA)
                      003f7716    00000009                   : pwm.obj (.text:_PWM_setSocAPeriod)
                      003f771f    00000009                   : pwm.obj (.text:_PWM_setSocAPulseSrc)
                      003f7728    00000009     rts2800_ml.lib : _lock.c.obj (.text)
                      003f7731    00000008     driverlib.lib : clk.obj (.text:_CLK_init)
                      003f7739    00000008                   : flash.obj (.text:_FLASH_init)
                      003f7741    00000008                   : gpio.obj (.text:_GPIO_init)
                      003f7749    00000008                   : pll.obj (.text:_PLL_init)
                      003f7751    00000008                   : pwm.obj (.text:_PWM_init)
                      003f7759    00000008                   : wdog.obj (.text:_WDOG_disable)
                      003f7761    00000008                   : wdog.obj (.text:_WDOG_init)
                      003f7769    00000008                   : f2802xx_codestartbranch.obj (.text)
                      003f7771    00000007                   : clk.obj (.text:_CLK_disableAdcClock)
                      003f7778    00000007                   : clk.obj (.text:_CLK_disableTbClockSync)
                      003f777f    00000007                   : clk.obj (.text:_CLK_enableAdcClock)
                      003f7786    00000007                   : clk.obj (.text:_CLK_enableTbClockSync)
                      003f778d    00000007                   : clk.obj (.text:_CLK_setOscSrc)
                      003f7794    00000007                   : pll.obj (.text:_PLL_setDivider)
                      003f779b    00000006                   : pll.obj (.text:_PLL_setMultiplier)
                      003f77a1    00000006                   : pwm.obj (.text:_PWM_setLoadMode_CmpB)
                      003f77a7    00000006                   : pwm.obj (.text:_PWM_setShadowMode_CmpA)
                      003f77ad    00000006                   : pwm.obj (.text:_PWM_setShadowMode_CmpB)
                      003f77b3    00000005                   : f2802xx_defaultisr.obj (.text:_ADCINT1_ISR)
                      003f77b8    00000005                   : f2802xx_defaultisr.obj (.text:_ADCINT2_ISR)
                      003f77bd    00000005                   : f2802xx_defaultisr.obj (.text:_ADCINT3_ISR)
                      003f77c2    00000005                   : f2802xx_defaultisr.obj (.text:_ADCINT4_ISR)
                      003f77c7    00000005                   : f2802xx_defaultisr.obj (.text:_ADCINT5_ISR)
                      003f77cc    00000005                   : f2802xx_defaultisr.obj (.text:_ADCINT6_ISR)
                      003f77d1    00000005                   : f2802xx_defaultisr.obj (.text:_ADCINT7_ISR)
                      003f77d6    00000005                   : f2802xx_defaultisr.obj (.text:_ADCINT8_ISR)
                      003f77db    00000005                   : f2802xx_defaultisr.obj (.text:_ADCINT9_ISR)
                      003f77e0    00000005                   : f2802xx_defaultisr.obj (.text:_DATALOG_ISR)
                      003f77e5    00000005                   : f2802xx_defaultisr.obj (.text:_ECAP1_INT_ISR)
                      003f77ea    00000005                   : f2802xx_defaultisr.obj (.text:_EMPTY_ISR)
                      003f77ef    00000005                   : f2802xx_defaultisr.obj (.text:_EMUINT_ISR)
                      003f77f4    00000005                   : f2802xx_defaultisr.obj (.text:_EPWM1_INT_ISR)
                      003f77f9    00000005                   : f2802xx_defaultisr.obj (.text:_EPWM1_TZINT_ISR)
                      003f77fe    00000005                   : f2802xx_defaultisr.obj (.text:_EPWM2_INT_ISR)
                      003f7803    00000005                   : f2802xx_defaultisr.obj (.text:_EPWM2_TZINT_ISR)
                      003f7808    00000005                   : f2802xx_defaultisr.obj (.text:_EPWM3_INT_ISR)
                      003f780d    00000005                   : f2802xx_defaultisr.obj (.text:_EPWM3_TZINT_ISR)
                      003f7812    00000005                   : f2802xx_defaultisr.obj (.text:_EPWM4_INT_ISR)
                      003f7817    00000005                   : f2802xx_defaultisr.obj (.text:_EPWM4_TZINT_ISR)
                      003f781c    00000005                   : f2802xx_defaultisr.obj (.text:_I2CINT1A_ISR)
                      003f7821    00000005                   : f2802xx_defaultisr.obj (.text:_I2CINT2A_ISR)
                      003f7826    00000005                   : f2802xx_defaultisr.obj (.text:_ILLEGAL_ISR)
                      003f782b    00000005                   : f2802xx_defaultisr.obj (.text:_INT13_ISR)
                      003f7830    00000005                   : f2802xx_defaultisr.obj (.text:_INT14_ISR)
                      003f7835    00000005                   : f2802xx_defaultisr.obj (.text:_NMI_ISR)
                      003f783a    00000005                   : f2802xx_defaultisr.obj (.text:_PIE_RESERVED)
                      003f783f    00000005                   : pie.obj (.text:_PIE_illegalIsr)
                      003f7844    00000005                   : f2802xx_defaultisr.obj (.text:_RTOSINT_ISR)
                      003f7849    00000005                   : f2802xx_defaultisr.obj (.text:_SCIRXINTA_ISR)
                      003f784e    00000005                   : f2802xx_defaultisr.obj (.text:_SCITXINTA_ISR)
                      003f7853    00000005                   : f2802xx_defaultisr.obj (.text:_SPIRXINTA_ISR)
                      003f7858    00000005                   : f2802xx_defaultisr.obj (.text:_SPITXINTA_ISR)
                      003f785d    00000005                   : f2802xx_defaultisr.obj (.text:_TINT0_ISR)
                      003f7862    00000005                   : f2802xx_defaultisr.obj (.text:_USER10_ISR)
                      003f7867    00000005                   : f2802xx_defaultisr.obj (.text:_USER11_ISR)
                      003f786c    00000005                   : f2802xx_defaultisr.obj (.text:_USER12_ISR)
                      003f7871    00000005                   : f2802xx_defaultisr.obj (.text:_USER1_ISR)
                      003f7876    00000005                   : f2802xx_defaultisr.obj (.text:_USER2_ISR)
                      003f787b    00000005                   : f2802xx_defaultisr.obj (.text:_USER3_ISR)
                      003f7880    00000005                   : f2802xx_defaultisr.obj (.text:_USER4_ISR)
                      003f7885    00000005                   : f2802xx_defaultisr.obj (.text:_USER5_ISR)
                      003f788a    00000005                   : f2802xx_defaultisr.obj (.text:_USER6_ISR)
                      003f788f    00000005                   : f2802xx_defaultisr.obj (.text:_USER7_ISR)
                      003f7894    00000005                   : f2802xx_defaultisr.obj (.text:_USER8_ISR)
                      003f7899    00000005                   : f2802xx_defaultisr.obj (.text:_USER9_ISR)
                      003f789e    00000005                   : f2802xx_defaultisr.obj (.text:_WAKEINT_ISR)
                      003f78a3    00000005                   : f2802xx_defaultisr.obj (.text:_XINT1_ISR)
                      003f78a8    00000005                   : f2802xx_defaultisr.obj (.text:_XINT2_ISR)
                      003f78ad    00000005                   : f2802xx_defaultisr.obj (.text:_XINT3_ISR)
                      003f78b2    00000005                   : f2802xx_defaultisr.obj (.text:_rsvd_ISR)
                      003f78b7    00000004                   : cpu.obj (.text:_CPU_enableInt)
                      003f78bb    00000004                   : cpu.obj (.text:_CPU_init)
                      003f78bf    00000004                   : pwm.obj (.text:_PWM_enableSocAPulse)
                      003f78c3    00000004                   : pwm.obj (.text:_PWM_setClkDiv)
                      003f78c7    00000004                   : pwm.obj (.text:_PWM_setCounterMode)
                      003f78cb    00000004                   : pwm.obj (.text:_PWM_setHighSpeedClkDiv)
                      003f78cf    00000004                   : pwm.obj (.text:_PWM_setLoadMode_CmpA)
                      003f78d3    00000004                   : pwm.obj (.text:_PWM_setPeriodLoad)
                      003f78d7    00000003                   : cpu.obj (.text:_CPU_clearIntFlags)
                      003f78da    00000003                   : cpu.obj (.text:_CPU_disableGlobalInts)
                      003f78dd    00000003                   : cpu.obj (.text:_CPU_enableDebugInt)
                      003f78e0    00000003                   : cpu.obj (.text:_CPU_enableGlobalInts)
                      003f78e3    00000003                   : pie.obj (.text:_PIE_disable)
                      003f78e6    00000003                   : pie.obj (.text:_PIE_enable)
                      003f78e9    00000003                   : pll.obj (.text:_PLL_getClkStatus)
                      003f78ec    00000003                   : pll.obj (.text:_PLL_getLockStatus)
                      003f78ef    00000002                   : pwm.obj (.text:_PWM_setCount)
                      003f78f1    00000002                   : pwm.obj (.text:_PWM_setPeriod)
                      003f78f3    00000002                   : pwm.obj (.text:_PWM_setPhase)
                      003f78f5    00000002     rts2800_ml.lib : pre_init.c.obj (.text)
                      003f78f7    00000001                    : startup.c.obj (.text)
    
    .ebss      1    00000600    0000002d     UNINITIALIZED
                      00000600    0000000e     Example_2802xAdcSoc.obj (.ebss)
                      0000060e    0000000a     Example_2802xAdcSoc.obj (.ebss:_Voltage1)
                      00000618    0000000a     Example_2802xAdcSoc.obj (.ebss:_Voltage2)
                      00000622    00000006     rts2800_ml.lib : exit.c.obj (.ebss)
                      00000628    00000002                    : _lock.c.obj (.ebss:__lock)
                      0000062a    00000002                    : _lock.c.obj (.ebss:__unlock)
                      0000062c    00000001     driverlib.lib : cpu.obj (.ebss)
    
    MODULE SUMMARY
    
           Module                           code   initialized data   uninitialized data
           ------                           ----   ----------------   ------------------
        .\
           Example_2802xAdcSoc.obj          594    0                  34                
           f2802x_adc.obj                   558    0                  0                 
        +--+--------------------------------+------+------------------+--------------------+
           Total:                           1152   0                  34                
                                                                                        
        C:/ti/c2000/C2000Ware_3_03_00_00/device_support/f2802x/common/ccs/Debug/driverlib.lib
           F2802xX_GlobalVariableDefs.obj   0      0                  1022              
           pie.obj                          90     256                0                 
           f2802xx_defaultisr.obj           255    0                  0                 
           gpio.obj                         202    0                  0                 
           adc.obj                          172    0                  0                 
           pwm.obj                          92     0                  0                 
           clk.obj                          52     0                  0                 
           pll.obj                          48     0                  0                 
           cpu.obj                          20     0                  1                 
           f2802xx_asmfuncs.obj             18     0                  0                 
           wdog.obj                         16     0                  0                 
           f2802xx_codestartbranch.obj      10     0                  0                 
           flash.obj                        8      0                  0                 
        +--+--------------------------------+------+------------------+--------------------+
           Total:                           983    256                1023              
                                                                                        
        C:/ti/ccs930/ccs/tools/compiler/ti-cgt-c2000_18.12.4.LTS/lib/rts2800_ml.lib
           boot28.asm.obj                   84     0                  0                 
           exit.c.obj                       41     14                 6                 
           cpy_tbl.c.obj                    36     0                  0                 
           memcpy.c.obj                     29     0                  0                 
           args_main.c.obj                  25     0                  0                 
           _lock.c.obj                      9      10                 4                 
           pre_init.c.obj                   2      0                  0                 
           startup.c.obj                    1      0                  0                 
        +--+--------------------------------+------+------------------+--------------------+
           Total:                           227    24                 10                
                                                                                        
           Stack:                           0      0                  512               
        +--+--------------------------------+------+------------------+--------------------+
           Grand Total:                     2362   280                1579              
    
    
    GLOBAL DATA SYMBOLS: SORTED BY DATA PAGE
    
    address     data page           name
    --------    ----------------    ----
    00000400      10 (00000400)     __stack
    
    00000600      18 (00000600)     _LoopCount
    00000601      18 (00000600)     _ConversionCount
    00000602      18 (00000600)     _myAdc
    00000604      18 (00000600)     _myClk
    00000606      18 (00000600)     _myFlash
    00000608      18 (00000600)     _myGpio
    0000060a      18 (00000600)     _myPie
    0000060c      18 (00000600)     _myPwm
    0000060e      18 (00000600)     _Voltage1
    00000618      18 (00000600)     _Voltage2
    00000622      18 (00000600)     ___TI_enable_exit_profile_output
    00000624      18 (00000600)     ___TI_cleanup_ptr
    00000626      18 (00000600)     ___TI_dtors_ptr
    00000628      18 (00000600)     __lock
    0000062a      18 (00000600)     __unlock
    0000062c      18 (00000600)     _cpu
    
    00000880      22 (00000880)     _DevEmuRegs
    
    00000985      26 (00000980)     _SysPwrCtrlRegs
    
    00000a80      2a (00000a80)     _FlashRegs
    
    00000ae0      2b (00000ac0)     _CsmRegs
    
    00000b00      2c (00000b00)     _AdcResult
    
    00000c00      30 (00000c00)     _CpuTimer0Regs
    00000c08      30 (00000c00)     _CpuTimer1Regs
    00000c10      30 (00000c00)     _CpuTimer2Regs
    
    00000ce0      33 (00000cc0)     _PieCtrlRegs
    
    00000d00      34 (00000d00)     _EmuKey
    00000d00      34 (00000d00)     _PieVectTable
    00000d01      34 (00000d00)     _EmuBMode
    00000d02      34 (00000d00)     _Flash_CallbackPtr
    00000d04      34 (00000d00)     _Flash_CPUScaleFactor
    
    00006400     190 (00006400)     _Comp1Regs
    00006420     190 (00006400)     _Comp2Regs
    
    00006800     1a0 (00006800)     _EPwm1Regs
    
    00006840     1a1 (00006840)     _EPwm2Regs
    
    00006880     1a2 (00006880)     _EPwm3Regs
    
    000068c0     1a3 (000068c0)     _EPwm4Regs
    
    00006a00     1a8 (00006a00)     _ECap1Regs
    
    00006f80     1be (00006f80)     _GpioCtrlRegs
    
    00006fc0     1bf (00006fc0)     _GpioDataRegs
    00006fe0     1bf (00006fc0)     _GpioIntRegs
    
    00007010     1c0 (00007000)     _SysCtrlRegs
    
    00007040     1c1 (00007040)     _SpiaRegs
    00007050     1c1 (00007040)     _SciaRegs
    00007060     1c1 (00007040)     _NmiIntruptRegs
    00007070     1c1 (00007040)     _XIntruptRegs
    
    00007100     1c4 (00007100)     _AdcRegs
    
    00007900     1e4 (00007900)     _I2caRegs
    
    003d7fff    f5ff (003d7fc0)     _PartIdRegs
    
    003f78f8    fde3 (003f78c0)     _PIE_tableDebugInit
    
    003f7ff8    fdff (003f7fc0)     _CsmPwl
    
    
    GLOBAL SYMBOLS: SORTED ALPHABETICALLY BY Name 
    
    page  address   name                              
    ----  -------   ----                              
    abs   ffffffff  .text                             
    0     003f7536  C$$EXIT                           
    0     003f77b3  _ADCINT1_ISR                      
    0     003f77b8  _ADCINT2_ISR                      
    0     003f77bd  _ADCINT3_ISR                      
    0     003f77c2  _ADCINT4_ISR                      
    0     003f77c7  _ADCINT5_ISR                      
    0     003f77cc  _ADCINT6_ISR                      
    0     003f77d1  _ADCINT7_ISR                      
    0     003f77d6  _ADCINT8_ISR                      
    0     003f77db  _ADCINT9_ISR                      
    0     003f75fd  _ADC_enableInt                    
    0     003f76dd  _ADC_init                         
    0     003f7583  _ADC_setIntMode                   
    0     003f769b  _ADC_setIntPulseGenMode           
    0     003f75a5  _ADC_setIntSrc                    
    0     003f7665  _ADC_setSocChanNumber             
    0     003f7677  _ADC_setSocSampleWindow           
    0     003f7689  _ADC_setSocTrigSrc                
    0     003f70a8  _AdcChanSelect                    
    0     003f711d  _AdcConversion                    
    0     003f7081  _AdcOffsetSelfCal                 
    1     00007100  _AdcRegs                          
    1     00000b00  _AdcResult                        
    0     003f7771  _CLK_disableAdcClock              
    0     003f7778  _CLK_disableTbClockSync           
    0     003f777f  _CLK_enableAdcClock               
    0     003f76fb  _CLK_enablePwmClock               
    0     003f7786  _CLK_enableTbClockSync            
    0     003f7731  _CLK_init                         
    0     003f778d  _CLK_setOscSrc                    
    0     003f78d7  _CPU_clearIntFlags                
    0     003f78da  _CPU_disableGlobalInts            
    0     003f78dd  _CPU_enableDebugInt               
    0     003f78e0  _CPU_enableGlobalInts             
    0     003f78b7  _CPU_enableInt                    
    0     003f78bb  _CPU_init                         
    1     00006400  _Comp1Regs                        
    1     00006420  _Comp2Regs                        
    1     00000601  _ConversionCount                  
    1     00000c00  _CpuTimer0Regs                    
    1     00000c08  _CpuTimer1Regs                    
    1     00000c10  _CpuTimer2Regs                    
    1     003f7ff8  _CsmPwl                           
    1     00000ae0  _CsmRegs                          
    0     003f77e0  _DATALOG_ISR                      
    0     003f76f4  _DSP28x_DisableInt                
    0     003f76f8  _DSP28x_RestoreInt                
    0     0000008c  _DSP28x_usDelay                   
    1     00000880  _DevEmuRegs                       
    0     003f77e5  _ECAP1_INT_ISR                    
    1     00006a00  _ECap1Regs                        
    0     003f77ea  _EMPTY_ISR                        
    0     003f77ef  _EMUINT_ISR                       
    0     003f77f4  _EPWM1_INT_ISR                    
    0     003f77f9  _EPWM1_TZINT_ISR                  
    0     003f77fe  _EPWM2_INT_ISR                    
    0     003f7803  _EPWM2_TZINT_ISR                  
    0     003f7808  _EPWM3_INT_ISR                    
    0     003f780d  _EPWM3_TZINT_ISR                  
    0     003f7812  _EPWM4_INT_ISR                    
    0     003f7817  _EPWM4_TZINT_ISR                  
    1     00006800  _EPwm1Regs                        
    1     00006840  _EPwm2Regs                        
    1     00006880  _EPwm3Regs                        
    1     000068c0  _EPwm4Regs                        
    1     00000d01  _EmuBMode                         
    1     00000d00  _EmuKey                           
    0     003f7739  _FLASH_init                       
    1     00000a80  _FlashRegs                        
    1     00000d04  _Flash_CPUScaleFactor             
    1     00000d02  _Flash_CallbackPtr                
    0     003f7741  _GPIO_init                        
    0     003f74e4  _GPIO_setDirection                
    0     003f7629  _GPIO_setHigh                     
    0     003f749c  _GPIO_setMode                     
    0     003f750d  _GPIO_setPullUp                   
    0     003f763d  _GPIO_toggle                      
    1     00006f80  _GpioCtrlRegs                     
    1     00006fc0  _GpioDataRegs                     
    1     00006fe0  _GpioIntRegs                      
    0     003f781c  _I2CINT1A_ISR                     
    0     003f7821  _I2CINT2A_ISR                     
    1     00007900  _I2caRegs                         
    0     003f7826  _ILLEGAL_ISR                      
    0     003f782b  _INT13_ISR                        
    0     003f7830  _INT14_ISR                        
    0     003f7040  _InitAdc                          
    0     003f705f  _InitAdcAio                       
    1     00000600  _LoopCount                        
    0     003f7835  _NMI_ISR                          
    1     00007060  _NmiIntruptRegs                   
    0     003f783a  _PIE_RESERVED                     
    0     003f78e3  _PIE_disable                      
    0     003f76ac  _PIE_disableAllInts               
    0     003f78e6  _PIE_enable                       
    0     003f7651  _PIE_enableAdcInt                 
    0     003f783f  _PIE_illegalIsr                   
    0     003f76e7  _PIE_init                         
    0     003f76ce  _PIE_registerPieIntHandler        
    0     003f76bd  _PIE_setDebugIntVectorTable       
    0     003f78f8  _PIE_tableDebugInit               
    0     003f78e9  _PLL_getClkStatus                 
    0     003f78ec  _PLL_getLockStatus                
    0     003f7749  _PLL_init                         
    0     003f7794  _PLL_setDivider                   
    0     003f779b  _PLL_setMultiplier                
    0     003f7614  _PLL_setup                        
    0     003f78bf  _PWM_enableSocAPulse              
    0     003f7751  _PWM_init                         
    0     003f7704  _PWM_setActionQual_CntUp_CmpA_PwmA
    0     003f770d  _PWM_setActionQual_Period_PwmA    
    0     003f78c3  _PWM_setClkDiv                    
    0     003f78ef  _PWM_setCount                     
    0     003f78c7  _PWM_setCounterMode               
    0     003f78cb  _PWM_setHighSpeedClkDiv           
    0     003f78cf  _PWM_setLoadMode_CmpA             
    0     003f77a1  _PWM_setLoadMode_CmpB             
    0     003f78f1  _PWM_setPeriod                    
    0     003f78d3  _PWM_setPeriodLoad                
    0     003f78f3  _PWM_setPhase                     
    0     003f77a7  _PWM_setShadowMode_CmpA           
    0     003f77ad  _PWM_setShadowMode_CmpB           
    0     003f7716  _PWM_setSocAPeriod                
    0     003f771f  _PWM_setSocAPulseSrc              
    1     003d7fff  _PartIdRegs                       
    1     00000ce0  _PieCtrlRegs                      
    1     00000d00  _PieVectTable                     
    0     003f7844  _RTOSINT_ISR                      
    abs   00000040  _RamfuncsLoadSize                 
    0     003f7000  _RamfuncsLoadStart                
    0     00000050  _RamfuncsRunStart                 
    0     003f7849  _SCIRXINTA_ISR                    
    0     003f784e  _SCITXINTA_ISR                    
    0     003f7853  _SPIRXINTA_ISR                    
    0     003f7858  _SPITXINTA_ISR                    
    1     00007050  _SciaRegs                         
    1     00007040  _SpiaRegs                         
    1     00007010  _SysCtrlRegs                      
    1     00000985  _SysPwrCtrlRegs                   
    0     003f785d  _TINT0_ISR                        
    0     003f7862  _USER10_ISR                       
    0     003f7867  _USER11_ISR                       
    0     003f786c  _USER12_ISR                       
    0     003f7871  _USER1_ISR                        
    0     003f7876  _USER2_ISR                        
    0     003f787b  _USER3_ISR                        
    0     003f7880  _USER4_ISR                        
    0     003f7885  _USER5_ISR                        
    0     003f788a  _USER6_ISR                        
    0     003f788f  _USER7_ISR                        
    0     003f7894  _USER8_ISR                        
    0     003f7899  _USER9_ISR                        
    1     0000060e  _Voltage1                         
    1     00000618  _Voltage2                         
    0     003f789e  _WAKEINT_ISR                      
    0     003f7759  _WDOG_disable                     
    0     003f7761  _WDOG_init                        
    0     003f78a3  _XINT1_ISR                        
    0     003f78a8  _XINT2_ISR                        
    0     003f78ad  _XINT3_ISR                        
    1     00007070  _XIntruptRegs                     
    1     00000600  __STACK_END                       
    abs   00000200  __STACK_SIZE                      
    1     00000624  ___TI_cleanup_ptr                 
    1     00000626  ___TI_dtors_ptr                   
    1     00000622  ___TI_enable_exit_profile_output  
    abs   ffffffff  ___TI_pprof_out_hndl              
    abs   ffffffff  ___TI_prof_data_size              
    abs   ffffffff  ___TI_prof_data_start             
    abs   ffffffff  ___binit__                        
    abs   ffffffff  ___c_args__                       
    0     003f79f8  ___cinit__                        
    abs   ffffffff  ___etext__                        
    abs   ffffffff  ___pinit__                        
    abs   ffffffff  ___text__                         
    0     003f75e4  __args_main                       
    1     00000628  __lock                            
    0     003f7730  __nop                             
    0     003f772c  __register_lock                   
    0     003f7728  __register_unlock                 
    1     00000400  __stack                           
    0     003f78f7  __system_post_cinit               
    0     003f78f5  __system_pre_init                 
    1     0000062a  __unlock                          
    0     003f7536  _abort                            
    0     00000050  _adc_isr                          
    0     003f7448  _c_int00                          
    0     003f755f  _copy_in                          
    1     0000062c  _cpu                              
    0     003f7538  _exit                             
    0     003f729f  _main                             
    0     003f75c7  _memcpy                           
    1     00000602  _myAdc                            
    1     00000604  _myClk                            
    1     00000606  _myFlash                          
    1     00000608  _myGpio                           
    1     0000060a  _myPie                            
    1     0000060c  _myPwm                            
    0     003f78b2  _rsvd_ISR                         
    0     003f76f1  _setDBGIER                        
    abs   ffffffff  binit                             
    0     003f79f8  cinit                             
    0     003f7ff6  code_start                        
    abs   ffffffff  etext                             
    abs   ffffffff  pinit                             
    
    
    GLOBAL SYMBOLS: SORTED BY Symbol Address 
    
    page  address   name                              
    ----  -------   ----                              
    0     00000050  _RamfuncsRunStart                 
    0     00000050  _adc_isr                          
    0     0000008c  _DSP28x_usDelay                   
    0     003f7000  _RamfuncsLoadStart                
    0     003f7040  _InitAdc                          
    0     003f705f  _InitAdcAio                       
    0     003f7081  _AdcOffsetSelfCal                 
    0     003f70a8  _AdcChanSelect                    
    0     003f711d  _AdcConversion                    
    0     003f729f  _main                             
    0     003f7448  _c_int00                          
    0     003f749c  _GPIO_setMode                     
    0     003f74e4  _GPIO_setDirection                
    0     003f750d  _GPIO_setPullUp                   
    0     003f7536  C$$EXIT                           
    0     003f7536  _abort                            
    0     003f7538  _exit                             
    0     003f755f  _copy_in                          
    0     003f7583  _ADC_setIntMode                   
    0     003f75a5  _ADC_setIntSrc                    
    0     003f75c7  _memcpy                           
    0     003f75e4  __args_main                       
    0     003f75fd  _ADC_enableInt                    
    0     003f7614  _PLL_setup                        
    0     003f7629  _GPIO_setHigh                     
    0     003f763d  _GPIO_toggle                      
    0     003f7651  _PIE_enableAdcInt                 
    0     003f7665  _ADC_setSocChanNumber             
    0     003f7677  _ADC_setSocSampleWindow           
    0     003f7689  _ADC_setSocTrigSrc                
    0     003f769b  _ADC_setIntPulseGenMode           
    0     003f76ac  _PIE_disableAllInts               
    0     003f76bd  _PIE_setDebugIntVectorTable       
    0     003f76ce  _PIE_registerPieIntHandler        
    0     003f76dd  _ADC_init                         
    0     003f76e7  _PIE_init                         
    0     003f76f1  _setDBGIER                        
    0     003f76f4  _DSP28x_DisableInt                
    0     003f76f8  _DSP28x_RestoreInt                
    0     003f76fb  _CLK_enablePwmClock               
    0     003f7704  _PWM_setActionQual_CntUp_CmpA_PwmA
    0     003f770d  _PWM_setActionQual_Period_PwmA    
    0     003f7716  _PWM_setSocAPeriod                
    0     003f771f  _PWM_setSocAPulseSrc              
    0     003f7728  __register_unlock                 
    0     003f772c  __register_lock                   
    0     003f7730  __nop                             
    0     003f7731  _CLK_init                         
    0     003f7739  _FLASH_init                       
    0     003f7741  _GPIO_init                        
    0     003f7749  _PLL_init                         
    0     003f7751  _PWM_init                         
    0     003f7759  _WDOG_disable                     
    0     003f7761  _WDOG_init                        
    0     003f7771  _CLK_disableAdcClock              
    0     003f7778  _CLK_disableTbClockSync           
    0     003f777f  _CLK_enableAdcClock               
    0     003f7786  _CLK_enableTbClockSync            
    0     003f778d  _CLK_setOscSrc                    
    0     003f7794  _PLL_setDivider                   
    0     003f779b  _PLL_setMultiplier                
    0     003f77a1  _PWM_setLoadMode_CmpB             
    0     003f77a7  _PWM_setShadowMode_CmpA           
    0     003f77ad  _PWM_setShadowMode_CmpB           
    0     003f77b3  _ADCINT1_ISR                      
    0     003f77b8  _ADCINT2_ISR                      
    0     003f77bd  _ADCINT3_ISR                      
    0     003f77c2  _ADCINT4_ISR                      
    0     003f77c7  _ADCINT5_ISR                      
    0     003f77cc  _ADCINT6_ISR                      
    0     003f77d1  _ADCINT7_ISR                      
    0     003f77d6  _ADCINT8_ISR                      
    0     003f77db  _ADCINT9_ISR                      
    0     003f77e0  _DATALOG_ISR                      
    0     003f77e5  _ECAP1_INT_ISR                    
    0     003f77ea  _EMPTY_ISR                        
    0     003f77ef  _EMUINT_ISR                       
    0     003f77f4  _EPWM1_INT_ISR                    
    0     003f77f9  _EPWM1_TZINT_ISR                  
    0     003f77fe  _EPWM2_INT_ISR                    
    0     003f7803  _EPWM2_TZINT_ISR                  
    0     003f7808  _EPWM3_INT_ISR                    
    0     003f780d  _EPWM3_TZINT_ISR                  
    0     003f7812  _EPWM4_INT_ISR                    
    0     003f7817  _EPWM4_TZINT_ISR                  
    0     003f781c  _I2CINT1A_ISR                     
    0     003f7821  _I2CINT2A_ISR                     
    0     003f7826  _ILLEGAL_ISR                      
    0     003f782b  _INT13_ISR                        
    0     003f7830  _INT14_ISR                        
    0     003f7835  _NMI_ISR                          
    0     003f783a  _PIE_RESERVED                     
    0     003f783f  _PIE_illegalIsr                   
    0     003f7844  _RTOSINT_ISR                      
    0     003f7849  _SCIRXINTA_ISR                    
    0     003f784e  _SCITXINTA_ISR                    
    0     003f7853  _SPIRXINTA_ISR                    
    0     003f7858  _SPITXINTA_ISR                    
    0     003f785d  _TINT0_ISR                        
    0     003f7862  _USER10_ISR                       
    0     003f7867  _USER11_ISR                       
    0     003f786c  _USER12_ISR                       
    0     003f7871  _USER1_ISR                        
    0     003f7876  _USER2_ISR                        
    0     003f787b  _USER3_ISR                        
    0     003f7880  _USER4_ISR                        
    0     003f7885  _USER5_ISR                        
    0     003f788a  _USER6_ISR                        
    0     003f788f  _USER7_ISR                        
    0     003f7894  _USER8_ISR                        
    0     003f7899  _USER9_ISR                        
    0     003f789e  _WAKEINT_ISR                      
    0     003f78a3  _XINT1_ISR                        
    0     003f78a8  _XINT2_ISR                        
    0     003f78ad  _XINT3_ISR                        
    0     003f78b2  _rsvd_ISR                         
    0     003f78b7  _CPU_enableInt                    
    0     003f78bb  _CPU_init                         
    0     003f78bf  _PWM_enableSocAPulse              
    0     003f78c3  _PWM_setClkDiv                    
    0     003f78c7  _PWM_setCounterMode               
    0     003f78cb  _PWM_setHighSpeedClkDiv           
    0     003f78cf  _PWM_setLoadMode_CmpA             
    0     003f78d3  _PWM_setPeriodLoad                
    0     003f78d7  _CPU_clearIntFlags                
    0     003f78da  _CPU_disableGlobalInts            
    0     003f78dd  _CPU_enableDebugInt               
    0     003f78e0  _CPU_enableGlobalInts             
    0     003f78e3  _PIE_disable                      
    0     003f78e6  _PIE_enable                       
    0     003f78e9  _PLL_getClkStatus                 
    0     003f78ec  _PLL_getLockStatus                
    0     003f78ef  _PWM_setCount                     
    0     003f78f1  _PWM_setPeriod                    
    0     003f78f3  _PWM_setPhase                     
    0     003f78f5  __system_pre_init                 
    0     003f78f7  __system_post_cinit               
    0     003f78f8  _PIE_tableDebugInit               
    0     003f79f8  ___cinit__                        
    0     003f79f8  cinit                             
    0     003f7ff6  code_start                        
    1     00000400  __stack                           
    1     00000600  _LoopCount                        
    1     00000600  __STACK_END                       
    1     00000601  _ConversionCount                  
    1     00000602  _myAdc                            
    1     00000604  _myClk                            
    1     00000606  _myFlash                          
    1     00000608  _myGpio                           
    1     0000060a  _myPie                            
    1     0000060c  _myPwm                            
    1     0000060e  _Voltage1                         
    1     00000618  _Voltage2                         
    1     00000622  ___TI_enable_exit_profile_output  
    1     00000624  ___TI_cleanup_ptr                 
    1     00000626  ___TI_dtors_ptr                   
    1     00000628  __lock                            
    1     0000062a  __unlock                          
    1     0000062c  _cpu                              
    1     00000880  _DevEmuRegs                       
    1     00000985  _SysPwrCtrlRegs                   
    1     00000a80  _FlashRegs                        
    1     00000ae0  _CsmRegs                          
    1     00000b00  _AdcResult                        
    1     00000c00  _CpuTimer0Regs                    
    1     00000c08  _CpuTimer1Regs                    
    1     00000c10  _CpuTimer2Regs                    
    1     00000ce0  _PieCtrlRegs                      
    1     00000d00  _EmuKey                           
    1     00000d00  _PieVectTable                     
    1     00000d01  _EmuBMode                         
    1     00000d02  _Flash_CallbackPtr                
    1     00000d04  _Flash_CPUScaleFactor             
    1     00006400  _Comp1Regs                        
    1     00006420  _Comp2Regs                        
    1     00006800  _EPwm1Regs                        
    1     00006840  _EPwm2Regs                        
    1     00006880  _EPwm3Regs                        
    1     000068c0  _EPwm4Regs                        
    1     00006a00  _ECap1Regs                        
    1     00006f80  _GpioCtrlRegs                     
    1     00006fc0  _GpioDataRegs                     
    1     00006fe0  _GpioIntRegs                      
    1     00007010  _SysCtrlRegs                      
    1     00007040  _SpiaRegs                         
    1     00007050  _SciaRegs                         
    1     00007060  _NmiIntruptRegs                   
    1     00007070  _XIntruptRegs                     
    1     00007100  _AdcRegs                          
    1     00007900  _I2caRegs                         
    1     003d7fff  _PartIdRegs                       
    1     003f7ff8  _CsmPwl                           
    abs   00000040  _RamfuncsLoadSize                 
    abs   00000200  __STACK_SIZE                      
    abs   ffffffff  .text                             
    abs   ffffffff  ___TI_pprof_out_hndl              
    abs   ffffffff  ___TI_prof_data_size              
    abs   ffffffff  ___TI_prof_data_start             
    abs   ffffffff  ___binit__                        
    abs   ffffffff  ___c_args__                       
    abs   ffffffff  ___etext__                        
    abs   ffffffff  ___pinit__                        
    abs   ffffffff  ___text__                         
    abs   ffffffff  binit                             
    abs   ffffffff  etext                             
    abs   ffffffff  pinit                             
    
    [206 symbols]
    

  • I think ADCINTSOCSELx are EALLOW protected. Make sure the writes are actually going through.

    Judging from your map file, it looks like all of the functions called by your ISR are being inlined appropriately except for GPIO_toggle(). You could make it inline as well to make sure it's executed from RAM and not taking on the overhead of the function call. I'd be surprised if that one function would be enough to cause the issue though.

    Whitney