Out of variable space
LanceM
Posts: 5
I'm sure this is a common problem and I apologize if it has been covered a thousand times. I did do a search first and didn't find anything. I'm working on a temperature controller for a kiln. I have a DS2760 Thermocouple Kit and DS1302 Timekeeping Chip both of which I have working, but not at the same time. I'm planning to switch a thyristor to actually switch the power to the kiln on and off.
The problem is that just trying to put together a program that does both temperature and time I run out of variable space. I'm using a BS2PX. I'm starting with the example code that came with the DS2760 and DS1302 and the code is Bit and Nib where possible. What else can I do to permit myself more variable space? Do I need to add an EEPROM to the hardware and use that for storage?
Thanks for any suggestions,
Lance
The problem is that just trying to put together a program that does both temperature and time I run out of variable space. I'm using a BS2PX. I'm starting with the example code that came with the DS2760 and DS1302 and the code is Bit and Nib where possible. What else can I do to permit myself more variable space? Do I need to add an EEPROM to the hardware and use that for storage?
Thanks for any suggestions,
Lance
Comments
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
- Stephen
Lance,
Although the BS2 doesn't have a huge amount of variable space, it is hard to believe you used it up on a kiln. There is a lot of ways to optimize code, so it is hard to say the best method.
I personally would go back through my code to see what different ways I could change it to save space. Then you could possibly look at expanding the memory if you still do not have enough.
James L
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
James L
Partner/Designer
Lil Brother SMT Assembly Services
Are you addicted to technology or Micro-controllers..... then checkout the forums at Savage Circuits. Learn to build your own Gizmos!
Lance
For one thing, "Sign" shouldn't be a 'word', it should be a 'bit' variable.
Personally, I like using a few "Temp1 VAR WORD: Temp2 VAR WORD" variables. Then set Temp1 and Temp2 to whatever input value is needed for a subroutine, and return results in Temp1 and Temp2, then reduce the data to a single result as early as possible, and keep that.
For instance, "Read_Vin" is never called -- but if it was, keeping a variable around called "vIn" might or might not be needed -- the subroutine could use a 'word' variable called Temp1 to get the value.
Post Edited (allanlane5) : 1/4/2010 8:56:50 PM GMT
Thanks,
Lance