![]() |
|||||||||||||||||
|
|||||||||||||||||
Our first microcontrollers used a serial cable connected to a computer in order to power the board, and the same serial cable for getting data back from the board. For programming the AVR, we used a cable connected to the parallel port of the computer. Instead, I have set things up to accomplish all of these tasks via the USB port of my laptop (since I have neither a traditional DB-25 parallel port nor DB-9 serial port).
|
|||||||||||||||||
Most of this information is taken from http://fab.cba.mit.edu/classes/MIT/863.07/10.15/ and is available there in a more concise form (minus the pictures and commentary). Step 1: Create an external power supply for the board, using the 4-pin AMP connector that would normally go straight to the DB-9 serial connector. This isn't really a necessary part of the USB conversion, but it is convenient, allowing us to program the board with just one connection to the computer (instead of having a connection for power in addition to the connection for programming). Since all of the boards described on this website already have a voltage limiter, it is sufficient to just directly hook up a 9-volt battery. Many of these boards do not have a mechanism to protect against reverse polarity, so be sure to hook up the cable correctly. The correct pins for power and ground are labeled on all of the hello-world series of boards.
Step 2:
serial AMP MTA plug <-> DB9F cable (wire side view):
Tx GND
| 2 1 |
3 4
Rx DTR
plug 3 2 4 1
DCD Rx Tx DTR GND
DSR RTS CTS RI
DB9 1 2 3 4 5
DB9 6 7 8 9
Step 3: Create a cable that directly connects one 5-pin AMP connector to another. Both connectors should be oriented in the same direction (notice in the picture, if you look at the connectors with the space for the MTA tab towards the top of the page, the white wire is on the right side for both).
Step 4: Create a connector from a 5-pin AMP to a DB-9 female. This will be our programming cable. The appropriate wiring diagram is:
in-circuit programming AMP MTA plug <-> DB9F
serial (dasa) cable (wire side view):
^
| cable direction
3 5 8
| MOSI (3) GND (2) MISO (1) |
-RESET (4) SCK (5)
7 4
plug 4 3 1 5 2
DCD Rx Tx DTR GND
DSR RTS CTS RI
DB9 1 2 3 4 5
DB9 6 7 8 9
Step 5: Create a board that will act as a serial programming voltage limiter. The cad.py specification is here
Step 6: Get a USB to DB-9 male converter cable
Step 7: Program your microcontroller. In the photo here, we are using the battery as an external power supply (connected to the 4-pin AMP/MTA connector) and programming using serial over USB. If using avrdude, you need to tell the program which port to use (-P /dev/ttyUSB0), as well as what type of connection you have (-c dasa): avrdude -p t45 -P /dev/ttyUSB0
-c dasa -U flash:w:file.hex
Step 8: Send data to the computer. In the photo here, our board has a microphone picking up audio signals, and is sending the data to the USB port on the laptop computer.
|
|||||||||||||||||