PROGRAMMING THE ATMEL AT90S1200 MICROCONTROLLER


The programming interface connected to the AT90S1200 in the simple DDS.
The AT90S1200 can be programmed after it is soldered in the circuit.



The simple but fast microcontroller chip AT90S1200

The AT90S1200
The AT90S1200 is a cheap, simple but very fast 20 pins microcontroller with two input/output ports: Port B and Port D.
You can set the pins as an input or an output. It has a reduced instruction set, not too complex for amateurs. After one week (one or two hours per evening) I could make already my own assembly programs for this microcontroller. This micro controller has a memory size for maximal 500 instructions. If you need more, use the AT90S2313.


The pins

Steps for programming the microcontroller
  1. Make your program with assembly instructions with a text editor, include the 1200.INC file in it and replace the .TXT extension by .ASM.
  2. Assemble this readable text file into a XYZ.HEX data file with use of a free available assembly program from the ATMEL website.
  3. Store this XYZ.HEX file into the flash memory of AT90S1200 with use of a free available In System Programming (ISP) software program and a simple home made interface between you PC printer port (or RS232 port) and the AT90S1200. During this programming the AT90S1200 is already soldered in the electronic circuit and has its 5V from that circuit.
  4. If you also need to program the 64 byte EEPROM with default values, store the XYZ.EEP file (also generated during assembling the .ASM file) into the EEPROM with use of the interface and ISP software.

The files
The following files are used to program the AT90S1200, including the source file:


The files used for programming the AT90S1200 and others
like the AT90S2313 with more memories and extra instructions.

FREQTRX1.ASM
This file contains your own written program with instructions for the micro controller. It is in readable text format, the extension .TXT is just replaced by .ASM. You can use any ascii text editor for it, like the good old DOS EDIT or the editor included in some of the ATMEL assembler programs.
During assembling, the assembler gives the line numbers with errors. It is important that you editor gives the line numbers of the cursor, otherwise it is almost impossible to find the line with an error...

1200.INC
You can do without it but it makes life much easier. Include it in the .ASM file with an "include" instruction and you can type readable words like PORTB for output port B instead of $18. It also tells the assembler which microcontroller is used.

FREQTRX1.HEX and FREQTRX1.EEP
After that you have assembled the FREQTRX1.ASM file, the free available assembler program generates the FREQTRX1.HEX data file for the flash memory and the FREQTRX1.EEP data file for the EEPROM memory.

The software
Three software programs: The Editor, the Assembler and the In System Programming software.


Snapshot of the free combined editor / assembler WAVRASM.EXE (558 kb) I use.
Line numbers are given, but outside this snapshot.

I use the combined editor/assembler WAVRASM.EXE. You can download it on many places on the internet with help of a search engine. But you can also use the AVR studio software with more features like simulators from the ATMEL website.


Snapshot of the free In System Programmer AVR-ISP.ZIP (873 kb) software I use.
The Program Memory is the XYZ.HEX file data, the EEPROM data memory the XYZ.EEP file.
There are newer versions and many others available via Internet.

Many other ISP software programs with ISP interfaces (named ISP dongles) can be found on the internet.

The hardware interface


The diagram of the interface or "ISP dongle" I am using with the ATMEL ISP software.
There are many others and even more simple on the internet, often with their own software.

Notes:
Connect the MOSI, MISO, SCK and RESET to the microcontroller and the diode to the +5V of the microcontroller.
The pin numbers of the D-connecter are the PC connector numbers and not of the plug of the printer cable!!!
I inserted extra resistors of 330 to 390 ohm in the MOSI, MISO, SCK and RESET lines to prevent damage to the circuits. Without these resistors I sometimes had a defect 74HC244.

Where to find the documentation and software
Download the AT90S1200 datasheet (with the instruction set), software and manuals of the assembler plus explanations of the instructions from the ATMEL website:

WWW.ATMEL.COM goto MICROCONTROLLER goto AVR 8-BIT RISC goto DOCUMENTATION or TOOLS AND SOFTWARE.

Many .ASM examples and tutorials about how to write your programs can be found on the internet.

BACK TO INDEX PA2OHH