Interactive Serial Programmer

Circuit

The IRTC ISP is similar to the Atmel serial programmer explained in their application note. However, a tri-state buffer has been added to the IRTC ISP to enable the programmer to be used for both programming and development.

The control codes are the same as in the Atmel application note with the exception of Z. This leaves the ISP in the program mode but tri-states the SCK, MOSI and MISO lines and sets RESET high to enable the target CPU to run stand-alone.

The DTR line on the serial port controls the ISP operation, switching between program and development mode. In the program mode the 90S2313 on the programmer accepts ASCII commands to control the program functions. These functions are similar to the Atmel ISP. In the development mode the 2313 is switched off and the buffers enabled allowing the Rx and Tx signals to pass through to the MOSI and MISO lines. The TLM receives the serial data and enables development.

The ISP is powered from the target system and requires the following connections to the target processor;

Header Signal Connector 6 way

Pin1 - Red - VCC +3-5 Volts

Pin2 - Black/Scr - GND 0 Volts

Pin3 - Blue - MOSI Master Out Slave In

Pin4 - Green - MISO Master In Slave Out

Pin5 - Black - SCK Serial Clock

Pin6 - White - RESET Target CPU Reset

The ISP must also be connected to the host computers serial port, COM1-4. It may be necessary to use a 25Way to 9Way convertor or cable to enable proper connection.

The Target and the ISP should be powered up together to ensure they reset properly. It is also important that the ISP is connected to an operating serial port with PC running prior to power-up.

NOTE: It is possible to get the Target CPU out of step with the ISP. This may be caused by noise, especially on the SCK line or bad earthing of the PC and power supplies. In some cases the signature bytes may read as $FF. If this occures check the fuses with ?FUSES, ?HIFUSE or ?LOFUSE, depending on the device.

NOTE: It is possible to get some devices into a state from which the only way out is to re-program the fuses with a parallel programmer. Care should be taken when using FUSE!, HIFUSE!, LOFUSE! or LOCK!. See the device data sheets.

Signatures

The AVR chips all have a 3 byte signature. For example the 90S8515 is $01 $93 $1E. These are set in the value SIGNATURE in the .INI file. When you do a ?REM the Target chip signature is checked against the set value. If they do not agree IRTC will not allow remote access. In the case of the Mega103 the bytes should be $01 $97 $1E but in some devices they are $01 $01 $1E. If you have some of these you may correct for this by editing the Mega103.INI file.

Commands

  A SET-ADDRESS - Sets the address to be programmed next.

  C WRITE-PROGH - Write a code byte high.

  c WRITE-PROGL - Write a code byte low.

  D WRITE-DATA - Wite a byte to EEPROM at address set.

  d READ-DATA - Read a byte from EEPROM.

  e CHIP-ERASE - Erase the Code and Lock bits.

  F READ-F&L - Read the Fuses or Lock bits.

  f WRITE-FUSE - Write the Fuses.

  L DEV - Put the programmer in the Development mode, RS232 pass thru.

  l WRITE-LOCK - Write the Lock bits.

  m WRITE-PAGE - Write a 256 byte page, Mega103/603 only.

  P PROG-ENABLE - Enable the program mode, returns $53 if successful

  p PROG-TYPE - Returns 'S' to show a serial programmer.

  R READ-PROG - Reads the Code memory at the address set.

  S IDENTIFIER - Returns 'RAM ISP' to show programmer.

  s READ-SIGNATURE - Returns the signature byte at the address specified.

  T GET-DEVICE - Sets the device code for AVR to be programmed.

  V SOFT-VER# - Returns the software version.

  v HARD-VER# - Returns the hardware version.

  Z TRI-STATE - Tri-states the programmer pins and sets reset high to run the Target.

  : GENERAL - Sends the byte received out of SPI and returns the SPI byte clocked back.

Contents