AVR microcontroller download environment construction

© 2012-2023 Conmajia.

foreword

I used to be obsessed with single-chip microcomputers for a while in college, until I found that this kind of college life that does not pick up girls and does not loose is equivalent to pure nits. When I woke up, I immediately dropped it and avoided it. But in fact, after many years, even though I have already wiped out my interest in science, I always see my young self like He is playing electronic production like a dick.

So one day when I woke up from a hangover, I got a hundred or so AVR and ARM movies. Maybe it will be tiring to play.

After many years of graduation, I threw away the download cable long ago, and thought of DIYing a pair of it with the device in hand, which is recorded in this article.

Hardware articles: download line

circuit diagram

The circuit diagram uses a simplified version of the classic SI-Prog download line, as shown below:

Figure 1. Download line circuit diagram

equipment

The circuit diagram is so simple that it explodes. Anyway, I am embarrassed to make a board or something, so I just go straight to the hole board.

equipment model quantity
resistance 4.7 kΩ 3
resistance 10 kΩ 2
diode 1N4733 2
Triode C8050 1
plug DS-9 1
socket DH-10S 1

like this:

Finished product after welding:

In fact, the hardware part is very simple, as long as you are not a lip pencil, you really have hands.

Tell me, are you a lip pencil? ah?

Software: PonyProg

Introduction

After the download line is completed, the hardware part is all OK, and the next step is to install the programming software. The software that can perfectly fit this old-fashioned circuit is the old-fashioned PonyProg. Pony, which means pony, is also the name of a famous Huatenger.

Officially, PonyProg is an old open source programming software produced by Claudio Lanconelli, and the latest version is PonyProg 2000 v2.07c. 2000, you can tell its year just by looking at its name. This gadget supports a full range of microcontrollers from Atmel and PIC, as well as EEPROMs with I2C, Microwire, and SPI interfaces, such as a bunch of old electronic waste from Intel and Philips. For the detailed introduction and specifications of PonyProg, you can read this page, if you are really bored: http://www.lancos.com/prog.html.

Most players like to call it "Little Horse", because its logo is the head of a pony, and it is also to commemorate a certain Huateng called Xiaoma. It is said that it is a horse that the author Claudio often rides, and its name is Pony. In order to commemorate his horse, this software is named PonyProg (Pony Programmer). Now, of course, he has no horses.

You can download the latest version of PonyProg from Claudio's personal homepage http://www.lancos.com.

Although the latest stable version is v2.06, it is not recommended to download because it does not support newer AVR MCUs (such as tiny13)... Really new haha.

Instructions

bus timing alignment

When running PonyProg for the first time, the bus timing calibration operation must be performed first. This is because PonyProg uses software to simulate the timing signals required for MCU programming. Since each computer’s CPU main frequency, bus frequency, system performance and other factors are different, it is necessary to calibrate the current computer first.

Before calibration, close other programs running on the computer to avoid affecting the calibration results.

The calibration method is as follows, click the menu "Setup-Calibration" to calibrate, as shown in the figure:

The software will pop up a confirmation prompt box:

English roughly means: "Bus timing calibration. You need to make sure that only PonyProg 2000 is running (CPU and hard disk should be idle at this time). Calibration will take a few seconds. Do you want to calibrate?".

Select "Yes" and the software will start the calibration. The calibration operation takes about 10 seconds, and it is best not to perform other operations during this period. Of course, it doesn't really matter, only junk computers need to pay attention to these.

After the calibration is completed, the software will prompt:

interface settings

Next you need to set up SI-Prog. Open the menu "Setup-Interface Setup":

 Bring up the interface settings window:

 

Set the interface mode "Serial" and "SI Prog API" according to the content in the figure, and select the corresponding serial port on the computer. Generally, the physical serial port is "COM1", and the USB to 232 serial port is "COMn". found in Device Manager".

The control line polarity options "Select Polarity of the Control lines" are all left blank.

After the setting is complete, click the "Probe" button to test it. If this window pops up:

 It means that the hardware is working properly and you can start programming.

programming

select device

First select the corresponding MCU/device model. On the main interface of PonyProg, you can see the device selection bar:

Just select the corresponding model.

read data

After connecting the MCU and the download cable, click the "Read All" button to read the contents of the device. If the hardware is normal, a reading progress bar will appear. After the reading is completed, the read program content will be displayed in binary in the window.

data input

After connecting the microcontroller and the download cable, click "Open Device File" to open the program file to be burned (such as *.hex file in Intel HEX format), and the main window will display the file content for you to preview. Then click the "Write All" button to write to the device. There will be a corresponding prompt after success.

error handling

If "Error -24" such as "Unknown device" appears during programming, it means that your connection is wrong. It may be that the line sequence of the MCU is wrong. This can be connected by referring to the MCU datasheet. It is also possible that there is a soldering error, which requires changing the board.

If "Error -23" of "Bad device" appears, it means that the device is not selected correctly and needs to be reselected. If you can't find the corresponding device, try installing the latest version of PonyProg.

epilogue

After half an hour of hard work, you can start endless single-chip games in the future.

Let's start happy!

(over)

Guess you like

Origin blog.csdn.net/conmajia/article/details/8441530