Program 89s52 with an Arduino

Is it possible to program 89s52 with an Arduino as ISP programmer, In case it is possible: Can it be done with the Arduno IDE or I should use other program to do it.


Did you solve this problem ??? If yes, so how did you do it ??? Kind regards,

I attached a version of ArduinoISP that has some improvements over the one from the IDE + plus minimal changes to support the at89s52. Also attached is an avrdude.conf with an appropriate entry for the target.

As a test, read the target’s signature like this (linux cmd line version):

avrdude -C avrdude-at89s52.conf -c stk500v1 -P /dev/ttyACM0 -b 19200 -p at89s52 -U signature:r:sig.txt:h

This command flashes blink.hex to the target:

avrdude -C avrdude-at89s52.conf -c stk500v1 -P /dev/ttyACM0 -b 19200 -p at89s52 -U flash:w:blink.hex:i

I tried this on linux with an uno.
(If you have the combination leonardo-windows, let me know, that won’t yet work…)

The at89’s reset pin has the opposite polarity as an avr. But this version of ArduinoISP reverses the polarity for you, so you can just connect pin 10 to the target’s reset pin.

This ArduinoISP has following changes compared to the sample in the IDE:

  • It uses SPI lib (rsbohn). More portable and more stable (avoids some lockups)
  • It has a heartbeat without delays
  • It puts SPI pins in high impedance mode when not programming
  • Always uses pin 10 for resetting the target (needed for leonardo, changes pin usage for mega)
  • Adds a delay after resetting the target, needed for at89s52
  • Reverses polarity of RESET for at89 targets (device code >=0xe0)

ArduinoISP.ino (12.7 KB)

avrdude-at89s52.conf.txt (2.39 KB)

This thread is about the at89*s52. For questions about the at89lp* series, please continue in this thread:Programming the at89lp series with an Arduino.