ejberg.dk

Signal module home

Hardware

Software

Setup

Gallery



Software

To use this signal and brake module, you'll need to program the ATmega88 microcontroller. In order to do that, you'll need the software .hex file and the fuse settings found below. And you will also need a programmer. If you already uses AVR's for other stuff, you already have a programmer, probably the STK500 development board. This can easily be used for programming this module. Just connect STK500's ISP10PIN connector to the programming connector of this module. If you are using the original PCB layout, then pin 1 is facing the AVR. You will need AVR Studio 4.10 or newer to program the Mega88.
If you don't have any AVR programmer, then AVRDUDE 4.4.0 (or newer) should support the Mega88. It uses the parallel port with a few additional components to program the module. But I haven't tried it myself. I would like to hear about your experiences with it.
A third option that may be available at some time, is PonyProg from LancOS. It doesn't support the Mega88 right now (I am writing this early January 2005), but my guess is that it will come. The Mega88 is a very new controller, and support for it in various programmers out there will take some time.

The .hex file

german_signals.hex (updated 12. March 2005)

This is the software for the signal module. It is made for the various german signals, but can be used with many other signals as well. I may make other signals in the future (like a danish signal package).

Fuse settings

In addition to the software, the microcontroller will also need to have its fuses programmed properly. The fuses are used to configure the controller, so it knows the speed and type of oscillator, valid voltage level, and other thing like that. Programming some of these wrong can render the controller useless, without the possibility to recover it (unless you have the STK500 dev. Board and unsolder the controller to parallel program it).

These are the fuse settings I use for this module (remember, with an AVR, 0 means programmed/enabled, and 1 means unprogrammed/disabled):

BOOTSZ

00

Boot loader size (not used)

BOOTRST

1

Boot loader (inactive)

RSTDISBL

1

Disable reset pin (inactive)

DWEN

1

Debug wire (inactive)

SPIEN

0

SPI programming (enabled)

WDTON

1

Watchdog timer (inactive)

EESAVE

0

Preserve EEPROM while flashing new firmware (enabled)

BODLEVEL

100

Brown-out detection level 4.3V

CKDIV8

1

Divide clock by 8 (inactive)

CKOUT

1

Clock output on PORTB0 (inactive)

CKSEL

0111

External full-swing crystal (slow startup)

SUT

11

External full-swing crystal (slow startup)



Bug reports, suggestions and comments are welcome: Contact me here

Updated 24. April 2005