I am running CCS 6.1 with motorware lab 5b on windows 7. I have added a Potentiometer to the board so I followed the steps given in hal tutorial PDF exactly. Once I finished coding, the POT code was being displayed when I hovered my mouse in the main c file. But once I started building I got Unresolved Symbols error.
The only difference is that, since I did not want to make changes in the original code, I copied the whole sw folder into my project folder and made the changes to those files. Here is my code:
in proj_lab5b.c
.
.....
// enable/disable automatic calculation of bias values
CTRL_setFlag_enableOffset(ctrlHandle,gMotorVars.Flag_enableOffsetcalc);
//Set the speed reference
//Measure POT position
gPotValue = HAL_readPotentiometerData (halHandle);
//Now since the value is between 0 and 1, multiply it with correct value to set min and max speed.
gMotorVars.SpeedRef_krpm = _IQmpy ((gPotValue & 0x00FF0000), _IQ(3.5));
......
In hal.c I added adc interrupts for the potentiometer and in hal.h I added the following function
static inline _iq HAL_readPotentiometerData(HAL_Handle handle)
{
HAL_Obj*obj=(HAL_Obj*)handle;
_iq value;
value = _IQ12toIQ((_iq)ADC_readResult(obj->adcHandle,ADC_ResultNumber_8));
return (value);
}
Any help would be greatly appreciated :-)