I have this 8051: I have acquired an it from an old device and I want to program it. I have experience with AVR, ESP, and STM microcontrollers, but not with 8051's. Googling info about this DIP IC, I've found out that it's an 8-bit 6051 MCU: https://ksp-electronics.com/media/1/1129364/tp2808.pdf?v=1607152781. After some research, I found out that I can program it via Arduino as ISP, but I have been unsuccessful so far. I have much experience with AVR, ESP and STM, but 8051's... Seeking information on how to flash such MCUs yielded that i can actually program it via Arduino as ISP. But no success for me on this one.
I have attempted to flash it with the following code:
#include <8051.h>
void delay() {
unsigned int i, j;
for (i = 0; i < 0xFF; i++) {
for (j = 0; j < 0xFF; j++);
}
}
void main() {
while (1) {
P1_0 = 1; // turn LED on
delay();
P1_0 = 0; // turn LED off
delay();
}
}
I ran this:
sdcc blink.c
packihx blink.ihx > blink.hex
# AVR8051.conf from here: https://www.instructables.com/How-to-Program-8051-Using-Arduino/
avrdude -c stk500v1 -P /dev/ttyUSB0 -p 89s51 -U flash:w:"blink.hex":a -C ~/Downloads/AVR8051.conf -F -v
And the flashing process was unsuccessful, avrdude logs can be found here: https://pastebin.com/y8VkmCMQ. Also the voltage across P1.0 and ground varied. At first it was able to light an LED with 150Ohm resistor, then it dropped down to ~1.5V and my LED was extremely dim.
I understand that AT89S51 is a different chip, but it is still based on 8051 architecture, so I figured it might be worth a try. Any suggestions on how to properly program this MCU. would be greatly appreciated.