Update README with current code sizes.
[avr_serial_lcd.git] / README
1 AVR SERIAL_LCD C/C++ PROJECT\r
2 Kevin M. Rosenberg <kevin@rosenberg.net>\r
3 AVRFreaks.net member kmr\r
4 =====================================================================\r
5 \r
6 The home for this project is http://www.avrcode/serial_lcd/\r
7 \r
8 This is my version of AVR code to drive the Serial Backpack\r
9 Project created by Carl W. Livingston. I've rewritten the original\r
10 firmware to add a number of features, add compatibility for IAR and\r
11 GCC, and well as create two different C++ version.\r
12 \r
13 This project is also used to demonstrate how C code can be turned\r
14 into C++ classes and to view the resulting differences in assembly\r
15 output.\r
16 \r
17 There are two versions of the C++ code: serial_lcd.cpp (which\r
18 generates output files with the prefix serial_lcd_cpp) and\r
19 serial_lcd_obj.cpp (generates output files with the prefix\r
20 serial_lcd_obj).\r
21 \r
22 The first C++ variant is designed to be "equivalent" to the C code in\r
23 that the same inlining of functions were used. Also, the C++ classes\r
24 were only to segment functions. No C++ class object contents member\r
25 variables. The global variables in the C code remain global in the C++\r
26 code. Primarily, because these variables are stored in CPU and IO\r
27 registers for greater efficiency. Other variables, like the UART\r
28 circular buffer, remain in global memory space so its address is known\r
29 at compile time and spare the address computation required if the\r
30 variable was a member of a C++ object.\r
31 \r
32 The second C++ variant uses classes that contain member variables and\r
33 to which initialization parameters are sent. In this way, multiple\r
34 objects of that class can be created. As an example, for connecting 2\r
35 LCD panels or multiple LED PWM outputs.\r
36 \r
37 The code can be modified and redistributed as governed by the terms of\r
38 the accompaning LICENSE file.\r
39 \r
40 \r
41 Code/Data Sizes (for 20080316 release)\r
42 ======================================\r
43 \r
44 Compiler    Code  Data  Notes\r
45 ---------   ----  ----  -----\r
46 AVR-GCC C    718    48  -Os\r
47 AVR-GCC C++  806    50  -Os\r
48 AVR-GCC Obj 1574    72  -Os\r
49 IAR C        622    48  Size optimization high (+ 64 bytes stack)\r
50 IAR C++      762    49  Size optimization high (+ 64 bytes stack)\r
51 IAR Obj     1112    65  Size optimization high (+ 63 bytes stack)\r
52 ICC7 C       818    48  Full optimizations\r
53 \r
54 I would appreciate submissions of suggestions, improvements, or bug\r
55 fixes.\r