As mentioned on another thread, I modified microcarl's excellent My_LCD code to add significant features. I'm attaching my version of the firmware for his My_LCD Serial Backpack project to this message.
Of other importance is that I'm attaching a C++ port that compiles under AVR-GCC and IAR. Additionally, I posted results of resulting code sizes. Below is a copy of the README file from the .zip file:[code]This is my version of AVR code to drive the My_LCD Serial Backpack
Project as created by Carl W. Livingston. There are a number of
improvments as detailed in the CHANGES file.
Additionally, this project is used to demonstrate how C code can be
turned into equivalent C++ classes and to view the resulting
differences in assembly output. The C++ classes are considered
"equivalent" to the C code in that the same inlining of functions were
used. Also, the C++ classes were only to segment functions. No C++
class object contents member variables. The global variables in the C
code remain global in the C++ code. Primarily, because these variables
are stored in CPU and IO registers for greater efficiency. Other
variables, like the UART circular buffer, remain in global memory
space so its address is known at compile time and spare the address
computation required if the variable was a member of a C++ object.
At this point, the C++ objects could be turned into isolated objects
with their own member variables and having more isolated
initialization of global IO registers. This would be essential if they
were to be used in some sort of AVR C++ library. However, the C++ code
is already larger than the C code and both code-size and run-time
efficiency would be negatively impacted by this change. This might not
be an issue for a larger AVR, but this project targets the ATTiny2313
with only 2K of flash memory and 128 bytes of SRAM.
The code can be modified and redistributed as governed by the terms of
the accompaning LICENSE file.
Code/Data Sizes (for 20071230 release)
Compiler Code Data Notes
--------- ---- ---- -----
AVR-GCC C 744 48 -Os
AVR-GCC C++ 910 53 -Os
IAR C 664 48 Size optimization high
IAR C++ 896 50 Size optimization high
ICC7 824 48 Full optimizations
Edit: I've deleted the posted code since I've moved hosting of the project to http://www.avrcode.com/serial_lcd/