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.

problem in using CCS memory browser

I am learning the piccolo series DSC with F28069 and trying the ADC temperature sensor conversion functions.

But there is a problem when using the CCS memory browser.

In the int16 GetTemperatureC(int16 sensorSample) function,  getTempOffset() and getTempSlope() can be used to get data in ROM.

// The folloing pointers to function calls are:
//Slope of temperature sensor (deg. C / ADC code). Stored in fixed point Q15 format.
#define getTempSlope() (*(int (*)(void))0x3D7E82)()
//ADC code corresponding to temperature sensor output at 0 deg. C
#define getTempOffset() (*(int (*)(void))0x3D7E85)()

I check the return values of getTempOffset() and getTempSlope(),

int16 GetTemperatureC(int16 sensorSample)
{
slope = getTempSlope();
offset = getTempOffset();
return ((sensorSample - getTempOffset())*(int32)getTempSlope() + FP_ROUND + KELVIN_OFF)/FP_SCALE - KELVIN;
}

the values are as shown below:

in the expression window,the slope is 5568, namely 0x15c0;the offset is 1664, namely 0x680.

But when I use the memory browser to get the data, I get different values.

I notice that the next value after the selected one should be the right value.

Is there something wrong with my operation?

Sorry for my poor English.

thanks and regards

Di

  • Di,

    What you are seeing is normal. Keep in mind that the #define'd addresses are used with pointers to functions, not variables. The additional words that you see are op-codes related to function operations.

    -Tommy

  • hi,

      Tommy!

      Thanks for your kind help.

      But I am still confused about this problem.

      From the F28069 Technical Reference Manual I get that:

    Does it mean the slope and offset data can be read directly with a pointer? 

    I don't know why the example uses a function pointer.

    I am looking forward to your reply.

    best regards.

    Di

  • ok!!!!!!!!!!
    I know the truth is that I didn't read the datasheet carefully.
    The function pointer is pointed to a function!
    use the stored slope and offset calibrated per device in the factory which can be extract by a function at the following locations!!
    So there is a function called and then it return the right value...