Chapter 4. The Software

Table of Contents

Firmware
Getting Support Software
Download and Install CVS
Download and Install WinAVR
Download and Install Perl
Getting the Firmware - Win32
Getting the Firmware - Posix
Compiling the Firmware
MY_MAKE File
Sensor Calibration
Uploading the Firmware to Genboard
Uploading Configuration and Table Files
Downloading Configuration and Table Files
Configuration
PC/PDA Interfacing

This chapter discusses a topic equally as important as hardware - software. Let’s recap. If you recall the code overview section in Chapter 2, you will remember that there are two basic areas – firmware and configuration. In Chapter 3, you saw the different ways you can connect a Genboard V.3 ECU to an engine. Also in Chapter 3, you connected your Genboard to a PC/PDA. In this chapter, we will show you how to configure your ECU through a PC/PDA to run your engine through a configuration file.

Firmware

Getting Support Software

It is easiest to first download and install the support software, which includes WinAVR, CVS, and Perl. WinAVR is a compiler, or what breaks our human-readable commands to the processor down into something it can understand. WinAVR also includes a few utilities such as a shell (command line) and compression tools. Theses directions are written to include the use of these tools, however one can substitute a more familiar package if they choose to do so.

CVS, or Concurrent Version Systems, is a program that will download up to the minute updated software from the development site. It is very easy to use, but if you would rather manually download and uncompress a thrice-daily updated package, you can get the snapshot at: http://megasquirtavr.sourceforge.net/msavr_fw_snapshot.tar.gz

Perl is used to automatically synchronize some of the settings used when compiling the firmware. It is also used to automatically build the menu screens for the LCD display.

Download and Install CVS

The latest version of CVS is found at: http://www.cvshome.org/.

If you are looking for a binary (already compiled, you just uncompress and run it) file, look here: https://ccvs.cvshome.org/servlets/ProjectDocumentList?folderID=80&expandFolder=80&folderID=0. If you are having problems with CVS, you can always fall back to the snapshot.

Use the appropriate compression utility to uncompress the file downloaded from the CVS site, which should be a .zip file.

Download and Install WinAVR

The latest version of WinAVR is found at: http://sourceforge.net/projects/winavr, under Latest File Releases.

Once you have downloaded WinAVR, install it to your hard drive. If you are running a Microsoft operating system, you will need to reboot in order to run the shell.

Download and Install Perl

Most Posix operating systems (Unix, Linux, etc) come with Perl preinstalled. If you determine that you already have Perl installed, skip this step.

ActivePerl can be found at: http://www.activestate.com/Products/Download/Download.plex?id=ActivePerl. Download and install to your hard drive. Reboot after the installation is complete in order for changes to take effect. Perl does its work behind the scenes, but it is important to Genboard.

Getting the Firmware - Win32

To download the firmware source code using CVS:

  1. Click "Start", then "Run."

  2. Type cmd and press Enter.

  3. Change to the directory where CVS is located.

  4. Execute these commands:

    set CVSROOT=:pserver:anonymous@cvs.sourceforge.net:/cvsroot/megasquirtavr
    set HOME=c:
    cvs login (press Enter when prompted for password)
    cvs checkout firmware

This will create a directory under your current directory, indicated by the shell path. The firmware will be downloaded into that directory, which is called “\firmware” by default. If your command prompt says “c:\cvs”, the firmware will be located in c:\cvs\firmware.

Getting the Firmware - Posix

At a shell prompt, execute these commands:

cvs -d :pserver:anonymous@cvs.sourceforge.net:/cvsroot/megasquirtavr login
cvs -d :pserver:anonymous@cvs.sourceforge.net:/cvsroot/megasquirtavr co firmware

Compiling the Firmware

Before you compile the firmware, it needs to be configured for your setup. The configuration can be customized to your preferences and requirements by editing files and setting up the tables, all of which are located in the firmware/etc directory.

MY_MAKE File

The my_make file contains settings that affect the compilation of the firmware, such as keyboard access, LCD display functions, temperature units, and quite a few others. Most of the settings may be set correctly by default, but it is a good idea to look over this file and change anything you need to. WE SHOULD HAVE a reference to line-by-line commentary on the my_make file, or add more thorough descriptions and comments in the file, including options for each variable. The second option would be better because all the information is in one place.

Sensor Calibration

The configuration files (matfactor.inc, thermfactor.inc, and airdenfactor.inc) contain values for factory GM sensors. If you do not use these sensors, new files will need to be created with values for the sensors you will use. Fortunately, there is free program to help with this task, called MSToolsII. MSToolsII is available at: http://www.rovernet.net/asp/megasquirt.asp.

Each .inc file must be converted to a c file in order to work with Genboard. This is done with a conversion program included with the firmware source code. At the shell prompt, execute these commands:

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, copy barofac4115.c, barofac4250.c, kpafactor4115.c and kpafactor4250.c to the /etc directory from the /firmware/inc directory. This is the standard MAP sensor used on Genboard.

http://www.vems-group.org/wiki/index.php?page=GenBoard/InitialConfig for creating config.txt, some other pertinent information.

To actually compile the software:

  1. At a shell prompt, change to the firmware directory

  2. Type "make" and press Enter

Uploading the Firmware to Genboard

text here

Uploading Configuration and Table Files

text here

Downloading Configuration and Table Files

for backing up... text here