ROM FULL

For Flowcode users to discuss projects, flowcharts, and any other issues related to Flowcode 5.
To post in this forum you must have a registered copy of Flowcode 5 or higher.

Moderator: Benj

Post Reply
User avatar
JLeith
Posts: 537
Joined: Wed Nov 14, 2012 7:49 pm
Location: British Columbia Canada
Has thanked: 146 times
Been thanked: 26 times
Contact:

ROM FULL

Post by JLeith »

Hello,
I must be under a Black Cloud....

I was trying to see if I can take my code for the Scoreboard and try to load it into the PIC16F1826 and I have reach the cliff edge with another mile stone.

ROM Size Error - I'm not sure how to address this size issue - Do I need to delete code or do I find a new chip ?
Rom Error.jpg
Rom Error.jpg (21.27 KiB) Viewed 3405 times
i hope I can find a fix because I believe I have to add a few lines of Code outside of Flowcode and this might cause me problems.

Can anyone help explain my fix to this issue ?

John

User avatar
Enamul
Posts: 1772
Joined: Mon Mar 05, 2012 11:34 pm
Location: Nottingham, UK
Has thanked: 271 times
Been thanked: 814 times
Contact:

Re: ROM FULL

Post by Enamul »

Hi John
You have overfilled the PIC memory and it has two solutions one is to use same pin-configuration PIC with large memory (easy but money consuming solution); the other is to customize the code to fit in the memory but that will be bit tough as 24% extra bit you have to modify or removed. So you can now choose which one you like to do..
Enamul
University of Nottingham
enamul4mm@gmail.com

User avatar
JLeith
Posts: 537
Joined: Wed Nov 14, 2012 7:49 pm
Location: British Columbia Canada
Has thanked: 146 times
Been thanked: 26 times
Contact:

Re: ROM FULL

Post by JLeith »

Thank you, Enamul

I was afraid that might be the case. Enamul can you recommend a new DIP18 chip it might be easier seeing I have the PCB being made for the PIC16F1826 ?

I will have a look at the program and see hat I can do.

Is there a way to see how much memory is in use ?

What else can go wrong with my project.

John

medelec35
Matrix Staff
Posts: 9520
Joined: Sat May 05, 2007 2:27 pm
Location: Northamptonshire, UK
Has thanked: 2585 times
Been thanked: 3815 times
Contact:

Re: ROM FULL

Post by medelec35 »

Hi John,
If you go to:
http://www.microchip.com/maps/Microcontroller.aspx

You can select 18pins min and maximum:
more mem1.png
(3.4 KiB) Downloaded 1688 times
Then following microcontrollers will be displayed:
more mem2.png
(47.01 KiB) Downloaded 1688 times
As you can see the order shown is in order of memory size.
The only way of know how much memory code uses is do what you have already done..
Compile to hex.
Then rom usage is displayed as you have highlighted.
Just remember to divide value of rom shown by 1024 to convert to kbytes.
Taking your Flowchart and an example: ROM used = 2539.
= 2539/1024= 2.48K
According to datasheet for your device ROM =2K
Therefore you will require a ROM size of 4K minimum (Kwords).

There are ways of reducing code. E.g use local variables. Place frequently used calculations within a macro and so each time calculation is required, just use call macro function.
use a Temp variable for several comparisons.
instead of oldVar1= NewVar1
NewVar1 = input
If oldVar1 <> NewVar1 then variable has changed.

oldVar2= NewVar2
NewVar2 = input
If oldVar2 <> NewVar2 then variable has changed.

Use:
Temp= NewVar1
NewVar1 = input
If Temp <> NewVar1 then variable has changed.

Temp= NewVar2
NewVar2 = input
If Temp <> NewVar2 then variable has changed

Etc.

Use as small variable as you can get away with.
E.g. if variable is always going to be between 0 and 100, don't use INT use bytes instead.

Martin
Martin

User avatar
JLeith
Posts: 537
Joined: Wed Nov 14, 2012 7:49 pm
Location: British Columbia Canada
Has thanked: 146 times
Been thanked: 26 times
Contact:

Re: ROM FULL

Post by JLeith »

Hello Martin,

This information is like finding the pot of gold at the end of the rainbow.
Pot of Gold.jpg
Pot of Gold.jpg (1.96 KiB) Viewed 3371 times
I was on the Digkey site trying to find a chip I did not try Microchip. I will follow your information and see if I need a new chip.

I have been trying to strip down and redesign my project and see if I can get it to fit.

So I suspect this coming week between setting up for Xmas I will be trying to clean up my code.

I see the heavy part is sending out the display. I was reading over the OLD design and they used a Table for On state and a Table for off state but in "C' it use the IF then and I think it takes a little more RAM.

Martin seeing I have switches and Led in the Project Panel does that add into the RAM calculation for HEX ?

Thank you,
John

Post Reply