background image

 
 
 

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

 

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: [email protected] 

Summary of Contents for AVR-DK20A

Page 1: ...R 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 ...

Page 2: ...RG1 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 Ex...

Page 3: ...eriment 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...

Page 4: ...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 ...

Page 5: ...y 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...

Page 6: ...nterface 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 ...

Page 7: ...AVR Development Board AVR DK20A User Manual 7 Chapter 2 Getting Started 2 1 The AVR Development Board and Application Modules Layout ...

Page 8: ...t 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 Po...

Page 9: ...l 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 ...

Page 10: ...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 ...

Page 11: ...AVR Development Board AVR DK20A User Manual 11 2 3 PIN Configuration of U1 U2 and U3 U1 U2 ...

Page 12: ...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 ...

Page 13: ... 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 ...

Page 14: ...AVR Development Board AVR DK20A User Manual 14 ...

Page 15: ...vided 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 pro...

Page 16: ...ecific 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 ...

Page 17: ...w 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 ...

Page 18: ... 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 ...

Page 19: ...ectory 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 ...

Page 20: ...thod 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 ...

Page 21: ...am Mode by following the position of the PROG printed on the development board When want to run the program then the switches have to be switched to the position where the RUN is printed 5 3 Programming the hex file Select the File at the Flash section and choose the hex file to be program into the AVR IC then click Open Then click on the Write and program the hex file into the AVR Flash Programmi...

Page 22: ...Create a project output a value 55H hex on the 8 bit LEDs Flow Chart Port Setting information DDRB 0xFF Set direction to be output Expected Result You will see the 01010101 display on the 8 Bit LEDs display Tutorial 1 a Create a blinking LEDs project set all 8 bit LEDs on for 200 milisec and off for 200 milisec b Create a project drive the 8 bit LEDs in running light format Start Initialize I O In...

Page 23: ...AVR Development Board AVR DK20A User Manual 23 a Tutorial 1a Flow Chart Start Initialize I O Infinity Loop Set all LED ON Delay 200ms Set all LED OFF Delay 200ms ...

Page 24: ...rd AVR DK20A User Manual 24 b Tutorial 1b Flow Chart Start Initialize I O Infinity L Set y 1 Set t 0x80 Shift y 1 bit to left Output y to LED Delay 150ms i 7 Shift y 1 bit to right Output t to LED Delay 150ms i 7 Y N N Y ...

Page 25: ...eading input from the 8 input DIP switch and output result to 8 LEDs display Flow Chart Port Setting information DDRB 0xFF Set direction to be output PortB DDRC 0x00 Set direction to be input PortC Expected Result You will see what ever input you set from the DIP switch will display on the LEDs Display Tutorial 2 Create a project sensing 01h from DIP switch if 01h sensed light ON all 8 bit LEDs el...

Page 26: ...AVR Development Board AVR DK20A User Manual 26 Tutorial 2 Flow Chart Start Initialize I O Infinity Loop Reading input from DIP Switch 8 Bit LEDs ON Input 01h 8 Bit LEDs ON N Y ...

Page 27: ...nd OFF Jumper Setting LK1 A0 BZ Port Setting Set Port A bit 0 as output Objective Create a project set the buzzer on and off with delay Flow Chart Expected Result You will hear the buzzer On and Off Start Initialize I O Infinity Loop Set all buzzer ON Delay Set all buzzer OFF Delay ...

Page 28: ... a decimal counter project and count from 0 to 9 Flow Chart Expected Result You will see a decimal counter start from 0 counts until 9 and set back to 0 run continuously Tutorial 3 Create a project set a counter count from 00 to 99 continuously Start Initialize I O Infinity Loop Initial Counter 0 Output to 7 Segment Display Counter 9 Counter Counter 1 Counter 0 Output to 7 Segment Display No Yes ...

Page 29: ... Result You will see Hello World displayed on the LCD Screen Tutorial 4 a Create a project display 4 Bit LCD EXP on 1st row of the LCD and Hello World on 2nd row of the LCD display b Create a project display 4Bit LCD Display on 1st row and Example in 2nd row then Ablelogic AVRKit row and AVR DK20A 2nd row and scroll these two line continuously Start Initialize I O Infinity Loop LCD Initialization ...

Page 30: ...nt Board AVR DK20A User Manual 30 Tutorial 4a Flow Chart Start Initialize I O Infinity Loop LCD Initialization Clear LCD Screen and Set LCD Cursor OFF Displayed 4 Bit LCD EXP Displayed Hello World on 2 nd row of LCD ...

Page 31: ...b Flow Chart Start Initialize I O Infinity Loop LCD Initialization Clear LCD Screen and Set LCD Cursor OFF Displayed 4Bit LCD Display on 1 st row of LCD Exmaple on 2 nd row Clear Screen and display PIC ATS800 V2 on 1 st row and EXP PIC MOD 03 on 2 nd row A B ...

Page 32: ...AVR Development Board AVR DK20A User Manual 32 A Move text 7 times to left Shift LCD Display Move text 7 times right Shift LCD Display B Yes No Yes No ...

Page 33: ...t upper 4 bit as input Objective Create a project scan the key press from the 3x4 keypad and output value to 8 bit LEDs display Flow Chart Expected Result Scan the key press on the keypad and display a value on the LCD Display Tutorial 5 6 Modify the project when the key is press display the value on the LCD Display and 7 Segment Display Start Initialize I O Infinity Loop Displayed 0 On LED LCD 7 ...

Page 34: ... 1 A 2 Tutorial 1a Blinking LEDs Tutorial 1a Title Blinking LEDs Jumper for LEDs LK9 to LK16 Jumper Setting L0 B0 L1 B1 L2 B2 L3 B3 L4 B4 L5 B5 L6 B6 L7 B7 void main DDRB 0xFF Set direction to be output do PORTB 0x00 Turn OFF diodes on PORTB Delay_ms 200 1 second delay PORTB 0xFF Turn ON diodes on PORTB Delay_ms 200 1 second delay while 1 A 3 Tutorial 1b Running LEDs Tutorial 1b Title Running LEDs...

Page 35: ...ain int x DDRB 0xFF Set direction to be output DDRC 0x00 Set direction to be input PORTC 0x00 PORTB 0x00 do x PINC PORTB x reading input data from PORTC and output to PORTB while 1 A 5 Tutorial 2 Sensing 01h to light ON 8 bit LEDs else turn OFF LEDs Tutorial 2 Title Sensing 01 from DIP switch and light up all the LEDs else turn OFF all LEDs Jumper for LEDs LK9 to LK16 Jumper Setting LEDs L0 B0 L1 ...

Page 36: ... output do PORTA 0x01 Turn ON Buzzer Delay_ms 200 200ms delay PORTA 0x00 Turn OFF buzzer Delay_ms 200 200ms delay while 1 A 7 Experiment 4 7 Segment 0 9 decimal counter Experiment 4 Title A Decimal 7 segment display counter count from 0 to 9 Jumper for 7segment LK9 LK14 Jumper Setting B0 A B1 B B2 C B3 D B4 DIG1 B5 DIG2 int e j void main DDRB 0xff Set direction to be output do set ports j 0 for e ...

Page 37: ... for 7segment LK9 LK14 Jumper Setting B0 A B1 B B2 C B3 D B4 DIG1 B5 DIG2 unsigned char j g temp1 temp2 counter1 void main DDRB 0xff Set direction to be output j 0 g 0 while 1 for j 0 j 10 j if g 9 j 9 g 0 j 0 else if j 9 j 0 g for counter1 0 counter1 10 counter1 PORTB 0x20 temp1 PORTB temp2 j PORTB temp1 temp2 delay_ms 5 PORTB 0x10 temp1 PORTB temp2 g PORTB temp1 temp2 delay_ms 5 ...

Page 38: ...bit sbit LCD_D5 at PORTA5_bit sbit LCD_D6 at PORTA6_bit sbit LCD_D7 at PORTA7_bit sbit LCD_RS_Direction at DDA2_bit sbit LCD_EN_Direction at DDA1_bit sbit LCD_D4_Direction at DDA4_bit sbit LCD_D5_Direction at DDA5_bit sbit LCD_D6_Direction at DDA6_bit sbit LCD_D7_Direction at DDA7_bit End LCD module connections char txt1 Hello World void main DDRA 0xff PORTA3_bit 0 Lcd_Init Initialize LCD Lcd_Cmd ...

Page 39: ...RTA5_bit sbit LCD_D6 at PORTA6_bit sbit LCD_D7 at PORTA7_bit sbit LCD_RS_Direction at DDA2_bit sbit LCD_EN_Direction at DDA1_bit sbit LCD_D4_Direction at DDA4_bit sbit LCD_D5_Direction at DDA5_bit sbit LCD_D6_Direction at DDA6_bit sbit LCD_D7_Direction at DDA7_bit End LCD module connections char txt1 4 bit LCD EXP char txt2 Hello World void main DDRA 0xff PORTA3_bit 0 Lcd_Init Initialize LCD Lcd_C...

Page 40: ...6 at PORTA6_bit sbit LCD_D7 at PORTA7_bit sbit LCD_RS_Direction at DDA2_bit sbit LCD_EN_Direction at DDA1_bit sbit LCD_D4_Direction at DDA4_bit sbit LCD_D5_Direction at DDA5_bit sbit LCD_D6_Direction at DDA6_bit sbit LCD_D7_Direction at DDA7_bit End LCD module connections char txt1 Ablelogic AVRKit char txt2 AVR DK20A char txt3 4Bit LCD Display char txt4 Example char i Loop variable void main DDRA...

Page 41: ...er Manual 41 Lcd_Cmd _LCD_SHIFT_RIGHT delay_ms 500 while 1 Endless loop for i 0 i 8 i Move text to the left 7 times Lcd_Cmd _LCD_SHIFT_LEFT delay_ms 500 for i 0 i 8 i Move text to the right 7 times Lcd_Cmd _LCD_SHIFT_RIGHT delay_ms 500 ...

Page 42: ... void main DDRB 0xff PortB for Output PORTB 0 DDRC 0X0F PORTC0 C2 FOR COLUMN AS OUTPUT PORTC4 C7 FOR ROW AS INPUT PORTC 0X00 do PORTC 0x01 1st column if PINC4_bit 1 PORTB 0x00 delay_ms 100 if PINC5_bit 1 PORTB 0x03 delay_ms 100 if PINC6_bit 1 PORTB 0x06 delay_ms 100 if PINC7_bit 1 PORTB 0x09 delay_ms 100 PORTC 0x02 2nd column if PINC4_bit 1 PORTB 0x01 delay_ms 100 if PINC5_bit 1 PORTB 0x04 delay_m...

Page 43: ...AVR Development Board AVR DK20A User Manual 43 PORTB 0x05 delay_ms 100 if PINC6_bit 1 PORTB 0x08 delay_ms 100 if PINC7_bit 1 PORTB 0x0b delay_ms 100 while 1 ...

Page 44: ...6_bit sbit LCD_D7 at PORTA7_bit sbit LCD_RS_Direction at DDA2_bit sbit LCD_EN_Direction at DDA1_bit sbit LCD_D4_Direction at DDA4_bit sbit LCD_D5_Direction at DDA5_bit sbit LCD_D6_Direction at DDA6_bit sbit LCD_D7_Direction at DDA7_bit End LCD module connections int i void keypad unsigned void main DDRA 0xff PORTA3_bit 0 DDRC 0X0F PORTC0 C2 FOR COLUMN AS OUTPUT PORTC4 C7 FOR ROW AS INPUT PORTC 0X0...

Page 45: ...ut 1 i 1 delay_ms 100 if PINC5_bit 1 lcd_out 1 i 4 delay_ms 100 if PINC6_bit 1 lcd_out 1 i 7 delay_ms 100 if PINC7_bit 1 lcd_out 1 i A delay_ms 100 PORTC 0x04 3rd column if PINC4_bit 1 lcd_out 1 i 2 delay_ms 100 if PINC5_bit 1 lcd_out 1 i 5 delay_ms 100 if PINC6_bit 1 lcd_out 1 i 8 delay_ms 100 if PINC7_bit 1 lcd_out 1 i B delay_ms 100 while 1 ...

Page 46: ... void main DDRB 0xff PortB for Output PORTB 0x30 DDRC 0X0F PORTC0 C2 FOR COLUMN AS OUTPUT PORTC4 C7 FOR ROW AS INPUT PORTC 0X00 do PORTC 0x01 1st column if PINC4_bit 1 PORTB 0x20 delay_ms 100 if PINC5_bit 1 PORTB 0x23 delay_ms 100 if PINC6_bit 1 PORTB 0x26 delay_ms 100 if PINC7_bit 1 PORTB 0x29 delay_ms 100 PORTC 0x02 2nd column if PINC4_bit 1 PORTB 0x21 delay_ms 100 if PINC5_bit 1 PORTB 0x24 dela...

Page 47: ...AVR Development Board AVR DK20A User Manual 47 if PINC5_bit 1 PORTB 0x25 delay_ms 100 if PINC6_bit 1 PORTB 0x28 delay_ms 100 if PINC7_bit 1 PORTB 0x2b delay_ms 100 while 1 ...

Reviews: