I had some blank AT90S1200 chips. I got mine from Insight Electronics: www.insight-electronics.com
Call 1-888-677-3135 and ask for Credit Card Sales. They sell both the DIP and SOIC version so I ordered:
2 SOIC @ $4
3 DIP @ $3
and $5 shipping for a total of $22.
Iguana Labs (www.proaxis.com/~iguanalabs/Avr1200.htm) has them for $5.
The programmer part is pretty simple...I had a 25 pin male to 25 pin female serial cable. I plugged the male end into the parallel port and stuck wires into a into the other end. I plugged the AT90S1200 20 pin dip into a breadboard and stuck the wires in:
CABLE AT90S1200 PIN PIN 5 5 6 1 7 17 8 19 9 20 10 18 18 10(Note: Before I was done trouble shooting I followed the fuller schematic including 4 diodes and extra wires..haven't gone back and checked this minimal setup yet.)
I soldered some pins on the wire ends so they would fit snugly.
I put the Jerry Meng programmer (fbprg.zip 37921 bytes) in its own directory. It's one of my favorite things, a well written DOS program. Fast, foolproof There's no command to flush the buffers, for instance, butting quitting and restarting takes two seconds (literally) and always works.
And that little touch of inspiration, (L) Show Schematic:
The schematic of BA1FB PC based programmer
AT90S1200 PRINTER PORT
+------------------+ +--------------+
+---¦1 RESET VCC 20+--------+ ¦ GND 25+-+
¦ ¦2 SCK 19+----+ ¦ ¦ GND 24+-¦
¦ ¦3 MISO 18+----+-+ ¦ ¦ GND 23+-¦
¦ ¦4 MOSI 17+--+ ¦ +-+-------¦10 ACK GND 22+-¦
+-+---¦5 XTAL1 16¦ ¦ ¦ +--|<---¦9 D7 GND 21+-¦
¦ ¦ ¦6 15¦ ¦ +---+-------¦8 D6 GND 20+-¦
¦ ¦ ¦7 14¦ +-----+-------¦7 D5 GND 19+-¦
¦ ¦ ¦8 13¦ +-----+-------¦6 D4 GND 18+-¦
¦ ¦ ¦9 12¦ ¦ +---+-------¦5 D3 ¦ ¦
¦ ¦ +-¦10 GND 11¦ ¦ ¦ +--|<---¦4 D2 ¦ ¦
¦ ¦ ¦ +------------------+ ¦ ¦ +--|<---¦3 D1 ¦ ¦
¦ ¦ ¦ ¦ ¦ +--|<---¦2 D0 ¦ ¦
¦ ¦ ¦ ¦ ¦ DIODE ¦1 STROBE ¦ ¦
+-+-+-----------------------+-+ x4 +--------------+ ¦
+-+-----------------------+ ¦
+------------------------------------------------------+
Note: You don't have to use 4 diodes if only one data
output pin can drive the AT90S1200
As always, all art is ASCII art so it can be read on a VT-100 terminal.
BA1FB AT90SXXXX PC BASED PROGRAMMER V1.20
Copyright 1997,1998 by Jerry Meng
Email:jerrym@public.gb.com.cn
+------------------------------------+
¦ (A) Load HEX file to Flash buffer ¦
¦ (B) Load HEX file to EEPROM buffer ¦
¦ (C) Display Flash buffer ¦
¦ (D) Display EEPROM buffer ¦
¦ (E) Program ¦
¦ (F) Read Device code ¦
¦ (G) Read Flash & EEPROM to buffer ¦
¦ (H) Save Flash buffer to HEX file ¦
¦ (I) Save EEPROM buffer to HEX file ¦
¦ (J) Generate AVR Studio DEBUG.OBJ ¦
¦ (K) Setup ¦
¦ (L) Show schematic ¦
¦ (X) Quit ¦
+------------------------------------+
The very first thing you'll want to do is (F) Read device code. Here's what you'll see.
No chip, no cable hooked up, etc. : ff ff ff ff AT90S1200 : 1e 90 01 ff AT90S1200 in backwards : 00 00 00 00 an MV1200 : 01 02 03 04 (later found 01 02 03 04 is what you'll get if the lock bits are set)Here's what the manual has to say about these codes
"Signature Bytes All Atmel microcontrollers have a three-byte signature code which identifies the device. This code can be read in both serial (1) and parallel mode. The three bytes reside in a separate address space, and for the AT90S1200 they are:
1. $00: $1E (indicates manufactured by Atmel)
2. $01: $90 (indicates 1 kB Flash memory)
3. $02: $01 (indicates 90S1200 device when $01 is $90)"
Next you'll want (K) Setup. The defaults are: +-------------------------------------------------+ ¦ (1) Erase Flash & EEPROM memory ----------- Yes ¦ ¦ (2) Program Flash memory ------------------ Yes ¦ ¦ (3) Program EEPROM memory ----------------- Yes ¦ ¦ (4) Verify Flash memory ------------------- Yes ¦ ¦ (5) Verify EEPROM memory ------------------ Yes ¦ ¦ (6) Lock protect bit 1 -------------------- Yes ¦ ¦ (7) Lock protect bit 2 -------------------- Yes ¦ ¦ (8) Printer port -------------------------- 1 ¦ ¦ (9) Device -------------------------- AT90S1200 ¦ ¦ (S) Save setup ¦ +-------------------------------------------------+This can be left as is. A note on the Lock Protect Bits, its counter-intuitive but yes means allow read and write. Here's what the manual says:
"Program Memory Lock Bits The AT90S1200 MCU provides two lock bits which can be left unprogrammed ('1') or can be programmed ('0') to obtain the additional features listed in Table 12.
Lock Bit Protection Modes Note: The Lock Bits can only be erased with the Chip Erase operation. Table 12
Mode LB! LB2 1 1 1 No program lock protect features. 2 0 1 Programming Flash & EEPROM is disabled. 3 0 0 Same as mode 2, but verify is also disabled."Since this program doesn't come with any files it's time to load up the avrbasic. Getting ready for this day I found and downloaded several programs:
ABC363.zip 162460 bytes
ABCD098.zip 141990 bytes
ABCDE.zip 204551 bytes
BASFILES.zip 22054 bytes
This also seems like a good time to mention other files you'll find useful.
90S1200.EXE 1456205 bytes - The Atmel "White Paper" on the AT90S1200 - must have. It's a self extracting zip containing 90S1200.PDF 1469000 bytes. 49 pages.
AVRBASIC.PDF 114561 bytes - The Silicon Studio AVR Basic Language Reference. 50 mostly blank pages. Limited, but it's a work in progress and it's free, so I'm not bitching. If you want to find out what PortB is you'll have to look elsewhere tho'.
You'll want to go over to the Merimack Valley Systems site and get their docs too. http://www.star.net/people/~mvs
THE AVRBASIC PART
Putting each in their own directory, I quickly found ABCDE is the newest and the others are just older versions.
Also, this years mondo cool acronym award goes to Silicon Studio, LTD. for ABCDE = AVR Basic Compiler Demo Edition.
Again, documentation is minimal, but that's to be expected for a freeware demo.
The software comes with different drivers for different programmers, and this being the BA1FB design, its as simple as running BA1FB.EXE
"BA1FB AVR Programmer
PINAPI level 1.0 Driver Installed on LPT1"
There's no uninstall switch so you'll have to reboot to remove it.
Counter-intuitively, you don't want to start AVRBASIC.EXE, you want to start ABCDE.EXE.
Wanting something to test programming the chip, I loaded up LEDTEST.BAS
' ' This Basic Program generates the same code as LEDTEST.ASM ' (Variable allocation may be different) ' Var Delay Reg Var Delay2 Reg Symbol Zero = SREG.1 RESET: DDRB = %11111111 loop: PORTB = WREG; Dec WREG Repeat; Repeat; dec Delay; Until Zero; dec Delay2; Until Zero Goto loopWhile this wannabe C++ code is not immediately obvious, but I can see it will take Port B (Pins 12 through 19) and put changing digital states on it, which is fine for testing.
Hitting F9 for compile and run, it compiles and programs (gives a 93% message, which I assume is memory left over) and a beep when its done.
Long story short, no activity from the chip. Reset is high (good), VCC is high (good), ground is low (good), XTAL 1 is low (good?), SCK is high (?), miso is low (?) and mosi is high (?)
If there is no chip installed; you'll get this message:
+-[_]---------- Confirm ---------------+ ¦ ¦ ¦ Error Programming Device! ¦ ¦ ¦ ¦ ¦ ¦ ¦ ¦ OK ¦ ¦ ________ ¦ +--------------------------------------+There's no trouble shooting options. Fortunately this is where the Jerry Meng programmer gets to shine.
Loading up FBPRG.EXE:
After starting, but before checking any chips,
C)display flash buffer will show:
0 1 2 3 4 5 6 7 8 9 A B C D E F 0123456789ABCDEF
----------------------------------------------- ----------------
0000:00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
0010:00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
0020:00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
and so on for three screens until
03d0:00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
03e0:00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
03f0:00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
and(D) Display EEPROM buffer will show
0 1 2 3 4 5 6 7 8 9 A B C D E F 0123456789ABCDEF
----------------------------------------------- ----------------
0000:00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
0010:00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
0020:00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
0030:00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
Selecting (G) Read Flash & EEPROM to buffer,
(takes a few seconds), (C) and (D) will show:
C)display flash buffer will show:
0 1 2 3 4 5 6 7 8 9 A B C D E F 0123456789ABCDEF
----------------------------------------------- ----------------
0000:ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ................
0010:ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ................
0020:ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ................
and so on for three screens until
03d0:ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ................
03e0:ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ................
03f0:ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ................
and(D) Display EEPROM buffer will show
0 1 2 3 4 5 6 7 8 9 A B C D E F 0123456789ABCDEF
----------------------------------------------- ----------------
0000:ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ................
0010:ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ................
0020:ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ................
0030:ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ................
Reading this chip, the flash buffer shows
0 1 2 3 4 5 6 7 8 9 A B C D E F 0123456789ABCDEF
----------------------------------------------- ----------------
0000:ff ef f7 bb f8 bb fa 95 da 95 f1 f7 ca 95 e1 f7 XXXXXXXXXXXXXXXX
0010:f9 cf ff ff ff ff ff ff ff ff ff ff ff ff ff ff XX..............
0020:ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ................
etc.
A bunch of ASCII characters appeared where those X's are. The EEPROM buffer is all ff's.Just because I have suffered for my art, I don't think you should have to so I'll spare you the details of the next entire day working on this chip.
The chip works. This is the MINIMUM circuit you'll need to test it out stand alone.
+5 VDC +5VDC
| |
| AT90S1200 |
| +------------------+ |
+---¦1 RESET VCC 20+---+
¦2 SCK 19+
¦3 MISO 18+ (The resistor and LED
¦4 MOSI 17+ are just an optional
CLOCK -----¦5 XTAL1 16¦ visual indication.)
| ¦6 15¦
| ¦7 14¦ LED
| ¦8 13¦ 1 Kohm |\ |
| ¦9 12¦---/\/\/\---| \|--+
+------+-¦10 GND 11¦ Brn,Blk,Red| /| |
¦ +------------------+ |/ | |
__|__ __|__
___ ___
_ _
The clock is a necessity. To quote the manual:A quick search of the avrbasic manual didn't show any reference to this bit. The white paper went into a lot more detail. This will need a lot more research.
It's not too picky about a clock, I'm using a 2K hz sine wave, 2v p-p, sitting on top of 3 VDC. (its what I had handy).
On the port B pins you should see what looks like about a 100 Hz square wave, variable duty cycle, 0 to 4 volts. The LED will be blinking pseudo randomly.
That's it - from out of the box to working unit. I had three chip, two survived the process, and a lot of unanswered questions. There's an Atmel mailing list:
atmel@pic.co.za
Please email me with questions and comments..as you can tell, I'm not sure if I'm telling you the truth on a lot of this stuff.
more later..
Endnote 1: Blowing up a AT90S1200
I burned up a AT90S1200 with exactly this circuit:
+ 6 VDC
|
AT90S1200 |
+------------------+ |
¦1 RESET VCC 20+---+
¦2 SCK 19+
¦3 MISO 18+
¦4 MOSI 17+
¦5 XTAL1 16¦
¦6 15¦
¦7 14¦
¦8 13¦
¦9 12¦
+-¦10 GND 11¦
¦ +------------------+
__|__
___
_
with no warning, starts to smell, put my finger on it and sure enough, it's burning. Book says max operating voltage is 6.6 VDC.Putting it back in the programmer, the device code is still there.
Programming all zero's to the Flash and EPROM:
Erase Flash & EEPROM memory
Program Flash memory
...............................
Program EEPROM memory
...............................
Verify Flash memory
.......
Flash Low byte error in address 0074
Verify EEPROM memory
...............................
Lock protect bit 1
Lock protect bit 2
But reading out Flash and EPROM will show.
0 1 2 3 4 5 6 7 8 9 A B C D E F 0123456789ABCDEF
----------------------------------------------- ----------------
0000:00 00 01 01 02 02 03 03 04 04 05 05 06 06 07 07 ................
0010:08 08 09 09 0a 0a 0b 0b 0c 0c 0d 0d 0e 0e 0f 0f ................
0020:10 10 11 11 12 12 13 13 14 14 15 15 16 16 17 17 ................
0030:18 18 19 19 1a 1a 1b 1b 1c 1c 1d 1d 1e 1e 1f 1f .... --
0040:20 20 21 21 22 22 23 23 24 24 25 25 26 26 27 27 !!""##$$%%&&''
0050:28 28 29 29 2a 2a 2b 2b 2c 2c 2d 2d 2e 2e 2f 2f (())**++,,--..//
0060:30 30 31 31 32 32 33 33 34 34 35 35 36 36 37 37 0011223344556677
0070:38 38 39 39 3a 3a 3b 3b 3c 3c 3d 3d 3e 3e 3f 3f 8899::;;<<==>>??
0080:40 40 41 41 42 42 43 43 44 44 45 45 46 46 47 47 @@AABBCCDDEEFFGG
0090:48 48 49 49 4a 4a 4b 4b 4c 4c 4d 4d 4e 4e 4f 4f HHIIJJKKLLMMNNOO
00a0:50 50 51 51 52 52 53 53 54 54 55 55 56 56 57 57 PPQQRRSSTTUUVVWW
00b0:58 58 59 59 5a 5a 5b 5b 5c 5c 5d 5d 5e 5e 5f 5f XXYYZZ[[\\]]^^__
00c0:60 60 61 61 62 62 63 63 64 64 65 65 66 66 67 67 ``aabbccddeeffgg
00d0:68 68 69 69 6a 6a 6b 6b 6c 6c 6d 6d 6e 6e 6f 6f hhiijjkkllmmnnoo
00e0:70 70 71 71 72 72 73 73 74 74 75 75 76 76 77 77 ppqqrrssttuuvvww
00f0:78 78 79 79 7a 7a 7b 7b 7c 7c 7d 7d 7e 7e 7f 7f xxyyzz{{||}}~~
And the EPROM shows.
0 1 2 3 4 5 6 7 8 9 A B C D E F 0123456789ABCDEF
----------------------------------------------- ----------------
0000:00 01 02 03 04 05 06 07 08 09 0a 0b 0c 0d 0e 0f ................
0010:10 11 12 13 14 15 16 17 18 19 1a 1b 1c 1d 1e 1f .......... -
0020:20 21 22 23 24 25 26 27 28 29 2a 2b 2c 2d 2e 2f !"#$%&'()*+,-./
0030:30 31 32 33 34 35 36 37 38 39 3a 3b 3c 3d 3e 3f 0123456789:;<=>?
I suspect that, like unhappy families, every unhappy AT90S1200 will be unhappy in it's own unique way. But that's what happened to this one.
I also got some more MV1200 chips in, and one of them did it too..I was powering it off 4 D cells (6 volts) since I was thinking I had some grounding problems. It's working, echoing keystrokes to a terminal program. Then it stops working. Since I was paranoid about this chip (I had a previous one I suspect went the same way but don't know) I had a meter on the power and I notice it's dropped to three and a half volts. Finger on the chip..very warm. Turn it off, and it works again after cooling off.
9 June 1998
"Hi there, wanted to let you know your avr pages have been a big help with my little adventure into microcontrollers using the avr. I discovered something strange with my setup which reminded me of some of the weird behavior you have reported. Im using a breadboard which has its own power
supply. I programmed my first chip without problem using the ba1fb programmer, but later realized my chip wasnt grounded to the common on the breadboard. I connected the common on the board to the chip for later programming, and then it would not work right! It seems the goofy power
supply is finding a return path back up the lpt cable, and through the ground wire on their power recepticle cords. Anyway, I guess it might be the safest to stick with the 4-diodes setup. (good thing i had it setup wrong at first, or I might still be trying to figured out the problem ;)
I had a strange thing happen with one of the sample apps included with the atmel assembler. The "pushbutt.asm" little program works as it should, except for one strange thing. The switch connected to d0 must be turned on
to turn it off. I tried other physical switches, same problem. I also used the avrbasic version of the same program, has the same prob. tried another chip, same thing. Have you tried this program? Ive studied the
code, and cant see what would cause this. Any ideas?
Thanks for the useful information.
Brady Moritz"
If anybody has any info, send it and I'll post it as time permits...I myself am moving across country next week so this page will be static for awhile. It will stay at this url for many moons to come, however. I hope to come back soon with a low cost parallel mode AT90S1200 programmer, unless somebody beats me too it. (I wish somebody would!) more later...