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.

EK-TM4C129EXL: Values Recording problem

Part Number: EK-TM4C129EXL


Hi, I am student working on my thesis. This is my first time using TM4C129EXL for coding. I got trouble with the value recording, when I use breakpoint function in CCS with property action "refresh all window", the values of the potentiometer are continously updated in the expressions table. But when I remove the breakpoint, the display values are not changing anymore. Now I want to keep the values of the potentiometer continously updating without using the breakpoint. How can I do it ? 

#include <stdint.h>
#include <stdbool.h>
#include "inc/hw_memmap.h"
#include "inc/hw_types.h"
#include "driverlib/debug.h"
#include "driverlib/sysctl.h"
#include "driverlib/gpio.h"
#include "driverlib/adc.h"

int main(void)
{
uint32_t ui32ACCValues[4];
volatile uint32_t ui32AccX;
volatile uint32_t ui32AccY;
volatile uint32_t ui32AccZ;
SysCtlClockFreqSet((SYSCTL_XTAL_25MHZ | SYSCTL_OSC_MAIN | SYSCTL_USE_PLL | SYSCTL_CFG_VCO_480), 120000000);
SysCtlPeripheralEnable(SYSCTL_PERIPH_ADC0);
SysCtlPeripheralEnable(SYSCTL_PERIPH_GPIOE);
ADCHardwareOversampleConfigure(ADC0_BASE, 64);

GPIOPinTypeADC(GPIO_PORTE_BASE, GPIO_PIN_0 | GPIO_PIN_1 | GPIO_PIN_2 );

ADCSequenceConfigure(ADC0_BASE, 1, ADC_TRIGGER_PROCESSOR, 0);
ADCSequenceStepConfigure(ADC0_BASE, 1, 0, ADC_CTL_CH3);
ADCSequenceStepConfigure(ADC0_BASE, 1, 1, ADC_CTL_CH2);
ADCSequenceStepConfigure(ADC0_BASE, 1, 2, ADC_CTL_CH1|ADC_CTL_IE|ADC_CTL_END);
ADCSequenceEnable(ADC0_BASE, 1);
while(1)
{
ADCIntClear(ADC0_BASE, 1);
ADCProcessorTrigger(ADC0_BASE, 1);
while(!ADCIntStatus(ADC0_BASE, 1, false))
{
}
ADCSequenceDataGet(ADC0_BASE, 1, ui32ACCValues);
ui32AccX = ui32ACCValues[0];
ui32AccY = ui32ACCValues[1];
ui32AccZ = ui32ACCValues[2];
}
}

PS- this is the code from CLP-workbook, Creating IoT Solutions with the
                                                                  Tiva® C Series Connected LaunchPad
                                                                  Workshop

  • Now I want to keep the values of the potentiometer continously updating without using the breakpoint.

    I assume you want the expressions view to continuously show the value of the ui32AccX, ui32AccY and ui32AccZ variables. These variables are on the stack in the main function. I.e. these variables are only in "scope" when the program is paused in the main function, and so when the program is running the CCS debugger won't be able to resolve the address of the variables.

    Try making ui32AccX, ui32AccY and ui32AccZ variables global. I.e.:

    uint32_t ui32AccX;
    uint32_t ui32AccY;
    uint32_t ui32AccZ;
    
    int main(void)
    {
        uint32_t ui32ACCValues[4];
        SysCtlClockFreqSet((SYSCTL_XTAL_25MHZ | SYSCTL_OSC_MAIN | SYSCTL_USE_PLL | SYSCTL_CFG_VCO_480), 120000000);