Home
Prox / RFID
Verichips
Ladder Logic
[interfacing] †
Tube Joints
Key Code From Photo
SolveSpace (3d CAD)
SketchFlat (2d CAD)
Photographs
Miscellany
Resume / Consulting
Contact Me

LDmicro Forum - How much swap space does program require

(you are viewing a thread; or go back to list of threads)

How much swap space does program require (by Evan Raftery)
On programming a PIC16F876, after the compiled file size reached 88% of program memory. LDMicro reported that file size had been exceeded and a bigger micro should be chosen. Is there any way to tell how many registers can be addressed before file size is exceeded. Also a similar message came up that file name was too large even though it had been used elsewhere in program. Problem was solved by shortening the register name in all locations
Wed Oct 14 2009, 05:41:47, download attachment Ag_9X_Controller.ld
(no subject) (by Jonathan Westhues)
That reported 88% is of the program memory (flash), not the data memory (RAM). It is not related to how many integer or bit variables are in use.

There is no easy way to calculate ahead of time how much will fit, since it depends on how the program interacts with the PIC16's paging scheme. With AVRs, it's easier to calculate that.

The limit on the length of variable names is just for cosmetic purposes, so that it fits within the available space to draw an instruction.

There's no really good way to find the minimum of n variables. The attached version is ugly, but it's shorter and faster than your version.
Wed Oct 14 2009, 11:47:45, download attachment min.ld
Thanks (by Evan Raftery)
Thankyou for the clarification.
I like your version very fast.
The method I was using was to create a cascade of values of minimum to maximum. The goal is the number outputs is turned on according to flow rate. Low flow means few outpute while high flow means more.
Each output is timed to record time on. As the time on each output increases every time it is turned on then the next time they are turned on the program looks for the outputs that have minimum values to select first. Example if 8 outputs are selected then the 8 with lowest values are loaded. The next time the unit is turned on if say ouutputs are turned on the program will search for the 4 lowest values and so on. (The utputs are controlling micro fluid pumps).
It is complicated and will have to use a micro with more memory. I'll keep trying & post the results.
Wed Oct 14 2009, 16:26:10
Post a reply to this comment:
Your Name:
Your Email:
Subject:
(no HTML tags; use plain text, and hit Enter for a line break)
Attached file (if you want, 5 MB max):