I’m working on an Arduino clone. The Arduino is essentially an ATMEGA328P development board with a bootloader pre-loaded. There are a lot of custom macros built into the programming interface that make it really easy to use, and even easy to build some powerful applications. Arduinos have taken off and can be found everywhere, doing everything. The hardware and software is open-source which seems to have really contributed to the product’s success.
Anyway, I was looking over the schematic of the Arduino Uno. I noticed the programming interface, which is USB, made use of another Atmel microcontroller (the ATMEGA16U2). This is the small surface mount IC in the upper left corner of the picture above. In fact most of the components in the upper left of the board are associated with programming. I figure these parts probably cost in the area of $4-$6 to add to the board, which is likely 1/3 of the entire manufacturing cost.
It seemed redundant and costly to have two microcontrollers on the board. Especially since the bootloader appears to be a simple serial interface. I suspect that I understand why the Arduino Uno people went the two microcontroller route. First, new computers don’t have a serial port anymore. So a USB interface is just easier for the customer. Second, the cost of the microcontroller and surrounding components is about the same as a dedicated USB-232 converter IC. It might even be less expensive, although there would be some NRE (non-recurring engineering) costs.
This all left me wondering if I could replace all of the USB to conversion on the board and just use an RS232 to logic level converter chip to program the Arduino Uno with my PC. If so, then the programming interface circuitry drops to about $0.80 in small quantities.
It turned out that this was pretty easy to do. So here’s what I did.
1. Connect jumper wires to pins 2,3,4, and 5 of a DB9-F serial port connector. Pin two is data from the PC, pin 3 is data to the PC, pin 4 is the DTR signal used to reset the Arduino, and pin 5 is ground. Ground should be common to all circuits.
2. Remove RN4 and C5 which connect the ATMEGA16U2 (programmer) to the ATMEGA328P (Arduino). Keep these parts so you can put them back on later. Also, since RN4 is a resistor array removing it also prevents the green “ON” LED from lighting. You could solder a 1K ohm resistor across the 2 pads closest to the LED if you wanted it to light up when power is applied.
3. Connect an RS232 converter IC (I used a MAX202) between the DB9-F and the Arduino RX, TX, and Ground connections. Connect a 0.1uF capacitor between the DTR logic level output the RS232 IC and the Reset pin on the Arduino. I actually used a 0.01uF cap, since it was what I had handy, and it worked as well.
For more detail: Arduino Uno – Programming With A Serial Port
This Post / Project can also be found using search terms:
- arduino mega programmer compiler settings serial\
- programme arduino serial port
- serial port arduino uno program