Hi guys, this is probably not the correct forum and Im sorry if this is well trodden territory. I have read our friend Jecksons attempts to try to make an USBasp program a At89S52 via AVRdude. As a matter of fact, im trying to do the exact same thing.
Im actually able to read and partially write to the AT82S52 through the USBasp and Avrdude 5.10 with a modified conf.
Here is how i did it.
0. WinXP system
1. Bought/soldered a usbasp
2. Knowing that the usbasp functions fully (tested to program atmega8s all day with it) i interconnected the MISO, MOSI, SCK, GND, RST, VCC and GND of the Atmega8 on the USBasp and the target µC AT89S52.
3. Hooked up a 4,096mhz Xtal and 33pf capacitor to the target µC.
4. Connected the entire setup to the usb
5. Edited the conf file of avrdude with the work of Joy Shukla:
#------------------------------------------------------------ # Below chips by added by me .. Joy Shukla(joy_shukla@yahoo.in) # these chips can be programmed with my usbasp programmer(changed atmega8 program) # after adding avrdude support in this file .. #------------------------------------------------------------ #------------------------------------------------------------ # AT89S52 #------------------------------------------------------------ part id = "8052"; desc = "AT89S52"; signature = 0x1E 0x52 0x06; chip_erase_delay = 20000; pgm_enable = "1 0 1 0 1 1 0 0 0 1 0 1 0 0 1 1", "x x x x x x x x x x x x x x x x"; chip_erase = "1 0 1 0 1 1 0 0 1 0 0 x x x x x", "x x x x x x x x x x x x x x x x"; timeout = 200; stabdelay = 100; cmdexedelay = 25; synchloops = 32; bytedelay = 0; pollindex = 3; pollvalue = 0x53; predelay = 1; postdelay = 1; pollmethod = 0; memory "flash" size = 8192; paged = no; min_write_delay = 4000; max_write_delay = 9000; readback_p1 = 0xff; readback_p2 = 0xff; read = " 0 0 1 0 0 0 0 0", " x x x a12 a11 a10 a9 a8", " a7 a6 a5 a4 a3 a2 a1 a0", " o o o o o o o o"; write = " 0 1 0 0 0 0 0 0", " x x x a12 a11 a10 a9 a8", " a7 a6 a5 a4 a3 a2 a1 a0", " i i i i i i i i"; mode = 0x21; delay = 12; ; memory "signature" size = 3; read = "0 0 1 0 1 0 0 0 x x x 0 0 0 a1 a0", "0 0 0 0 0 0 0 0 o o o o o o o o"; ; ;
5. Copied my target hex "Loghman.hex" of 380 (threehundred and eighty bytes) of led-blinking-code to avrdude's location
6. Fired up avrdude with the following command:
avrdude -p 8052 -c usbasp -e -U flash:"blabla\loghman.hex" -vvvv
7. Got the following screen:
Conclusion:
A) AVRdude can write to the AT89S52 but only 110 bytes, and NOT the full 380 bytes. Avrdude can read the supposedly written 110 bytes and it looks like this (gibberish?):
oߟ¯Â¯¯¯¯¯¯¯¯Ã__ï/ÿï?ÿï?ÿï?ÿßÂߟ/ŸÃïÿÿÿÿÂÃïŸÿÿïŸOÿïŸOÿïŸOÿ/ïÿßÿÂÿ
Discussion:
A) I know through previous searches that AVR and the AT89 chips are programmed in a different way but hoped that the .conf file modification might do the trick. Obviously it didnt or i have due to ignorance missed something. Would any of the more versed AVR experts care to comment on what i might have done wrong?
B) Also, im getting a warning message that avrdude cannot set sck period. Tried to hook pin 25 to GND to set the SCK to slow mode but get the exact same warning. Any suggestions would be appriciated.