Configuring the BASCOM programmer

The AVR-SDK1 is a development board manufactured by micro-research. It is sold by companies such as Futurlec. The board is supplied with a parallel port programming cable. I was keen to use this board with BASCOM a popular AVR compiler. BASCOM has built in AVR programming software. However, none of the default configurations seemed to work with this board.

Fortunately, it is possible to add new boards to the list that BASCOM will support. Here is what to do.

These notes are based upon BASCOM Version - do make sure that you have the latest version installed.

Look in the directory where your BASCOM 'bascavr.exe' file lives. There will be a file in this directory called 'prog.settings'. This is a textfile. Open it with notepad and paste the following into the top of the file (after the block of comments).

BASE=$378 ;lpt1

Now save the file and exit notepad. The above assumes that the programming cable (supplied with the board) is connected to parallel port LPT1 on your PC.

Now, fire up BASCOM and use the 'Options,Programmer' menu item to configure the programmer. On the 'Programmer' dropdown at the top of the dialog box, choose 'Universal MSC Interface'. Then, on the 'Programmer' dropdown inside the 'Universal' tab, select 'AVR-SDK1'. Click 'OK' to save this config.

That's it.

Configuring the Xtal

The AVR-SDK1 board is fitted with an external 4MHz crystal. However, by default, a Mega8 chip is configured to use its inbuilt 1MHz oscillator. To have the board use its external xtal, we need to use the BASCOM programmer facility to modify the fuse bits. From the 'Lock and Fuse Bits' tab, select the option shown below for the 'Fusebit KLA987' setting.


Then press the 'Write FS' button.

Your board will now operate at 4MHz.

A test BASCOM program

Having setup the BASCOM programming facility and having made the xtal modification, it might be fun to try a little BASCOM program. This one will print a test message to the serial port and then light up some LEDs on the board. Don't forget to connect the supplied RS232 cable between your PC and your AVR-SDK1

$regfile = "m8def.dat"             ' specify the Micro
$crystal = 4000000                 ' the external Xtal is 4MHz
$baud = 9600                       ' baud rate for the on-chip UART
$hwstack = 32                      ' default use 32 for the hardware stack
$swstack = 10                      ' default use 10 for the SW stack
$framesize = 40                    ' default use 40 for the frame space

Config Pind.2 = Output             'LED D2
Config Pind.3 = Output             'LED D3
Config Pind.4 = Output             'LED D4
Config Pind.5 = Output             'LED D5
Config Pind.6 = Output             'LED D6
Config Pind.7 = Output             'LED D7

Dim I As Byte

Print "1234567890"                 'test RS232 output

Waitms 500

  For I = 2 To 7
    Toggle Portd.i                 'light and blank LEDs in turn
    Wait 1
  Next I


Interesting to note that the Mega168 chip will also work with this board. The 168 has twice as much code space as the Mega8, so can be handy. One important point to note when using the 168 - by default, it ships with a fusebit set that enables a chip-wide 'divide the clock by 8' facility. You will probably want to disable this - the setting is shown in the Bascom programmer as 'Fusebit C' in the 'Fusebits [ED]' section.