Target Configuration

The way the Target AVR is used maybe set-up in the file xxxx.INI.

This is loaded by IRTC and extends RAMFAVR.EXE by compiling the AVR set-up words and the talker, TLM, code. The positions and size of the memory spaces and stack positions are set.

Below is the source for Mega103;

\ Initialisation File for MegaAVR February 10th, 1999 - 10:01

FPATH+ C:\WIN32FOR\AVR;C:\WIN32FOR\AVR\AVRMAN

38400 8 NOPARITY ONESTOPBIT SET-COM1

META IN-META

IRTC-MENU

SET-FF

IN-META

$0060 VALUE RAM-VEC

$00A0 VALUE RAM-START

$0FFF VALUE RAM-END

$0000 VALUE ROM-START

$FFFF VALUE ROM-END

$0000 VALUE EPROM-START

$0FFF VALUE EPROM-END

\ Vectors

$0000 CONSTANT RESET

$0002 CONSTANT EXT-INT0

$0004 CONSTANT EXT-INT1

$0006 CONSTANT EXT-INT2

$0008 CONSTANT EXT-INT3

$000A CONSTANT EXT-INT4

$000C CONSTANT EXT-INT5

$000E CONSTANT EXT-INT6

$0010 CONSTANT EXT-INT7

$0012 CONSTANT TIM2-COMP

$0014 CONSTANT TIM2-OVF

$0016 CONSTANT TIM1-CAPT

$0018 CONSTANT TIM1-COMPA

$001A CONSTANT TIM1-COMPB

$001C CONSTANT TIM1-OVF

$001E CONSTANT TIM0-COMP

$0020 CONSTANT TIM0-OVF

$0022 CONSTANT SPI-STC

$0024 CONSTANT UART-RXC

$0026 CONSTANT UART-DRE

$0028 CONSTANT UART-TXC

$002A CONSTANT ADC-INT

$002C CONSTANT EE-RDY

$002E CONSTANT ANA-COMP

FLOAD TALKMEGA.F

FORTH ' (PAGED-DOWNLOAD) IS (DOWNLOAD)

H: "MEGA S" Mega103 " ;

FORTH ' "MEGA IS AVR-TYPE

\ XASM $E0A7 ( LDI TOSL,7 ) BAUD !-T \ Modify to change Baud Rate

\ NOTE: Programmer AND Target MUST be the same.

IN-META

HOST

.STATISTICS

CR CR .( IRTC for Mega103 Running in HOST mode )

The start and end of the file space, code space and EEPROM space are set. These are used to warn if exceeded during compilation. The programming algorithm is set for a paged Flash device and the TLM object code is loaded into the PC Target image.

The baud rate for the TLM may be modified here but this must be done along with a similar modification to the ISP code if the baud rate value is to be changed. If your crystal on the Target is not 4.9152MHz then this value will need to be changed to reflect the new crystal frequency. To make a change, remove the \ at the beginning of the line and edit the hex value to represent a LDI R26 , <baud value>. Some for common crystal frequecies are shown below;

1.8432MHz := $E0A2

2.0000MHz := $E0A2 Error 7.8%

2.4576MHz := $E0A3

3.6864MHz := $E0A5

4.0000MHz := $E0A6 Error 7.5%

4.9152MHz := $E0A7

6.0000MHz := $E0A9 Error 2.3%

Contents