Programming warnings & memory usage
Posted: Wed Oct 07, 2020 3:08 pm
I have been working on a program for a 12F1501 and as the project gets bigger so does the program and data space that it uses - this is expected, I am surprised about how quickly they go up though with very little in the project so I am assuming the chip I am using has very little space.
One curiosity is the data space hit 100% and worked then continued to grow and my project is now almost complete and it is now 127.1% and still writing to the chip without issue and working, what is happening here?
I also have 4 warnings which I am assuming are related to the 4 PWMs I am using but unsure how to fix this.
The snip of the compiler message is below and I have attached my program in case you want to look though it and be appalled at the inefficient code - please feel free to edit and optimise.
Thanks
Ben
* From the data sheet, the 12F1501 has 1024 program memory flash words and 64 bytes of data SRAM *
. . . . .
using updated 32-bit floating-point libraries; improved accuracy might increase code size
Small.c: 785: (1257) local variable "_FCR_RETVAL" is used but never given a value (warning)
Small.c: 963: (1257) local variable "_FCR_RETVAL" is used but never given a value (warning)
Small.c: 1141: (1257) local variable "_FCR_RETVAL" is used but never given a value (warning)
Small.c: 1319: (1257) local variable "_FCR_RETVAL" is used but never given a value (warning)
. . .
Memory Summary:
Program space used 304h ( 772) of 400h words ( 75.4%)
Data space used 3Dh ( 61) of 30h bytes (127.1%)
EEPROM space None available
Data stack space used 0h ( 0) of 1h byte ( 0.0%)
Configuration bits used 2h ( 2) of 2h words (100.0%)
ID Location space used 0h ( 0) of 4h bytes ( 0.0%)
One curiosity is the data space hit 100% and worked then continued to grow and my project is now almost complete and it is now 127.1% and still writing to the chip without issue and working, what is happening here?
I also have 4 warnings which I am assuming are related to the 4 PWMs I am using but unsure how to fix this.
The snip of the compiler message is below and I have attached my program in case you want to look though it and be appalled at the inefficient code - please feel free to edit and optimise.
Thanks
Ben
* From the data sheet, the 12F1501 has 1024 program memory flash words and 64 bytes of data SRAM *
. . . . .
using updated 32-bit floating-point libraries; improved accuracy might increase code size
Small.c: 785: (1257) local variable "_FCR_RETVAL" is used but never given a value (warning)
Small.c: 963: (1257) local variable "_FCR_RETVAL" is used but never given a value (warning)
Small.c: 1141: (1257) local variable "_FCR_RETVAL" is used but never given a value (warning)
Small.c: 1319: (1257) local variable "_FCR_RETVAL" is used but never given a value (warning)
. . .
Memory Summary:
Program space used 304h ( 772) of 400h words ( 75.4%)
Data space used 3Dh ( 61) of 30h bytes (127.1%)
EEPROM space None available
Data stack space used 0h ( 0) of 1h byte ( 0.0%)
Configuration bits used 2h ( 2) of 2h words (100.0%)
ID Location space used 0h ( 0) of 4h bytes ( 0.0%)