I looked thru the forum but did not find what I am looking for.
I am using a 16f946 and it contains 336 bytes of GPR
I use a lot of variables in one of my programs but have not reached 336. I have 112 total, based off looking at the asm file.
I have reached a point where my program just goes haywire when adding one more dim (word or byte) in. All I do is add it in like: Dim lock_temp as byte. If I remove or comment it out my program runs fine.
I do not get any errors when compiling and I have plenty of ram left in other page files locations. From my understandning CGB handles all the page file selects. Correct?
So not sure why I am not able to create anymore variables.
Am I missing something with CGB and multi paged GPR's?
2.2.1 GENERAL PURPOSE REGISTER
FILE
The register file is organized as 256 x 8 bits in the
PIC16F913/914, 352 x 8 bits in the PIC16F916/917 and
336 x 8 bits in the PIC16F946. Each register is accessed
either directly or indirectly through the File Select
Register (FSR) (see Section 2.5 “Indirect Addressing,
INDF and FSR Registers”).
Any MAGIC would be grand!
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I have seen arbitrary limits when using GCBasic. For example, in one program I ran into problems after 103 If statements. I did not see issues with variables in my programs yet, but I suspect there might be similiar issues. Not sure if the GCBasic needs more array space to be allocated or what???? In my case, I re-worked some sections to keep it under the 103 If statements.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Solution was, just worked on redoing all my variables and use temp ones over and over where possible instead of one for each action. Harder to follow in code but who cares if the program runs in the end.
This helped and I have about 95 variables in one of my projects and it works fine. As long as I do not go into another bank.
I had limited success with putting z_ in front of them, but at some point they start to push over into other banks still and thats when all hell breaks loose! Especially when doing math on them. I figure Hugh will get it all ironed out and 16F's will be back in busi. As some have I am now looking into moving to the 18F series so I no longer have to deal with any of the limitations that is, until I write some MONSTER code then I am sure they will popup again. But this is still better than writting all this in flat asm. Praise the Great CowB!
Mz
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I looked thru the forum but did not find what I am looking for.
I am using a 16f946 and it contains 336 bytes of GPR
I use a lot of variables in one of my programs but have not reached 336. I have 112 total, based off looking at the asm file.
I have reached a point where my program just goes haywire when adding one more dim (word or byte) in. All I do is add it in like: Dim lock_temp as byte. If I remove or comment it out my program runs fine.
I do not get any errors when compiling and I have plenty of ram left in other page files locations. From my understandning CGB handles all the page file selects. Correct?
So not sure why I am not able to create anymore variables.
Am I missing something with CGB and multi paged GPR's?
2.2.1 GENERAL PURPOSE REGISTER
FILE
The register file is organized as 256 x 8 bits in the
PIC16F913/914, 352 x 8 bits in the PIC16F916/917 and
336 x 8 bits in the PIC16F946. Each register is accessed
either directly or indirectly through the File Select
Register (FSR) (see Section 2.5 “Indirect Addressing,
INDF and FSR Registers”).
Any MAGIC would be grand!
I have seen arbitrary limits when using GCBasic. For example, in one program I ran into problems after 103 If statements. I did not see issues with variables in my programs yet, but I suspect there might be similiar issues. Not sure if the GCBasic needs more array space to be allocated or what???? In my case, I re-worked some sections to keep it under the 103 If statements.
Solution was, just worked on redoing all my variables and use temp ones over and over where possible instead of one for each action. Harder to follow in code but who cares if the program runs in the end.
This helped and I have about 95 variables in one of my projects and it works fine. As long as I do not go into another bank.
I had limited success with putting z_ in front of them, but at some point they start to push over into other banks still and thats when all hell breaks loose! Especially when doing math on them. I figure Hugh will get it all ironed out and 16F's will be back in busi. As some have I am now looking into moving to the 18F series so I no longer have to deal with any of the limitations that is, until I write some MONSTER code then I am sure they will popup again. But this is still better than writting all this in flat asm. Praise the Great CowB!
Mz