0% found this document useful (0 votes)
21 views5 pages

RS232 AVR Programmer

This document describes using a simple serial port to program AVR microcontrollers. It details using avrdude software with two options: -c dasa and -c dasa3. Hardware is designed to safely interface AVR pins with a USB-RS232 cable. The dasa3 option works successfully while dasa does not.

Uploaded by

cont lamisto
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
21 views5 pages

RS232 AVR Programmer

This document describes using a simple serial port to program AVR microcontrollers. It details using avrdude software with two options: -c dasa and -c dasa3. Hardware is designed to safely interface AVR pins with a USB-RS232 cable. The dasa3 option works successfully while dasa does not.

Uploaded by

cont lamisto
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 5

AVR Simple serial port programming release 1.

I wanted to test a simple AVR programming interface using a serial port with bit banging (no RS232 official signals)

Programmation software :
I use the widespread avrdude software in Linux environment (flavor Mint 17)
Avrdude allows two serial port bitbang programming options

-c dasa :
RESET = RTS (pin 7, connected to pin 6 DSR)
SCK = DTR (pin 4)
MOSI = TxD (pin 3)
MISO = CTS (pin 8)

-c dasa3 :
RESET =!DTR (pin 4) (reset is inverted)
SCK = RTS (pin 7, connected to pin 6 DSR)
MOSI = TxD (pin 3)
MISO = CTS (pin 8)

DTE=male
pin side view
DCD = in
RxD = in
DSR = in
CTS = in
TxD = out
DTR = out
RTS = out

picture from : http://www.usconverters.com/index.php?main_page=page&id=61&chapter=0

the port should be specified :


- in the avrdude.cont as default serial ( /dev/ttyUSB0 )
- or in the command line ( -P /dev/ttyUSB0 )

complete command line


for terminal mode :
sudo avrdude -p t13 -c dasa3 -i 5000 -P /dev/ttyUSB0 -v -t
for programmation :
sudo avrdude -p t13 -c dasa3 -i 5000 -P /dev/ttyUSB0 -v -U flash:w:main.hex

The programming and verification take one minute for 114 bytes in a tiny13A

Hardware
The hardware is designed to never exceed the Atmel specs. Atmel states that the voltage at any pin sould not exceed the
power voltage + 0,5V or the ground voltage -0,5V. Obviously, a simple diode clamping could not meet these specs, as it
has a Vd at 0,6V or more. If a Zener is used, it should be from accuracy high enough AND has to match the Vcc, anyway
it allows the voltage to go under GND-0,5V limit.
That is why I choose to clamp the signals to a resistor of 100 ohms ( to drain enough current, and HF decoupled by a
10nF capacitor ). This resistor is connected to Vcc and GND by 2 Silicon diodes. The clamping diodes are connected to
the 100 ohms resistor, so the pins voltage will never exceed Vcc and GND, even if Vcc is not precisely 5V, as it is
allowed to go up to 6V. As long as the signals levels are inbetween Vcc and GND, the impedance of the line is very high,

Zibuth27 09/2014 Creative commons 3,0 By, Nc, Sa page 1/5


AVR Simple serial port programming release 1.1

limited by the AVR only.

The hardware is different whether the programmer uses - dasa or – dasa3 avrdude command.
Not only the RS232 pins are different, but the RESET signal is also inversed, which requires a transistor for the dasa3
option.

For serial port I used a USB-RS232 cable with a DB9 connector, because a small USB-RS232 card generally has only 0
to 5V TxD and RxD signals. This programming interface is able to work with any standard RS232 signals up to +-20V.
This interface is recognized as /dev/ttyUSB0 in Linux systems and shoud be declared in avrdude.conf or in the command
line.

The resistors in series with RS232 connector in both dasa & dasa3 can go down to 1k, provided the AVR has no
connections with any load (on socket used only for programmation)

For -dasa3 option

for -dasa option

Zibuth27 09/2014 Creative commons 3,0 By, Nc, Sa page 2/5


AVR Simple serial port programming release 1.1

the dasa3 programmer board


with tiny13 socket
and RS232 – USB cable
ICSP 10pin links

dasa3 SCK MOSI

dasa3 with -i 5000 option

Zibuth27 09/2014 Creative commons 3,0 By, Nc, Sa page 3/5


AVR Simple serial port programming release 1.1

Results

The dasa3 option works well !


The -i option allows to program slow µcontrollers ( for slow internal clock programmed MCUs)

The -c dasa option does not work at all, I contacted Jörg Wunsch ( last author of avrdude ) to know if it might be a
bug or simply if -c dasa might no longer be supported. No answer, one month later.

Of course, this programmer is pin-to-pin compatible (same cable) with standard programmers like USBASP

Zibuth27 09/2014 Creative commons 3,0 By, Nc, Sa page 4/5


AVR Simple serial port programming release 1.1

PCB made by Yoruk

Yoruk made this PCB and added a « programming in process » LED, following my indications

Everything works ! (including prog_LED), programmed with avrdude (syntax used displayed on hard-copy)

Zibuth27 09/2014 Creative commons 3,0 By, Nc, Sa page 5/5

You might also like