RESOLVED: Use GCB ADC Optimisation to reduce code generated
I needed to check a program written and compiled with a previous version of the compiler (0.98.04 2018-10-20) which did not cause any problems during compilation.
I recompiled the same source with the latest version but it gave me an insufficient memory problem.
Not bad because I installed and recompiled with the old compiler, but I preferred to report the problem.
13:22:03 G+Stool started with parameter 'hex' -> processing C:\programmi\GCB@Syn\G+Stools\makeHEX.bat
Source-File = H:\Sorgenti Programmi Microcontrollori\Sorgenti programmi GCBASIC\Controllo fancoil (prova)\ControlloFanCoil_LCD_16F1847_DS3231_vers2d_OK.gcb
Target-File = H:\Sorgenti Programmi Microcontrollori\Sorgenti programmi GCBASIC\Controllo fancoil (prova)\ControlloFanCoil_LCD_16F1847_DS3231_vers2d_OK.hex
Compiler Version (YYYY-MM-DD): 0.98.04 2018-10-20 (Windows 32 bit) Program Memory: 8021/8192 words (97,91%) RAM: 313/1024 bytes (30,57%) Chip: 16F1847
Duration: 11.8 Seconds.
13:31:03 G+Stool started with parameter 'hex' -> processing C:\programmi(x86)\GCB@Syn\G+Stools\makeHEX.bat
Source-File = W:\Sorgenti Programmi Microcontrollori\Sorgenti programmi GCBASIC\Controllo fancoil (prova)\ControlloFanCoil_LCD_16F1847_DS3231_vers2d_OK.gcb
WARNINGs / ERRORs reported by Great Cow BASIC (if Syntax Error, doubleclick on the errormessage below) <<<
Error: Program is too large, cannot fit all subroutines into available program memory
Duration: 19.4 Seconds.
Last edit: Anobium 2019-11-04
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Thank you for your help.
I realized that the "ds3231.h" was not included in the compressed file I had attached.
Unfortunately, in compiling, even following your advice, I always get
"Error: Program is too large, cannot fit all subroutines into available program memory".
With the compiler version 0.98.04 this instead does not happen and the program is compiled without problems.
I enclose an archive containing all the files involved in the compilation, just unpack it in a folder and start the compilation from there ...
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Compiler Version (YYYY-MM-DD): 0.98.<<>> 2019-11-02 (Windows 32 bit) Program Memory: 7946/8192 words (97.0%) RAM: 310/1024 bytes (30.27%) OSC: , 32 Chip: 16F1847
And, I spotted this ERROR. The port assignment are incorrect. I have not checked the datasheet but I thiknk AN0 is the first one... and the others are ANx :-)
I have looked the root cause. The compiler improvements in the later version improves banksel selection and this adds just enough banksels to max the chip out.
The following code cannot be automatically place. 24 words...In the context of the improved stability.
;Subs that could not be automatically placed;It may be possible to manually locate them, but you should upgrade to a larger chip if possibleDSP_SIMBOLI;This sub size:4callDSP_LAMPAcallDSP_ANTENNAcallDSP_MOTgotoDSP_SOLE;********************************************************************************LCDWRITECHAR;This sub size:7bankselSYSLCDTEMPbsfSYSLCDTEMP,1bankselLCDCHARmovfLCDCHAR,WmovwfLCDBYTEpageselLCDNORMALWRITEBYTEgotoLCDNORMALWRITEBYTE;********************************************************************************SYSCOMPEQUAL;This sub size:6clrfSYSBYTETEMPXmovfSYSBYTETEMPA, WsubwfSYSBYTETEMPB, WbtfscSTATUS, ZcomfSYSBYTETEMPX,Freturn;********************************************************************************SYSCOMPLESSTHAN;This sub size:7clrfSYSBYTETEMPXbsfSTATUS, CmovfSYSBYTETEMPB, WsubwfSYSBYTETEMPA, WbtfssSTATUS, CcomfSYSBYTETEMPX,Freturn;********************************************************************************END
So, use OPTIMISATION and change the chip
Evan
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
If I use AN0 ... AN6 I have the following error that does not occur with version 0.98.04:
ControlloFanCoil_LCD_16F1847_DS3231_vers2d_OK.gcb (299): Error: PORT6 is not a valid I/O pin or port
ControlloFanCoil_LCD_16F1847_DS3231_vers2d_OK.gcb (300): Error: PORT5 is not
a valid I/O pin or port
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
The above statements are now ANx values. So, if you want to set the direction of the assiocated ports you need to add some more code.
' - Altri pins #Define PIN_TASTIERA AN0 'PORTA.0' AN0 Tastiera 6 tasti #Define P_TEMP_ARIA AN6'PORTB.7' AN6 Sensore lettura temperatura Aria #Define P_TEMP_ACQUA AN5'PORTB.6' AN5 Sensore lettura temperatura Acqua #Define PORT_PIN_TASTIERA PORTA.0 'AN0Tastiera6tasti#DefinePORT_P_TEMP_ARIAPORTB.7' AN6 Sensore lettura temperatura Aria #Define PORT_P_TEMP_ACQUA PORTB.6 'AN5SensoreletturatemperaturaAcqua............' - Imposta gli ingressi Dir PORT_PIN_TASTIERA In Dir PORT_P_TEMP_ARIA In Dir PORT_P_TEMP_ACQUA In'-
And, if I may advise. I would get off the chip you are using asap. As an architecture the 1847 is a dead end - 18 pin products are very very rare. 16F18855 series would be better
Enjoy,
Evan
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Thanks for your help.
For the moment I have solved the problem.
Certainly it is better to switch to another one, but of PIC16F1847 I have a certain number and I am sorry to leave them unused.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
RESOLVED: Use GCB ADC Optimisation to reduce code generated
I needed to check a program written and compiled with a previous version of the compiler (0.98.04 2018-10-20) which did not cause any problems during compilation.
I recompiled the same source with the latest version but it gave me an insufficient memory problem.
Not bad because I installed and recompiled with the old compiler, but I preferred to report the problem.
13:22:03 G+Stool started with parameter 'hex' -> processing C:\programmi\GCB@Syn\G+Stools\makeHEX.bat
Source-File = H:\Sorgenti Programmi Microcontrollori\Sorgenti programmi GCBASIC\Controllo fancoil (prova)\ControlloFanCoil_LCD_16F1847_DS3231_vers2d_OK.gcb
Target-File = H:\Sorgenti Programmi Microcontrollori\Sorgenti programmi GCBASIC\Controllo fancoil (prova)\ControlloFanCoil_LCD_16F1847_DS3231_vers2d_OK.hex
Compiler Version (YYYY-MM-DD): 0.98.04 2018-10-20 (Windows 32 bit) Program Memory: 8021/8192 words (97,91%) RAM: 313/1024 bytes (30,57%) Chip: 16F1847
Duration: 11.8 Seconds.
13:31:03 G+Stool started with parameter 'hex' -> processing C:\programmi(x86)\GCB@Syn\G+Stools\makeHEX.bat
Source-File = W:\Sorgenti Programmi Microcontrollori\Sorgenti programmi GCBASIC\Controllo fancoil (prova)\ControlloFanCoil_LCD_16F1847_DS3231_vers2d_OK.gcb
Last edit: Anobium 2019-11-04
Can you post the code?
OK.
The code is large...
Code does not compile following errors.
You are missing include statement?
The above error relates to the following code segements, respectively.
To get it to compile I had to place your .h file in my include folder and change the code as follows:
So, I can give you any advice as this has not compiled with these errors.
Thank you for your help.
I realized that the "ds3231.h" was not included in the compressed file I had attached.
Unfortunately, in compiling, even following your advice, I always get
"Error: Program is too large, cannot fit all subroutines into available program memory".
With the compiler version 0.98.04 this instead does not happen and the program is compiled without problems.
I enclose an archive containing all the files involved in the compilation, just unpack it in a folder and start the compilation from there ...
Not sure of the root cause, but, I would be using 98.06.
To resolve this do the following: Simply add the optimisation code
Compiler Version (YYYY-MM-DD): 0.98.<<>> 2019-11-02 (Windows 32 bit) Program Memory: 7946/8192 words (97.0%) RAM: 310/1024 bytes (30.27%) OSC: , 32 Chip: 16F1847
And, I spotted this ERROR. The port assignment are incorrect. I have not checked the datasheet but I thiknk AN0 is the first one... and the others are ANx :-)
I have looked the root cause. The compiler improvements in the later version improves banksel selection and this adds just enough banksels to max the chip out.
The following code cannot be automatically place. 24 words...In the context of the improved stability.
So, use OPTIMISATION and change the chip
Evan
Thanks
Then,
I have included the optimization file (OPTIMISATION.H) I have not received errors and it has been compiled correctly.
Regarding these lines:
If I use AN0 ... AN6 I have the following error that does not occur with version 0.98.04:
ControlloFanCoil_LCD_16F1847_DS3231_vers2d_OK.gcb (299): Error: PORT6 is not a valid I/O pin or port
ControlloFanCoil_LCD_16F1847_DS3231_vers2d_OK.gcb (300): Error: PORT5 is not
a valid I/O pin or port
That is correct. You need to resolve the error at the line indicated by the error line.
The above statements are now ANx values. So, if you want to set the direction of the assiocated ports you need to add some more code.
And, if I may advise. I would get off the chip you are using asap. As an architecture the 1847 is a dead end - 18 pin products are very very rare. 16F18855 series would be better
Enjoy,
Evan
Thanks for your help.
For the moment I have solved the problem.
Certainly it is better to switch to another one, but of PIC16F1847 I have a certain number and I am sorry to leave them unused.
I would bin them, they have so many constraints for you.
Anyway, you are up and running.
Enjoy.