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