Regards
Karan Soin
Code: Select all
#define VREF 2.45
#define R1_VBAT 100000L
#define R2_VBAT 100000L
#define R1_POWER_IN 1500000L
#define R2_POWER_IN 100000L
#define R1_VCC 180000L
#define R2_VCC 150000L
#define R1_CURRENT 8200L
#define R2_CURRENT 10000L
#define SENSITIVITY 0.066
.
.
.
.
Code: Select all
unsigned int CURRENT_RAW;
unsigned int VBAT_RAW;
unsigned int POWER_VOLTAGE_RAW;
unsigned int VCC_VOLTAGE_RAW;
float CURRENT;
float VBAT;
float POWER_VOLTAGE;
float VCC_VOLTAGE;
(Following fragment is the trouble creator part of the code. Disabling this, the project compiles fine)
Code: Select all
VBAT = ( ( VBAT_RAW / 1024.0 ) * VREF ) * ( ( R1_VBAT + R2_VBAT ) / R2_VBAT );
POWER_VOLTAGE = ( ( POWER_VOLTAGE_RAW / 1024.0 ) * VREF ) * ( ( R1_POWER_IN + R2_POWER_IN ) / R2_POWER_IN );
VCC_VOLTAGE = ( ( VCC_VOLTAGE_RAW / 1024.0 ) * VREF ) * ( ( R1_VCC + R2_VCC ) / R2_VCC );
CURRENT = ( ( CURRENT_RAW / 1024.0 ) * VREF ) * ( ( R1_CURRENT + R2_CURRENT ) / R2_CURRENT ) / SENSITIVITY;
Code: Select all
0 1 mikroCdsPIC.exe -MSF -DBG -pP24FJ256GB106 -C -DL -SSA -O11111114 -fo32 -N"I:\Projects\Coulomb Counter\Firmware\MyProject.mcpds" -SP"C:\Users\Public\Documents\Mikroelektronika\mikroC PRO for dsPIC\Defs\" -SP"C:\Users\Public\Documents\Mikroelektronika\mikroC PRO for dsPIC\Uses\" -SP"I:\Projects\Coulomb Counter\Firmware\" -IP"I:\Projects\Coulomb Counter\Firmware\" "Coulomb Counter.c" "RTC.c" "__Lib_Math.mcl" "__Lib_MathDouble.mcl" "__Lib_System.mcl" "__Lib_Delays.mcl" "__Lib_CType.mcl" "__Lib_CString.mcl" "__Lib_CStdlib.mcl" "__Lib_CMath.mcl" "__Lib_Conversions.mcl" "__Lib_Sprintf.mcl" "__Lib_Time.mcl" "__Lib_Sound.mcl" "__Lib_ADC_1_p24FJ256_GA_GB_110.mcl" "__Lib_I2C_123_p24fj.mcl" "__Lib_UART_1234_p24_p33.mcl" "__Lib_PPS_p24FJ256_GA_GB_110_DPC64B.mcl" "__Lib_LcdConsts.mcl" "__Lib_Lcd.mcl"
0 121 Loading...
0 122 Compilation Started def.h
99 1163 Variable 'i' has been declared, but not used Coulomb Counter.c
100 1163 Variable 'c' has been declared, but not used Coulomb Counter.c
101 1163 Variable 'dec' has been declared, but not used Coulomb Counter.c
208 123 Compiled Successfully Coulomb Counter.c
108 1164 Variable 'VCC_VOLTAGE_RAW' has been eliminated by optimizer Coulomb Counter.c
208 324 Undeclared identifier '__long2float' in expression Coulomb Counter.c
208 324 Undeclared identifier '__div_fp' in expression Coulomb Counter.c
208 324 Undeclared identifier '__mul_fp' in expression Coulomb Counter.c
208 324 Undeclared identifier '__mul_fp' in expression Coulomb Counter.c
208 324 Undeclared identifier '__long2float' in expression Coulomb Counter.c
208 324 Undeclared identifier '__div_fp' in expression Coulomb Counter.c
208 324 Undeclared identifier '__mul_fp' in expression Coulomb Counter.c
208 324 Undeclared identifier '__mul_fp' in expression Coulomb Counter.c
208 324 Undeclared identifier '__long2float' in expression Coulomb Counter.c
208 324 Undeclared identifier '__div_fp' in expression Coulomb Counter.c
208 324 Undeclared identifier '__mul_fp' in expression Coulomb Counter.c
208 324 Undeclared identifier '__mul_fp' in expression Coulomb Counter.c
208 324 Undeclared identifier '__long2float' in expression Coulomb Counter.c
208 324 Undeclared identifier '__div_fp' in expression Coulomb Counter.c
208 324 Undeclared identifier '__mul_fp' in expression Coulomb Counter.c
208 324 Undeclared identifier '__div_fp' in expression Coulomb Counter.c
0 122 Compilation Started def.h
191 1163 Variable 'rawtime' has been declared, but not used RTC.c
192 1163 Variable 'timeinfo' has been declared, but not used RTC.c
424 123 Compiled Successfully RTC.c
126 1164 Variable 'epoch' has been eliminated by optimizer RTC.c
189 1164 Variable 'BCD_ss' has been eliminated by optimizer RTC.c
0 102 Finished (with errors): 25 Jan 2016, 06:26:06 MyProject.mcpds