3
\$\begingroup\$

Recently, a have a chance to get a AT89S52 chip, but I do not have a suitable programmer for it. I am new to microcontrollers, especially the MCS-51 series , but I've heard that MCS-51 is the "right way" to do microcontroller stuff, and I would like to try about learning it.

I have a USB to TTL (UART) converter (using the PL2303HX chip), an Arduino Uno board, and a Raspberry Pi board.

I've searched on the internet about how to program the chip, but most of the information and circuit diagram involves serial RS-232 port, or parallel printer port, or some other expensive commercial programmer products. As I don't have a RS-232 or printer port on my computer, I can't follow these diagrams or tutorials.

I've discussed to a friend of mine that is familiar with 89C51, and he told me that according to the Atmel's datasheet of serial programming of the 89S51 chip, it's actually technically possible to program the chip with Arduino or Raspberry Pi, but he's not sure if it's doable with USB to TTL(UART) converter.

I haven't found any clear information of the protocol of the 89S51 serial programming (some say that it's SPI, but some say it's not), which maybe is because my lack of English ability or knowledge about electronics stuff, I'm like completely confused.

So, is it possible to actually program an AT89S51 chip with USB to TTL(UART) converter or some simple circuit with that? If can't, is it possible to program it with an Arduino board or Raspberry Pi? Has anyone ever done those things?

If the above is all not possible, then can I use a USB to RS-232 converter with a serial programmer like this? 1

(I get this diagram from here)

Thanks in advance.

P.S. A lot of the commercial products are not usable for me because I don't have a Windows computer anywhere within my reach.

\$\endgroup\$
  • \$\begingroup\$ Kinda icky to go with good ol' 8051 just cause you heard it's the 'right way'. The right way is to choose the micro that best fits your needs. \$\endgroup\$ – Dave Van den Eynde Jun 17 '14 at 13:46
  • \$\begingroup\$ I'm not actually stick with that theory that much, but here in Taiwan, a lot of "professionals" (except for some of them who understand the maker community) don't like AVR and especially Arduino-ish stuff. They say that they'll make students not capable to work in the industries and ruin their professional life. \$\endgroup\$ – PCC Jun 17 '14 at 13:50
  • \$\begingroup\$ I don't really care those comment that much, cause I think they are just old-school people with old thoughts and thought Bill Gates is the greatest genius in the world. But a am quite interested in 8051 as they are still very popular indeed, and it's also the de facto standard of the microcontrollers as far as I know. AND THEY ARE VERY CHEEP. \$\endgroup\$ – PCC Jun 17 '14 at 13:55
  • \$\begingroup\$ You can use the following Arduino sketch and an arduino to program this chip: wdong.org/wordpress/blog/2012/07/04/… there are doubtless others doing the same thing if you run into problems with this one. \$\endgroup\$ – Adam Davis Jun 17 '14 at 14:21
  • \$\begingroup\$ @PcChou well, Bill Gates is the greatest genius in the world, but I get your point. \$\endgroup\$ – Dave Van den Eynde Jun 17 '14 at 14:32
0
\$\begingroup\$

I think your best bet is to use an Arduino as an ISP programmer. This article explains it in more detail.

\$\endgroup\$
  • \$\begingroup\$ Thank for your reply! I'll check that article \$\endgroup\$ – PCC Jun 17 '14 at 14:44
  • \$\begingroup\$ Is using a USB to TTL(UART) converter cable to program possible? \$\endgroup\$ – PCC Jun 17 '14 at 23:30
  • \$\begingroup\$ No. A UART is an asynchronous receiver/transmitter. An ISP programmer uses the SPI protocol, which is synchronous. That means it produces a clock signal and a data signal while an asynchronous serial line only has the data signal (and some good timing). The two are not interchangeable. But there's a number of ISP programmers out there you can use with your computer. \$\endgroup\$ – Dave Van den Eynde Jun 18 '14 at 11:17
0
\$\begingroup\$

The adapter you provide in the schematic requires bit-banging the protocol on the serial port pins. It is doable on computers with motherboard serial port.

However, when it comes to USB-RS232 adapters, most can only send data via the Rx-Tx lines using the standard RS232 USART protocol. It won't work because it can't toggle specific pins of serial port.

A similar programming interface (PonyProg with SIProg hardware) doesn't work with such adapters.

Yes, it is possible to program 8051 using an Arduino: Using Arduino to program at89s51

\$\endgroup\$
  • \$\begingroup\$ Only, in this case, we're trying to program a 8051 using an Arduino. \$\endgroup\$ – Dave Van den Eynde Jun 17 '14 at 14:34
  • \$\begingroup\$ Thank for your reply! I'll look for the link you provided. I'll probably give up with the RS232 adapter thought. \$\endgroup\$ – PCC Jun 17 '14 at 14:44
  • \$\begingroup\$ Is using a USB to TTL(UART) converter cable to program possible? \$\endgroup\$ – PCC Jun 17 '14 at 23:29

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.