Tải bản đầy đủ (.pdf) (61 trang)

HOW TO BUILD AN AVR PROGRAMMER tarilayefa edward

Bạn đang xem bản rút gọn của tài liệu. Xem và tải ngay bản đầy đủ của tài liệu tại đây (3.74 MB, 61 trang )

HOW TO BUILD AN AVR PROGRAMMER
By
Tarilayefa Edward
, 08184754883, 08062251186
Tari Electronics & Embedded Systems (TEES)

16/11/2017


INTRODUCTION
What is AVR?
AVR is a family of microcontrollers developed by Atmel beginning in 1996. These
are modified Harvard architecture 8-bit RISC single-chip microcontrollers. AVR
was one of the first microcontroller families to use on-chip flash memory for
program storage, as opposed to one-time programmable ROM, EPROM, or
EEPROM used by other microcontrollers at the time.
AVR microcontrollers find many applications as embedded systems; they are also
used in the Arduino line of open source hardware board designs.
What is AVR Programmer?
An AVR Programmer is computer hardware for downloading firmware to an AVR
microcontroller.
There are different types of AVR programmers based on type of computer
interface
1. Parallel Port AVR Programmer (uses computer’s parallel port).
2. SERIAL PORT AVR PROGRAMMER (uses computer’s serial port).
3. USB AVR PROGRAMMER (uses computer’s USB port).
The parallel port AVR programmer is a kind of old school. You hardly find
people using it now.
Modern Laptop Computers only have USB ports. Although, we still find some
computers around with both USB and Serial Ports.
USB programmers are currently widely used; serial port programmers are also


still used.
We cannot build a USB AVR programmer without using another existing
programmer to download firmware to the host AVR microcontroller used.
We are going to build a Serial Port AVR Programmer without any firmware.
1


This AVR programmer is very cheap and easy to build by any one.
If you have a friend who has an AVR Programmer, you can skip building this
Serial Port Programmer and proceed to the USB AVR Programmer because you
will need an existing programmer when building a USB programmer involving
a microcontroller.
We will flash an Atmega88 AVR Microcontroller that will be used for our USB
AVR Programmer with the Serial Port AVR Programmer.

The following software will be needed:
a. Ponyprog2000 - />This software will be used for the serial port AVR programmer.
The software below will be used for the USB AVR programmer, especially the Avrdudes and
Extreme burner AVR.
b. Avrdudes - />c. Extreme burner AVR –
/>d. Khazama AVR –

2


1. SERIAL PORT AVR PROGRAMMER (PONYPROG)

Fig 1.0 Serial port AVR Programmer picture

Fig 1.1 Serial port AVR Programmer circuit


The circuit shown in fig 1.1 is used for the construction of the serial port AVR
programmer.

3


Fig 1.2 Serial port cable

After finishing the construction, test it by connecting the programmer to a
computer with real serial port (do not use a USB serial port) using the female to
female DB9 serial cable shown in Fig 1.2 and assemble it in a plastic case.

4


Fig 1.3 Atmega328P on Breadboard

Mount the Atmega328 AVR on a breadboard following the circuit below.

Fig 1.4 Atmega328P connection circuit

5


Fig 1.5 Atmega328P on Breadboard connected to serial port AVR programmer

Connect the serial port AVR programmer to the Atmega328 on the breadboard
as shown above.
Download and install the PonyProg2000 v208d on your computer.


Fig 1.6
6


Open the PonyProg2000 software as shown above and click ok.

Fig 1.7

Goto to Setup and click on Interface Setup.

Fig 1.8

You need to select the COM port number on your computer in which your
programmer is connected.
7


Fig 1.9

Select “SI Prog I/O”.

Fig 2.0

Make sure your programmer is connected properlly and powered.
Click on “Probe” to detect the programmer.
8


Fig 2.1


You will receive a notice showing “Test Ok”.
Click “OK” and close the I/O Setup.

Fig 2.2

Click on “Device” ,move down to AVR micro and locate “Atmega328”.

9


Fig 2.3

Fig 2.4

10


Fig 2.5

Fig 2.6

On the second row of icons, the first icon is “Read Device”.
11


Fig 2.7

The second icon is “Read program Memory (Flash)”.


Fig 2.8

The third icon is “Read Data Memory (EEPROM)”.

12


Fig 2.9

The fourth icon is “Write Device”.

Fig 3.0

The fifth icon is “Write Program Memory (FLASH)”.

13


Fig 3.1

The sixth icon is “Write Data Memory (EEPROM)”.
The seventh icon is “Erase Device” followed by “Security and Configuration
Bits”.

Fig 3.2

Click on “Read Device”.
14



Fig 3.3

If your programmer is properly constructed and properly connected to the
Atmega328 on the breadboard our device will be Read successfully, otherwise,
there will be an error.

Fig 3.4

15


Fig 3.5

Click on “Security and Configuration Bits” icon.

Fig 3.6

Check the “BOOTSZ0” and “BODLEVEL0” check boxes while the rest are
unchecked. This is for Atmega328 only. Be careful! Any wrong setting will
render your AVR microcontroller unusable. Click Write and then OK.

16


Your Atmega328 is now flashed with the correct fuse setting, and will remain
so permanently until you change it. This will enable it work with an external
16MHz crystal with Arduino platform.

Fig 3.7


To erase the memory of your Atmega328, click on the “Erase Device” icon.

Fig 3.8
17


Fig 3.9

Open your Arduino IDE and select Arduino/Genuino Uno board.

18


Fig 4.0

Write a simple blink sketch (Arduino Program) save it with name “blink” and
compile it. You can find the location of the hex file, “Arduino_blink.ino.hex” at
the buttom of the Arduino IDE, output window.

19


Fig 4.1

Go back to your PonyProg2000 and click on the second icon on the first row.

Fig 4.2

Select “Files of type: .hex”.
Browse and locate the “Arduino_blink.ino.with_boothloader.hex” and click

open.

20


Fig 4.3

Fig 4.4

Click on “Write to Device”.

21


Fig 4.5

Click “Yes”.

Fig 4.6

22


Fig 4.7

Fig 4.8

23



Fig 4.9

If you have done everything correctly the LED on pin19 (Arduino pin 13) on
the Atmega328 will blink at the rate of 1sec. Congratulation!
You have successfully built your Serial Port AVR programmer and known how
to flash Atmega328 AVR with it and also how to download Arduino compiled
hex file to Atmega328 with it.
You can now proceed to build your USB AVR Programmer (USBAsp).

24


×