Tài liệu hạn chế xem trước, để xem đầy đủ mời bạn chọn Tải xuống
1
/ 61 trang
THÔNG TIN TÀI LIỆU
Thông tin cơ bản
Định dạng
Số trang
61
Dung lượng
3,74 MB
Nội dung
HOW TO BUILD AN AVR PROGRAMMER By Tarilayefa Edward tarielect.edward@gmail.com, 08184754883, 08062251186 Tari Electronics & Embedded Systems (TEES) tariembeddedsys@gmail.com 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 Parallel Port AVR Programmer (uses computer’s parallel port) SERIAL PORT AVR PROGRAMMER (uses computer’s serial port) 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 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 - http://www.lancos.com/ppwin95.html 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 - http://blog.zakkemble.co.uk/avrdudess-a-gui-for-avrdude/ c Extreme burner AVR – http://digital-wizard.net/download.php?file_name=extreme_burner_avr_v1.4.3_setup.exe d Khazama AVR – http://www.khazama.com 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 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 Fig 1.3 Atmega328P on Breadboard Mount the Atmega328 AVR on a breadboard following the circuit below Fig 1.4 Atmega328P connection circuit 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 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 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 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” Fig 8.3 Fig 8.4 After Selecting the flash file, Click “Program” 46 Fig 8.5 47 Fig 8.6 48 Fig 8.7 Fig 8.8 Open your extreme burner AVR software 49 Fig 8.9 Select atmega328P 50 Fig 9.0 Click “Read All” 51 Fig 9.1 52 Fig 9.2 53 Fig 9.3 Flashing atmega328p with extreme burner software Enter the settings shown above on Low Fuse, High Fuse, Extended Fuse and click “Write” 54 Fig 9.4 55 Fig 9.5 Upload the compiled blink sketch with bootloader to atmega328P 56 Fig 9.6 Click “Write All” 57 Fig 9.7 58 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 59 Using USBAsp AVR programmer: Atmega88P fuse setting for usbasp firmware LF = 0xFF HF = 0xDD EF = 0x04 //Flashing fuse bit setting for Atmega88p: LF: 0XFF // HF: 0XDF // EF: 0X01 // // LB: 0X3C UNLOCK: 0X3F //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 // 60 ... without any firmware 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. .. 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. .. 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