new global_logger, used in AVR_LOG(), default is stdout/stderr
[simavr] / README.md
index 75da0ff..f146370 100644 (file)
--- a/README.md
+++ b/README.md
@@ -1,8 +1,8 @@
-simavr - lean and mean Atmel AVR simulator for linux
+simavr - lean and mean Atmel AVR simulator for linux
 ======
 
 _simavr_ is a new AVR simulator for linux, or any platform that uses avr-gcc. It uses 
-avr-gcc own register definition to simplify creating new targets for supported AVR 
+avr-gcc's own register definition to simplify creating new targets for supported AVR
 devices. The core was made to be small and compact, and hackable so allow quick 
 prototyping of an AVR project. The AVR core is now stable for use with parts 
 with <= 128KB flash, and with preliminary support for the bigger parts. The 
@@ -39,28 +39,28 @@ Emulated Cores (very easy to add new ones!)
 
 Extras:
 -------
-* _gdb_ support fully work (gdb server) including some pretty cool “passive modes”.
+* fully working _gdb_ support including some pretty cool “passive modes”.
 * There is also very easy support for “VCD” (Value Change Dump) that can be visualized 
-graphicaly as “waveforms” with tools like _gtkwave_ (see bellow).
+graphically as “waveforms” with tools like _gtkwave_ (see below).
 * There are a few examples of real life firmwares running on simavr, including OpenGL rendering of the display…
-* There is support _Arduino_, but no integration to the IDE
+* There is support for _Arduino_, but no IDE integration
 
-*Note:* a mailinglist/google group now exists 
+*Note:* a mailing list/google group now exists
 You can also join *#simavr* on Freenode for a very quiet IRC channel.
 
 VCD Support -- built in logic analyzer 
 -----------
-_simavr_ can output most of it's pins, firmware variables, interrupts and a few other
+_simavr_ can output most of its pins, firmware variables, interrupts and a few other
 things as signals to be dumped into a file that can be plotted using gtkwave for
 further, precise analysis.
 A firmware can contain instructions for _simavr_ to know what to trace, and the file is
 automatically generated.
 Example:
 
-`const struct avr_mmcu_vcd_trace_t _mytrace[]  _MMCU_ = {
-       { AVR_MCU_VCD_SYMBOL("UDR0"), .what = (void*)&UDR0, },  
-       { AVR_MCU_VCD_SYMBOL("UDRE0"), .mask = (1 << UDRE0), .what = (void*)&UCSR0A, }, 
-};`
+       const struct avr_mmcu_vcd_trace_t _mytrace[]  _MMCU_ = {
+               { AVR_MCU_VCD_SYMBOL("UDR0"), .what = (void*)&UDR0, },
+               { AVR_MCU_VCD_SYMBOL("UDRE0"), .mask = (1 << UDRE0), .what = (void*)&UCSR0A, },
+       };
 
 Will tell _simavr_ to generate a trace everytime the UDR0 register changes and everytime
 the interrupt is raised (in UCSR0A). The *_MMCU_* tag tells gcc that it needs compiling,
@@ -68,19 +68,20 @@ but it won't be linked in your program, so it takes literally zero bytes, this i
 section that is private to _simavr_, it's free!
 A program running with these instructions and writing to the serial port will generate
 a file that will display:
-`$ ./simavr/run_avr tests/atmega88_example.axf
-AVR_MMCU_TAG_VCD_TRACE 00c6:00 - UDR0
-AVR_MMCU_TAG_VCD_TRACE 00c0:20 - UDRE0
-Loaded 1780 .text
-Loaded 114 .data
-Loaded 4 .eeprom
-Starting atmega88 - flashend 1fff ramend 04ff e2end 01ff
-atmega88 init
-avr_eeprom_ioctl: AVR_IOCTL_EEPROM_SET Loaded 4 at offset 0
-Creating VCD trace file 'gtkwave_trace.vcd'
-Read from eeprom 0xdeadbeef -- should be 0xdeadbeef..
-Read from eeprom 0xcafef00d -- should be 0xcafef00d..
-simavr: sleeping with interrupts off, quitting gracefully`
+
+       $ ./simavr/run_avr tests/atmega88_example.axf
+       AVR_MMCU_TAG_VCD_TRACE 00c6:00 - UDR0
+       AVR_MMCU_TAG_VCD_TRACE 00c0:20 - UDRE0
+       Loaded 1780 .text
+       Loaded 114 .data
+       Loaded 4 .eeprom
+       Starting atmega88 - flashend 1fff ramend 04ff e2end 01ff
+       atmega88 init
+       avr_eeprom_ioctl: AVR_IOCTL_EEPROM_SET Loaded 4 at offset 0
+       Creating VCD trace file 'gtkwave_trace.vcd'
+       Read from eeprom 0xdeadbeef -- should be 0xdeadbeef..
+       Read from eeprom 0xcafef00d -- should be 0xcafef00d..
+       simavr: sleeping with interrupts off, quitting gracefully
 
 And when the file is loaded in gtkwave, you see:
 ![gtkwave](https://github.com/buserror-uk/simavr/raw/master/doc/img/gtkwave1.png)
@@ -103,16 +104,18 @@ ran on the hardware. The key here is to emulate the _parts_ or peripherals that
 are hooked to the AVR. Of course, you don't have to emulate the full hardware, you just
 need to generate the proper stimulus so that the AVR is fooled.
 
-HD77480 LCD Board Demo
+HD44780 LCD Board Demo
 ----------------------
-![lcd](https://github.com/buserror-uk/simavr/raw/master/doc/img/hd77480.png)
 
-This example board hooks up an Atmega48 to an emulated HD77480 LCD and display a running
+![lcd](https://github.com/buserror-uk/simavr/raw/master/doc/img/hd44780.png)
+
+This example board hooks up an Atmega48 to an emulated HD44780 LCD and display a running
 counter in the 'lcd'. Everything is emulated, the firmware runs exactly like this
 on a real hardware.
-![lcd-gtkwave](https://github.com/buserror-uk/simavr/raw/master/doc/img/hd77480.png)
 
-And this is a gtkwave trace of what the firmware is doing. You can zoom in, measure etc
+![lcd-gtkwave](https://github.com/buserror-uk/simavr/raw/master/doc/img/hd44780-wave.png)
+
+And this is a gtkwave trace of what the firmware is doing. You can zoom in, measure, etc
 in gtkwave, select trades to see etc.
 
 Quite a few other examples are available!