ctownsend
Advanced Member level 2
AT89S51,AT89S52 ISP programmer using ATMEL avrprog
This code programs AT89S51 and AT89S52 devices using Atmel's avrprog.exe when used with the included circuit. The circuit takes power from the target circuit (5Volts) and uses your PC's serial port. This programmer will work well with USB to RS232 cables or adapters if you have a good working cable (not a knockoff cable from China, these don't work consistently!)
Download avrprog.exe here:
AVR Freaks
If you have avrstudio installed, you can find avrprog.exe in the program folder.
(usually C:\Program Files\Atmel\AVR Tools\AvrProg)
Please refer to the included schematic diagrams. If you have an existing avr910 programmer board, you can use the same board, however you will have to modify the reset circuit for the 8051 on the programmer board, and install an 11.0592MHz crystal. (also be aware of the pin used for the LED, as some circuits may be different)
Use any 8051/8052 microcontroller for the programmer matching the pins on these 40 pin devices: AT89C51,AT89C52,AT89S51,AT89S52,AT89S53,AT89S8252,AT89S8253 or any other 40 pin 8051 device with the same pinout. Refer to the schematic titled "40pin_sch.gif".
You can also use the 20 pin 8051/8052 mcu's with this code including AT89C2051, AT89C4051, AT89S2051, AT89S4051.
if using a 20 pin mcu for the programmer, Refer to the schematic titled "20pin_sch.gif".
Limitations of this code when using ATMEL's avrprog.exe (because I cannot change the avrprog.exe code)
1. When using this code, avrprog.exe will not give you a choice to select a different device. The selected device will be greyed out and will show up as AT89S53. (this is the closest device to AT89S51/52 that avrprog.exe supports as it does not have an eeprom)
2. When locking the device, all lock bits will be programmed (mode 4) regardless of the setting in avrprog.exe.
3. Because avrprog.exe thinks the target is an AT89S53, when reading the flash you will get a 12K file, even if the device you are reading is 4K (as in the AT89S51) or 8K (as in the AT89S52). You can adjust the output hex files accordingly by deleting the extra data manually in notepad. Delete everything starting on this line to the end of the file for 4K devices (AT89S51) :100FF000 and delete everything starting on this line to the end of the file for 8K devices (AT89S52) :10200000.
Be sure you have ":00000001FF" at the end of the file!
At the same time if you try to program a larger hex file than your device will accept, (i.e. a 12K file into a 4K device, the program will not show an error message) The program will probably give you a verify error.
It is up to you to manage your hex files according to the size of the device you are using.
I have been using this programmer for a long time without any problems. It works very reliably.
Looking for a reliable ISP programmer but don't like avrprog.exe? look at this thread here:
https://www.edaboard.com/threads/180513/
post all questions here, please don't message me.
regards,
ctownsend
This code programs AT89S51 and AT89S52 devices using Atmel's avrprog.exe when used with the included circuit. The circuit takes power from the target circuit (5Volts) and uses your PC's serial port. This programmer will work well with USB to RS232 cables or adapters if you have a good working cable (not a knockoff cable from China, these don't work consistently!)
Download avrprog.exe here:
AVR Freaks
If you have avrstudio installed, you can find avrprog.exe in the program folder.
(usually C:\Program Files\Atmel\AVR Tools\AvrProg)
Please refer to the included schematic diagrams. If you have an existing avr910 programmer board, you can use the same board, however you will have to modify the reset circuit for the 8051 on the programmer board, and install an 11.0592MHz crystal. (also be aware of the pin used for the LED, as some circuits may be different)
Use any 8051/8052 microcontroller for the programmer matching the pins on these 40 pin devices: AT89C51,AT89C52,AT89S51,AT89S52,AT89S53,AT89S8252,AT89S8253 or any other 40 pin 8051 device with the same pinout. Refer to the schematic titled "40pin_sch.gif".
You can also use the 20 pin 8051/8052 mcu's with this code including AT89C2051, AT89C4051, AT89S2051, AT89S4051.
if using a 20 pin mcu for the programmer, Refer to the schematic titled "20pin_sch.gif".
Limitations of this code when using ATMEL's avrprog.exe (because I cannot change the avrprog.exe code)
1. When using this code, avrprog.exe will not give you a choice to select a different device. The selected device will be greyed out and will show up as AT89S53. (this is the closest device to AT89S51/52 that avrprog.exe supports as it does not have an eeprom)
2. When locking the device, all lock bits will be programmed (mode 4) regardless of the setting in avrprog.exe.
3. Because avrprog.exe thinks the target is an AT89S53, when reading the flash you will get a 12K file, even if the device you are reading is 4K (as in the AT89S51) or 8K (as in the AT89S52). You can adjust the output hex files accordingly by deleting the extra data manually in notepad. Delete everything starting on this line to the end of the file for 4K devices (AT89S51) :100FF000 and delete everything starting on this line to the end of the file for 8K devices (AT89S52) :10200000.
Be sure you have ":00000001FF" at the end of the file!
At the same time if you try to program a larger hex file than your device will accept, (i.e. a 12K file into a 4K device, the program will not show an error message) The program will probably give you a verify error.
It is up to you to manage your hex files according to the size of the device you are using.
I have been using this programmer for a long time without any problems. It works very reliably.
Looking for a reliable ISP programmer but don't like avrprog.exe? look at this thread here:
https://www.edaboard.com/threads/180513/
post all questions here, please don't message me.
regards,
ctownsend
Attachments
Last edited: