NEW: Learning electronics? Ask your questions on the new Electronics Questions & Answers site hosted by CircuitLab.
Microcontroller Programming » LCD library in EEPROM
September 03, 2012 by eminthepooh |
Hey guys, Seeing as how the LCD library header takes up about 45% of the 168's flash memory, I was wondering if there's any way to write the library to EEPROM, so that you can save program space in flash. Thank you, |
---|---|
September 03, 2012 by pcbolt |
@eminthepooh It's not really the LCD library that takes up the memory space, it is the "printf" family of functions. If you can get away with using just the Nerdkit LCD functions like "lcd_write_string()" and "lcd_write_int16()" and do all the formatting yourself, you can save some space. Using EEPROM space is much too valuable (and limited) for programming code. If you are able to use only the NK functions, you'd just have to comment out the following line from your makefile by putting a pound symbol in front of it:
|
September 04, 2012 by Ralphxyz |
What about using an external EEPROM? I suppose spped might be a issue. Ralph |
September 04, 2012 by Ralphxyz |
Sorry, I sometimes stutter. That should be
Ralph |
September 04, 2012 by Rick_S |
LOL at Ralph self correcting... Rick |
September 04, 2012 by eminthepooh |
Thank you very much PCBolt and Ralph for your suggestions. PCBolt was right, omitting printf family of functions reduced the size considerably. Thanks guys, |
September 04, 2012 by pcbolt |
@ eminthepooch - I should clarify one or two things about the statements I made above. First, if you comment out the line from your "Makefile", you can still use the "printf" functions but when the compiler sees you are using them it will link in the library code and make your finished uploaded file bigger (but not "as" big). This line...
...will link in the largest amount of code since it is using the floating point libraries "printf_flt" and "scanf_flt" (not their actual file names). There is a third option using this line instead...
... will link in a minimized library that is only good for integers and strings. I've used it before and sometimes it's a pain but it can do simple formatting. |
September 05, 2012 by Ralphxyz |
Well Rick, it's kinda slow around here, so I thought I'd throw in a English lesson with my correction. Ralph |
September 05, 2012 by Rick_S |
Wouldn't that be "an" English lesson... |
September 05, 2012 by Ralphxyz |
Damm |
Please log in to post a reply.
Did you know that a piezoelectric buzzer can be used in reverse as a microphone? Learn more...
|