NOTE: mostly obsolete, useless for normal users.
Might be partially useful for developers.
Search for keywords in http://www.vems.hu/wiki/

***** Software requirements *****

To compile the firmware, the following software is needed:
- AVR-GCC
- gmake
- AVR-libc
- Perl interpreter
- svn (NOT cvs; optional, used to get the newest firmware)

To program the AVR, uisp or avrdude (Linux or windows) can be used.
See http://www.vems.hu/wiki/index.php?page=GenBoard%2FFirmware%2FUpload

***** Preparation of the code *****

The firmware can be customized to your own needs, this must be done
at the first compilation.

1) [my_make]
my_make is used for specifying which part of the firmware are
enabled (lcd-display, ps2-keyboard etc.)
Copy the sample file from doc/my_make to the firmware directory and
edit it to suit your requirements.

2) [etc]
Make a directory "etc" in the firmware directory. This directory will
be used to store files specific to your configuration

3) [sensor calibration]
See http://www.vems.hu/wiki/index.php?page=EasyTherm for how to change
after the firmware was compiled.
Before the firmware can be compiled, you should create sensor
calibration files for the MAP, MAT and CLT sensor.
These files are generated in the same way as in the MegaSquirt. Make
an *.inc file for the sensor (have a look in the MS faq for more
details than given here):

Measure the resistance of the MAT/CLT a 0, 25 and 100 degress C.
Download the mstools program from 
http://www.geocities.com/perboddum/megasquirt.html
and generate the inc-file.
The inc-file can be converted to a c-file with this command:
perl bin/inc2tbl NAME-OF-THE-MAT-INC-FILE > etc/airdenfactor.c
perl bin/inc2tbl NAME-OF-THE-CLT-INC-FILE > etc/thermfactor.c

If you use a Motorola MAP sensor just copy barofac4115.c,
barofac4250.c, kpafactor4115.c and kpafactor4250.c to the etc directory.

4) [configuration files]
This is not needed now, but if you want the mtt-files to be
autogenerated upon a "make mtt" command, place the config.txt and
tables.txt files in the etc directory as well.

etc/tables.txt
etc/config.txt

***** Compilation and programming of the AVR *****

1) [bootloader]
See http://www.vems.hu/wiki/index.php?page=BootLoader
To compile the bootloader, enter the "boot" directory and type "make".
Then start your programming software and set the fuses to:
fuse low byte = 0x2f
fuse high byte = 0xc4
fuse extended byte = 0xff
lock bits = 0xef
NOTICE: A fuse is active when set to zero (ex: 0xFE means only fuse
bit 0 is set)

Finally program the AVR with the file "main.hex" (the bootloader)

2) [firmware]
To compile the firmware, type make in the firmware directory.
Then the vems.hex must be downloaded to the AVR through the
bootloader (remember the rs232 cable), type
perl bin/prog.pl vems.hex Etw

(type "perl bin/prog.pl" to see the options, also read the bootloader
section in the wiki)

Only this step is needed on a second compilation (ex. after
downloading new firmware from svn)
