ablelogic AVR-DK20A User manual

ablelogic
AVR Development Board
User Manual
Model: AVR-DK20A
ablelogic
Training System Manufactured & Designed by Vision Venture Technology Sdn Bhd (VVT)
URL: www.ablelogic.com.my or www.vvtec.com
Technical Support: enquiry@vvtec.com

AVR Development Board – AVR-DK20A User Manual
2
Table of Contents
Packing List................................................................................................................................... 4
Welcome........................................................................................................................................ 5
Chapter 1 – Introduction to AVR-DK20A.................................................................................. 6
1.1 AVR Development Board Features...................................................................................... 6
1.1.1 The AVR Development board supports the following Devices:................................... 6
1.2 Board Features...................................................................................................................... 6
1.3 Supplied Items ...................................................................................................................... 6
The AVR Development Kit Contains the Following:............................................................ 6
Chapter 2 – Getting Started........................................................................................................ 7
2.1 The AVR Development Board and Application Modules Layout........................................ 7
2.2a ISP connector pin.............................................................................................................. 10
2.2b PWM channel output pin.................................................................................................. 10
2.3 PIN Configuration of U1, U2 and U3................................................................................. 11
Chapter 3 – Schematic diagram.............................................................................................. 13
Chapter 4 - Basic Steps In Using The AVR-PRG1 USB Programmer.............................. 15
4.1 Steps to install the WinAVR and AVR Studio:.................................................................. 15
4.2 Steps to install the AVR USB Programmer, USB driver.................................................... 15
4.3 Installation of AVR8 Burn-O-Mat v2 software:................................................................. 17
Chapter 5 – Connecting the USB Programmer with the AVR-DK20A Development
Board............................................................................................................................................ 20
5.1 Using ISP Method............................................................................................................... 20
5.2 Setting for programming the AVR Using ISP Method: ..................................................... 21
5.3 Programming the hex file.................................................................................................... 21
Chapter 6 – Experiment Lab Exercise.................................................................................... 22
6.1 Experiment 1 – Blinking LEDs........................................................................................... 22
6.2 Experiment 2 – 8-Ways DIP Switches to 8 Output LEDs.................................................. 25
6.3 Experiment 3 – Drive Buzzer ON and OFF........................................................................ 27
6.4 Experiment 4 – 2 DIGIT SEVEN SEGMENT ................................................................... 28
6.5 Experiment 5 – LCD Display ............................................................................................. 29
6.6 Experiment 6 – Keypad & LCD ......................................................................................... 33
Appendix – Experiment and Tutorial Answer in MikroC ...................................................... 34
A.1 Experiment 1 – Output 55H to LEDs Display................................................................... 34
A.2 Tutorial 1a – Blinking LEDs.............................................................................................. 34

AVR Development Board – AVR-DK20A User Manual
3
A.3 Tutorial 1b – Running LEDs.............................................................................................. 34
A.4 Experiment 2 – Dip Switch to LEDs Display.................................................................... 35
A.5 Tutorial 2 – Sensing 01h to light ON 8-bit LEDs, else turn OFF LEDs............................ 35
A.6 Experiment 3 – Buzzer....................................................................................................... 36
A.7 Experiment 4 – 7-Segment 0-9 decimal counter................................................................ 36
A.8 Tutorial 3 – 7-Segment 00-99 decimal counter ................................................................. 37
A.9 Experiment 5 – Display “Hello World!” to LCD Display................................................. 38
A.10 Tutorial 4a – Display words to LCD 1st and 2nd row of the LCD Display....................... 39
A.11 Tutorial 4b – Scrolling Words on LCD Display.............................................................. 40
A.12 Experiment 6 – Keypad scanning to LEDs Display ........................................................ 42
A.13 Tutorial 5 – Keypad scanning to LCD Display................................................................ 44
A.14 Tutorial 6 – Keypad scanning to 7-Segment Display...................................................... 46

AVR Development Board – AVR-DK20A User Manual
4
Packing List
Before operating your AVR-DK20A, please ensure that you have the following items:
•AVR Development Board User Lab Manual
•AVR Development Board Utilities CD
•ATMEGA32L8PU(40-pin)
•Mini Jumpers
•2x16 LCD Display fitted on board
•AVR ISP Programmer – AVR-PRG1
•10-way Ribbon Cable – 1pcs
•9VDC 1A Adaptor x 1
•USB Cable x 1
•Serial Cable is optional item not included in the package

AVR Development Board – AVR-DK20A User Manual
5
Welcome
The AVR Development board has been designed with educational
documentation on how AVR micro-controllers works, along with working documentation
on how AVR micro-controllers works, along with working software examples which
demonstrate writing and developing software.
After exploring the features of the AVR and studying the examples provided, the board
provides a useful development tool on which ideas and designs can implemented, the
high configurability of the board enables the user to configure on-board & output
devices (such as LCD display) on any port lines the user’s application may require. The
high configurability also allows the user to bring in signals from other external circuits (if
suitable circuitry is not already present on board) to suit user applications.
The AVR-DK20A is designed as a AVR Development Board which works along with
connecting a AVR programmer using the on board ISP connector. All the on board
applications are open circuit, which mean you can connect the I/O according to your
own design by using any of the AVR I/O ports (e.g. PORTA, PORTB, PORTC, PORTD),
depends on the pinout of each microcontroller.
New users will require at a copy of AVR studio (or similar) to develop programs. Beside
using AVR Studio, you may also use WinAVR to develop your programs. For other High
Level design language, you can use C language.
The Board is supplied with a demonstration AVR device with demo program fitted.
Note: It is important to familiarize yourself with any emulators or simulators intended to
be used with the AVR-DK20A, before connecting them to the Development Board.
Information on configuring the AVR Development Board is detailed further in the
document, please read before using.
Thank you.

AVR Development Board – AVR-DK20A User Manual
6
Chapter 1 – Introduction to AVR-DK20A
1.1 AVR Development Board Features
1.1.1 The AVR Development board supports the following Devices:
•20 Pin Devices ATtiny2313
•28 Pin Devices ATmega8
•40 Pin Devices ATmega32L, ATmega16, ATmega8535L
1.2 Board Features
•LCD Display 16*2 Characters with Parallel Interface
•Matrix Keyboard 3*4 Switches
•Buzzer
•8 LEDs
•8 way input switches
•On-Board regulator
•Program mode or Running mode switch
•AVRMicro Reset
•Highly configurable (all I/O devices can be reprogrammed on different Port lines)
1.3 Supplied Items
The AVR Development Kit Contains the Following:
a) 1 x fully assembled AVR-DK20PCB with
b) 1 x 9V, 1A power adaptor
c) 1 x CD containing with working examples, AVR Studio software,
d) 1 x User manual
e) 1 x set of pin jumpers (for configuration)
f) 1 x demonstration AVR devices ATmega32L (fitted to the board)

AVR Development Board – AVR-DK20A User Manual
7
Chapter 2 – Getting Started
2.1 The AVR Development Board and Application Modules Layout

AVR Development Board – AVR-DK20A User Manual
8
The AVR Development comes with a demonstration AVR IC, ATmega32L. The application of
the AVR-DK20board is open architecture. You may connect the I/O ports to the specific
applications I/O by using the mini jumpers or jumper wires.
The following are the descriptions of the I/O ports:
P5 – Link to latest version EXP-AP application board
VR1 – Adjust the LCD contrast
DP0
DIP switch SW0
C0
Port C.0
CL1
Keypad Col1
RX
RS232 (RxD)
D0
Port D.0
L0
LED 0
B0
Port B.0
A
7448 (A)
BZ
Buzzer
A0
Port A.0
EN
LCD Enable
A1
Port A.1
TX
RS232 (TxD)
D1
Port D.1
L1
LED 1
B1
Port B.1
B
7448 (B)
DP1
DIP switch SW1
C1
Port C.1
CL2
Keypad Col2
RS
LCD Reset
A2
Port A.2
OC1B
TMR/CNT1
Comp B o/p
D4
Port D.4
L1
LED 2
B2
Port B.2
C
7448 (C)
DP2
DIP switch SW2
C2
Port C.2
CL3
Keypad Col3
RW
LCD RW
A3
Port A.3
OC1A
TMR/CNT1
Comp A o/p
D5
Port D.5
L1
LED 3
B3
Port B.3
D
7448 (D)
DP3
DIP switch SW3
C3
Port C.3
LD4
LCD D4
A4
Port A.4
OC2
TMR/CNT2
Comp o/p
D7
PortD.7
DP4
DIP switch SW4
C4
Port C.4
RW1
Keypad Row1
LD5
LCD D5
A5
Port A.5
L1
LED 4
B4
Port B.4
DIG1
7-SEG A
DP5
DIP switch SW5
C5
Port C.5
RW2
Keypad Row2
LD6
LCD D6
A5
Port A.6
L1
LED 5
B5
Port B.5
DIG2
7-SEG B
DP6
DIP switch SW6
C6
Port C.6
RW3
Keypad Row3
LD7
LCD D7
A5
Port A.7
L6
LED 6
B6
Port B.6
DP7
DIP switch SW7
C7
Port C.7
RW4
Keypad Row4
L7
LED 7
B7
Port B.7
LK23
LK1
LK9
LK17
LK25
LK2
LK10
LK18
LK26
LK5
LK11
LK12
LK15
LK13
LK14
LK16
LK4
LK19
LK21
LK22
LK27
LK28
LK6
LK29
LK3
LK24
LK7
LK20

AVR Development Board – AVR-DK20A User Manual
9
P5
1 PC0 40 GND
2 PC1 39 GND
3 PC2 38 NC
4 PC3 37 PA7
5 PC4 36 PA6
6 PC5 35 PA5
7 PC6 34 PA4
8 PC7 33 PA3
9 NC 32 PA2
10 NC 31 PA1
11 NC 30 PA0
12 NC 29 NC
13 NC 28 PB3
14 NC 27 PB4
15 PB0 26 PB5
16 PB1 25 PB6
17 PB2 24 PB7
NC – not connected

AVR Development Board – AVR-DK20A User Manual
10
2.2a ISP connector pin
ISP
JTAG
2.2b PWM channel output pin
VCC
GND
GND
GND
GND
MOSI
RST
SCK
MISO
TCK
TD0
TMS
GND
TD1
GND
VTREF
NSRST

AVR Development Board – AVR-DK20A User Manual
11
2.3 PIN Configuration of U1, U2 and U3
U1
U2

AVR Development Board – AVR-DK20A User Manual
12
U3
U1 – Can use for ATtiny2313.
U2 -Can use for ATmega8.
U3 -Can use for ATmega32, ATmega32L, ATmega16, ATmega8535L.

AVR Development Board – AVR-DK20A User Manual
13
Chapter 3 – Schematic diagram
For U1(20pins) and U2 (28pins), all the pins are opened. They are not connected to any
XTAL circuit. A wire can be use to connect the XTAL1 and XTAL2 pin to the external
XTAL circuit on board.
The /RESET pin of U1(20pins) and U2 (28pins) are also not connected to the external
reset circuit on board.

AVR Development Board – AVR-DK20A User Manual
14

AVR Development Board – AVR-DK20A User Manual
15
Chapter 4 - Basic Steps In Using The AVR-PRG1 USB
Programmer
Make sure to install WinAVR first before the USB programmer setup
4.1 Steps to install the WinAVR and AVR Studio:
1. Downloading the needed files from Beside AVR Studio 4, which is available at
http://atmel.com/avrstudio/, the most recent service pack for AVR Studio should be
downloaded, or from the CD provided.
2. The free WinAVR tool is required to program microcontrollers using C. WinAVR is
available for download at http://winavr.sourceforge.net/download.html or from the
CD provided.
3. Now installation can be started. WinAVR has to be installed first to ensure AVR studio
recognizes the GNU C-compiler as a plugin.
4. After finish install WinAVR. The installation for AVR Studio can be started and then
follow by the service pack for AVR Studio.
5. The properness of the AVR Studio installation which compatible with WinAVR can be
verified by creating a new AVR GCC project using project wizard. If WinAVR is installed
correctly, a message AVR GCC plugin can be seen at the message console in AVR
Studio as the figure below.
4.2 Steps to install the AVR USB Programmer, USB driver
1. Plug in the USB cable to the PC.
2. The PWR led and the RDY led will light up.
3. PC will pop up a message showing new hardware detected.
4. Choose “No, not this time” as the figure shown below.

AVR Development Board – AVR-DK20A User Manual
16
5. Then, click NEXT.
6. Then, choose the box with “Install from a list or specific location (Advnaced)” and click
NEXT again.
7. Then, make sure the setting is same as the figure below. Browse to the “Driver AVR-
PRG1” folder where the driver is. Click NEXT again.
8. Then, PC will start to install the driver.
9. Click finish when the driver is installed.
10. After install, the USB programmer is ready to be use.

AVR Development Board – AVR-DK20A User Manual
17
4.3 Installation of AVR8 Burn-O-Mat v2 software:
1. A free AVR8 Burn-O-Mat v2 installer can be downloaded from
http://www.brischalle.de/avr8_burn-o-mat_avrdude_gui/avr8_burn_o_mat_avrdude_gui_en.html
or from the CD provided.
2. After downloading, installation can be started by double click the setup.exe file.
3. After installed. Run the AVR8 Burn-O-Mat software.
4. Then click the setting tab and choose AVRDUDE.
5. Choose the setting as below.
6. Then click ok.
7. The software is ready to be use.

AVR Development Board – AVR-DK20A User Manual
18
4.4 Setting and Writing the Fuse for AVR IC
In order to make sure the PORTC of the AVR is working fine. We must disable the JTAG feature in
order to fully control and access the PORTC port of the AVR IC.
1. Click on the “Fuses” button.
2. Select File, select “load fuses from file”.

AVR Development Board – AVR-DK20A User Manual
19
3. A “Open File Windows” will be pop out. Select the avrfuse.xml file from the “..avr\avrfuse”
directory. You may find this in the AVR Utilities CD supplied. Click “Open” to load the file.
4. Set the DIP Switches to PROG, set the slide switch to PROG. Then select “Write fuses”. A
“Fuses successfully written” message will be pop up when finish write fuses.
Programmer DIP Switch
Setting
Programmer Slide Switch
beside the DC power jack,
Switch to “PROG”

AVR Development Board – AVR-DK20A User Manual
20
Chapter 5 – Connecting the USB Programmer with the AVR-
DK20A Development Board
5.1 Using ISP Method
Connect the 10-way IDE Cable at ISP of the AVR-DK20A Development Board and ICD10 at the
AVR-PRG1 USB programmer. Then connect the USB Cable to the USB port at the USB
Programmer AVR-PRG1.
The AVR Development Board comes with a demonstration AVR IC, ATMEGA32L8PU. The AVR
IC can be direct program on the AVR Development Board using ISP Method.
Table of contents