Parallel Port AVR Programmer uses computer’s parallel port.. SERIAL PORT AVR PROGRAMMER uses computer’s serial port.. We cannot build a USB AVR programmer without using another existing
Trang 1HOW TO BUILD AN AVR PROGRAMMER
By Tarilayefa Edward
Trang 2AVR 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
Trang 32
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
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
Trang 43
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
Trang 54
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
Trang 76
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
Trang 87
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
Trang 98
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
Trang 109
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”
Trang 1110 Fig 2.3
Fig 2.4
Trang 1312
Fig 2.7 The second icon is “Read program Memory (Flash)”
Fig 2.8 The third icon is “Read Data Memory (EEPROM)”
Trang 1413
Fig 2.9 The fourth icon is “Write Device”
Fig 3.0 The fifth icon is “Write Program Memory (FLASH)”
Trang 1514
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”
Trang 1615
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
Trang 1716
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
Trang 1817
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
Trang 1918 Fig 3.9 Open your Arduino IDE and select Arduino/Genuino Uno board
Trang 2019
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
Trang 2120
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
Trang 2221
Fig 4.3
Fig 4.4 Click on “Write to Device”
Trang 2322
Fig 4.5 Click “Yes”
Fig 4.6
Trang 2423 Fig 4.7
Fig 4.8
Trang 2524
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)
Trang 2625
2 USB AVR PROGRAMMER (USBASP)
Fig 5.0
Fig 5.1
Trang 2726
Fig 5.2 USBAsp USB AVR Programmer using Atmega88P circuit The following components will be used for the construction of the USBAsp USB AVR Programmer:
i Atmega88P AVR *1
ii Crystal 12MHz *1
iii Ceramic capacitors 22p *2, 100n*1
iv Electrolytic Capacitors 1000uF10*1
v 28pin DIL IC Socket
vi Female USB Port Connector
vii Zener Diode 3.6v *2, 5.1v*1
viii Resistors 2.2k*1, 68ohms*2, 1k*3, 10k*1
ix Two pin Jumpers*3
x Vero board
Trang 2827
xi LEDs green, red and orange
xii Construction wires
xiii Wire connectors
After building the usbasp circuit, download the USBAsp firmware for
Atmega88P and program the Atmega88P with it with the correct fuse bit setting using the Serial Port AVR programmer you have constructed
Fig 5.3 Connect the Atmega88 on a breadboard as in Fig 1.5 previously
Open the ponyprog2000 software and select ATmega88
Trang 2928
Fig 5.4 Click on the fuse bit setting and tick only the three check boxes as shown above
Fig 5.5 Click “write” and wait for it to complete
Trang 3029
Fig 5.6 Locate the usbasp firmware for atmega88 that you have downloaded and click open
Fig 5.7
Click “Yes”
Trang 3130
Fig 5.8
Fig 5.9 Remove the atmega88 from the breadboard and mount it on the usbasp programmer you have constructed
Trang 3433 Fig 6.5 Connect an atmega328 to the usbasp programmer
Trang 3534 Fig 6.6
Fig 6.7
Trang 3635
Fig 6.8 Disconnect the atmega328 from the usbasp and connect the usbasp programmer
to computer using a usb cable
Fig 6.9 Select “yes, this time only” and click “next”
Trang 3736
Fig 7.0 Select “Install the software automatically” and click next
Fig 7.1
Trang 3837
Fig 7.2
Fig 7.3 Click “Finish”
Trang 3938
Fig 7.4 Reconnect the atmega328 to the usbasp programmer and connect it to your computer
Fig 7.5 Open avrdudes software
Trang 4039 Fig 7.6 Select your programmer – USBasp
Trang 4140 Fig 7.7 Click “Detect”
Trang 4241
Fig 7.8
To flash an atmega328, type the values as shown above on the Fuses & lock bits and click “Write”
Trang 4342
Fig 7.9 Open your arduino IDE, select arduino uno board, write a simple led blink sketch and compile it
Trang 4443 Fig 8.0
Trang 4544
Fig 8.1 Use your usbasp programmer to download the compiled hex file to the atmega328 as shown below
Trang 4645 Fig 8.2
Trang 4746
Fig 8.3
Fig 8.4 After Selecting the flash file, Click “Program”
Trang 4847 Fig 8.5
Trang 4948 Fig 8.6
Trang 5049
Fig 8.7
Fig 8.8 Open your extreme burner AVR software
Trang 5150 Fig 8.9 Select atmega328P
Trang 5251 Fig 9.0 Click “Read All”
Trang 5352 Fig 9.1
Trang 5453 Fig 9.2
Trang 5554
Fig 9.3 Flashing atmega328p with extreme burner software
Enter the settings shown above on Low Fuse, High Fuse, Extended Fuse and click “Write”
Trang 5655 Fig 9.4
Trang 5756 Fig 9.5 Upload the compiled blink sketch with bootloader to atmega328P
Trang 5857 Fig 9.6 Click “Write All”
Trang 5958 Fig 9.7
Trang 6059
Fig 9.8
You have successfully known how to build a Serial Port and USB AVR
Programmer and also known how to flash your atmega328P AVR
microcontroller
Congratulations
Trang 6160
Using USBAsp AVR programmer:
Atmega88P fuse setting for usbasp firmware
//Flashing fuse bit setting for Atmega328p: LF: 0XFF // HF: 0XDE //
//Flashing fuse bit setting for Atmega8: LF: 0XDF //
//Flashing fuse bit setting for Atmega32: LF: 0X3F //