I have a problem with the compiled program. The memory of the microcontroller is full. What would you recommend instead of a PIC16F1938 with more memory so that the PIN outputs matches the same functions.
Error: First page of program memory is full, please reduce size of Main and Interrupt routines
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Turn #option explicit on, as you have many variables types that are not defined.
And, resolve these warnings - NOWx should be defined as a Bit or Byte, or test NOWx.0 to test the bit.
Warning: Comparison will fail if NOW3 is any value other than 0 or 1
Warning: Comparison will fail if NOW1 is any value other than 0 or 1
Warning: Comparison will fail if NOW2 is any value other than 0 or 1
And, you have some weird coding that may not work as you planned. There are a few places where you need to sort.
if now3>_prev3 then mode++:set_amps=0:set_duty=255
As NOWx is undefined. But, you set NOW3 !button_menu. So, it safe to assume NOW3 is a bit, but then you compare now3 > prev3 (where is undefined,so a byte)... so the greater than test is not really valid. But, as I do not know the logic of all this.. I cannot correct.
Last edit: Anobium 2020-12-31
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I have a problem with the compiled program. The memory of the microcontroller is full. What would you recommend instead of a PIC16F1938 with more memory so that the PIN outputs matches the same functions.
Error: First page of program memory is full, please reduce size of Main and Interrupt routines
If the page is full... then, cut the large sub routines into small subroutines.
But, if that does not help then these are your only options with 32 KWords of Progmem but the page size is the same...
PIC16F18857 - Great Cow BASIC supported
PIC16F15214 - not supported yet.
But, you should use the
PIC18F27K42 - Great Cow BASIC supported - memory is flat so the page limit does not exist. And, you should be able to test compile to verify this.
Evan
Analysis
Last edit: Anobium 2020-12-30
18f Analysis
Last edit: Anobium 2020-12-30
I replaced the microcontroller, another message appeared
i replaced the microcontroller but the code remained the same.
But, I just downloaded and I cut a section out of your main code. created a sub of the code. Any now it fits in the 1938.
See attached.
Keep creating subs....
super... simple... thanks!
You should... some advice.
Turn #option explicit on, as you have many variables types that are not defined.
And, resolve these warnings - NOWx should be defined as a Bit or Byte, or test NOWx.0 to test the bit.
Warning: Comparison will fail if NOW3 is any value other than 0 or 1
Warning: Comparison will fail if NOW1 is any value other than 0 or 1
Warning: Comparison will fail if NOW2 is any value other than 0 or 1
And, you have some weird coding that may not work as you planned. There are a few places where you need to sort.
if now3>_prev3 then mode++:set_amps=0:set_duty=255
As NOWx is undefined. But, you set NOW3 !button_menu. So, it safe to assume NOW3 is a bit, but then you compare now3 > prev3 (where is undefined,so a byte)... so the greater than test is not really valid. But, as I do not know the logic of all this.. I cannot correct.
Last edit: Anobium 2020-12-31
The program works OK :) I once, long ago in other projects where I use a front detector, I tried to define NOWx as a bit, then it didn't work ...
No problem.
Good to see you are making progress!