1. Trang chủ
  2. » Giáo án - Bài giảng

HOW TO BUILD AN AVR PROGRAMMER tarilayefa edward

61 74 0

Đang tải... (xem toàn văn)

Tài liệu hạn chế xem trước, để xem đầy đủ mời bạn chọn Tải xuống

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

Các công cụ chuyển đổi và chỉnh sửa cho tài liệu này

Nội dung

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 1

HOW TO BUILD AN AVR PROGRAMMER

By Tarilayefa Edward

Trang 2

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

Trang 3

2

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 4

3

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 5

4

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 7

6

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 8

7

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 9

8

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 10

9

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 11

10 Fig 2.3

Fig 2.4

Trang 13

12

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

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

Trang 14

13

Fig 2.9 The fourth icon is “Write Device”

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

Trang 15

14

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 16

15

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 17

16

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 18

17

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 19

18 Fig 3.9 Open your Arduino IDE and select Arduino/Genuino Uno board

Trang 20

19

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 21

20

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 22

21

Fig 4.3

Fig 4.4 Click on “Write to Device”

Trang 23

22

Fig 4.5 Click “Yes”

Fig 4.6

Trang 24

23 Fig 4.7

Fig 4.8

Trang 25

24

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 26

25

2 USB AVR PROGRAMMER (USBASP)

Fig 5.0

Fig 5.1

Trang 27

26

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 28

27

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 29

28

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 30

29

Fig 5.6 Locate the usbasp firmware for atmega88 that you have downloaded and click open

Fig 5.7

Click “Yes”

Trang 31

30

Fig 5.8

Fig 5.9 Remove the atmega88 from the breadboard and mount it on the usbasp programmer you have constructed

Trang 34

33 Fig 6.5 Connect an atmega328 to the usbasp programmer

Trang 35

34 Fig 6.6

Fig 6.7

Trang 36

35

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 37

36

Fig 7.0 Select “Install the software automatically” and click next

Fig 7.1

Trang 38

37

Fig 7.2

Fig 7.3 Click “Finish”

Trang 39

38

Fig 7.4 Reconnect the atmega328 to the usbasp programmer and connect it to your computer

Fig 7.5 Open avrdudes software

Trang 40

39 Fig 7.6 Select your programmer – USBasp

Trang 41

40 Fig 7.7 Click “Detect”

Trang 42

41

Fig 7.8

To flash an atmega328, type the values as shown above on the Fuses & lock bits and click “Write”

Trang 43

42

Fig 7.9 Open your arduino IDE, select arduino uno board, write a simple led blink sketch and compile it

Trang 44

43 Fig 8.0

Trang 45

44

Fig 8.1 Use your usbasp programmer to download the compiled hex file to the atmega328 as shown below

Trang 46

45 Fig 8.2

Trang 47

46

Fig 8.3

Fig 8.4 After Selecting the flash file, Click “Program”

Trang 48

47 Fig 8.5

Trang 49

48 Fig 8.6

Trang 50

49

Fig 8.7

Fig 8.8 Open your extreme burner AVR software

Trang 51

50 Fig 8.9 Select atmega328P

Trang 52

51 Fig 9.0 Click “Read All”

Trang 53

52 Fig 9.1

Trang 54

53 Fig 9.2

Trang 55

54

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 56

55 Fig 9.4

Trang 57

56 Fig 9.5 Upload the compiled blink sketch with bootloader to atmega328P

Trang 58

57 Fig 9.6 Click “Write All”

Trang 59

58 Fig 9.7

Trang 60

59

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 61

60

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 //

Ngày đăng: 16/12/2019, 17:09

TỪ KHÓA LIÊN QUAN

w