Your SlideShare is downloading. ×
Vertical scrolling in 20x4 alphanumeric lcd with avr atmega16 microcontroller Circuit diagram and C program/ C code ablab solutions
Vertical scrolling in 20x4 alphanumeric lcd with avr atmega16 microcontroller Circuit diagram and C program/ C code ablab solutions
Vertical scrolling in 20x4 alphanumeric lcd with avr atmega16 microcontroller Circuit diagram and C program/ C code ablab solutions
Vertical scrolling in 20x4 alphanumeric lcd with avr atmega16 microcontroller Circuit diagram and C program/ C code ablab solutions
Vertical scrolling in 20x4 alphanumeric lcd with avr atmega16 microcontroller Circuit diagram and C program/ C code ablab solutions
Vertical scrolling in 20x4 alphanumeric lcd with avr atmega16 microcontroller Circuit diagram and C program/ C code ablab solutions
Vertical scrolling in 20x4 alphanumeric lcd with avr atmega16 microcontroller Circuit diagram and C program/ C code ablab solutions
Vertical scrolling in 20x4 alphanumeric lcd with avr atmega16 microcontroller Circuit diagram and C program/ C code ablab solutions
Vertical scrolling in 20x4 alphanumeric lcd with avr atmega16 microcontroller Circuit diagram and C program/ C code ablab solutions
Upcoming SlideShare
Loading in...5
×

Thanks for flagging this SlideShare!

Oops! An error has occurred.

×
Saving this for later? Get the SlideShare app to save on your phone or tablet. Read anywhere, anytime – even offline.
Text the download link to your phone
Standard text messaging rates apply

Vertical scrolling in 20x4 alphanumeric lcd with avr atmega16 microcontroller Circuit diagram and C program/ C code ablab solutions

155

Published on

Published in: Technology, Business
0 Comments
0 Likes
Statistics
Notes
  • Be the first to comment

  • Be the first to like this

No Downloads
Views
Total Views
155
On Slideshare
0
From Embeds
0
Number of Embeds
0
Actions
Shares
0
Downloads
0
Comments
0
Likes
0
Embeds 0
No embeds

Report content
Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
No notes for slide

Transcript

  • 1. ABLab Solutions Vertical scrolling in 20X4 LCD with ATmega16 1
  • 2. ABLab Solutions Sneha Palace, Plot No.60,Laxmi Vihar, Near Appolo Hospital, Bhubaneswar-751005 Website: www.ablab.in | E-mail: info@ablab.in | Ph: 91-674-6573832 Table of Contents Project Description .................................................................................................... 3 Hardwares Required .................................................................................................. 3 Softwares Required ................................................................................................... 3 C Program.................................................................................................................. 3 Connection Guide ...................................................................................................... 8 Update Yourself......................................................................................................... 9 2
  • 3. ABLab Solutions Sneha Palace, Plot No.60,Laxmi Vihar, Near Appolo Hospital, Bhubaneswar-751005 Website: www.ablab.in | E-mail: info@ablab.in | Ph: 91-674-6573832 Project Description In this project, we will interface 20X4 alphanumeric LCD with ATmega16 microcontroller and we will display “ABLab Solutions” in 1st row, “Bhubaneswar” in 2nd row, “www.ablab.in” in 3rd row & “info@ablab.in” in 4th row of 20X4 alphanumeric LCD. Then, we will scroll the displayed characters from bottom to top. Hardwares Required  AVR Trainer Board-100-1pcs  AVR USB Programmer-1pcs  12V DC Adapter-1pcs  20X4 Alphanumeric LCD(JHD162A)-1pcs  1 to 1 Connector-3pcs  10 to 10 FRC Female Connector-2pcs  USB AM-AF Cable(Optional)-1pcs Softwares Required  AVR Studio 4  WinAVR -2010  SinaProg Hex Downloader  USBasp Driver C Program //**************************************************************// //Microcontroller :ATmega16 //System Clock :1MHz //Project :Vertical scrolling in 20X4 LCD with ATmega16 //AVR Compiler :AVR-GCC 4.3.2 //Author :ABLab Solutions // :www.ablab.in // :info@ablab.in //Date :1st January 2012 //**************************************************************// 3
  • 4. ABLab Solutions Sneha Palace, Plot No.60,Laxmi Vihar, Near Appolo Hospital, Bhubaneswar-751005 Website: www.ablab.in | E-mail: info@ablab.in | Ph: 91-674-6573832 #include<avr/io.h> /*Includes io.h header file where all the Input/Output Registers and its Bits are defined for AVR microcontroller*/ #define F_CPU 1000000 /*Defines a macro for the delay.h header file. F_CPU is the microcontroller frequency value for the delay.h header file. Default value of F_CPU in delay.h header file is 1000000(1MHz)*/ #include<util/delay.h> /*Includes delay.h header file which defines two functions, _delay_ms (millisecond delay) and _delay_us (microsecond delay)*/ #define LCD_DATA_PORT PORTB /*Defines a macro for the lcd.h header File. LCD_DATA_PORT is the microcontroller PORT Register to which the data pins of the LCD are connected*/ #define LCD_CONT_PORT PORTD /*Defines a macro for the lcd.h header File. LCD_CONT_PORT is the microcontroller PIN Register to which the control pins of the LCD are connected*/ #define LCD_RS PD0 /*Defines a macro for the lcd.h header file. LCD_RS is the microcontroller Port pin to which the RS pin of the LCD is connected*/ #define LCD_RW PD1 /*Defines a macro for the lcd.h header file. LCD_RW is the microcontroller Port pin to which the RW pin of the LCD is connected*/ #define LCD_EN PD2 /*Defines a macro for the lcd.h header file. LCD_EN is the microcontroller Port pin to which the EN pin of the LCD is connected*/ #include<avr/lcd.h> /*Includes lcd.h header file which defines all the functions for all Alphanumeric LCD*/ 4
  • 5. ABLab Solutions Sneha Palace, Plot No.60,Laxmi Vihar, Near Appolo Hospital, Bhubaneswar-751005 Website: www.ablab.in | E-mail: info@ablab.in | Ph: 91-674-6573832 void main(void) { DDRB=0xff; /*All pins of PortB are declared output (data pins of LCD are connected)*/ DDRD=0x07; /*PD0, PD1 and PD2 pins of PortD are declared output (control pins of LCD connected)*/ unsigned char first_row_lcd_display[]="ABLab Solutions", second_row_lcd_display[]="Bhubaneswar", third_row_lcd_display[]="www.ablab.in", fourth_row_lcd_display[]="info@ablab.in"; /*Variable declarations*/ lcd_init(); /*LCD initialization*/ /*Start of infinite loop*/ while(1) { lcd_string_write(first_row_lcd_display); /*String display in 1st row of LCD*/ lcd_command_write(0xc0); /*Cursor moves to 2nd row 1st column of LCD*/ lcd_string_write(second_row_lcd_display); /*String display in 2nd row of LCD*/ lcd_command_write(0x94); /*Cursor moves to 3rd row 1st column of LCD*/ lcd_string_write(third_row_lcd_display); /*String display in 3rd row of LCD*/ lcd_command_write(0xd4); /*Cursor moves to 4th row 1st column of LCD*/ 5
  • 6. ABLab Solutions Sneha Palace, Plot No.60,Laxmi Vihar, Near Appolo Hospital, Bhubaneswar-751005 Website: www.ablab.in | E-mail: info@ablab.in | Ph: 91-674-6573832 lcd_string_write(fourth_row_lcd_display); /*String display in 4th row of LCD*/ _delay_ms(500); /*500ms delay*/ lcd_command_write(0x01); /*Clear screen*/ lcd_string_write(second_row_lcd_display); /*String display in 1st row of LCD*/ lcd_command_write(0xc0); /*Cursor moves to 2nd row 1st column of LCD*/ lcd_string_write(third_row_lcd_display); /*String display in 2nd row of LCD*/ lcd_command_write(0x94); /*Cursor moves to 3rd row 1st column of LCD*/ lcd_string_write(fourth_row_lcd_display); /*String display in 3rd row of LCD*/ lcd_command_write(0xd4); /*Cursor moves to 4th row 1st column of LCD*/ lcd_string_write(first_row_lcd_display); /*String display in 4th row of LCD*/ _delay_ms(500); /*500ms delay*/ lcd_command_write(0x01); /*Clear screen*/ lcd_string_write(third_row_lcd_display); /*String display in 1st row of LCD*/ 6
  • 7. ABLab Solutions Sneha Palace, Plot No.60,Laxmi Vihar, Near Appolo Hospital, Bhubaneswar-751005 Website: www.ablab.in | E-mail: info@ablab.in | Ph: 91-674-6573832 lcd_command_write(0xc0); /*Cursor moves to 2nd row 1st column of LCD*/ lcd_string_write(fourth_row_lcd_display); /*String display in 2nd row of LCD*/ lcd_command_write(0x94); /*Cursor moves to 3rd row 1st column of LCD*/ lcd_string_write(first_row_lcd_display); /*String display in 3rd row of LCD*/ lcd_command_write(0xd4); /*Cursor moves to 4th row 1st column of LCD*/ lcd_string_write(second_row_lcd_display); /*String display in 4th row of LCD*/ _delay_ms(500); /*500ms delay*/ lcd_command_write(0x01); /*Clear screen*/ lcd_string_write(fourth_row_lcd_display); /*String display in 1st row of LCD*/ lcd_command_write(0xc0); /*Cursor moves to 2nd row 1st column of LCD*/ lcd_string_write(first_row_lcd_display); /*String display in 2nd row of LCD*/ lcd_command_write(0x94); /*Cursor moves to 3rd row 1st column of LCD*/ lcd_string_write(second_row_lcd_display); /*String display in 3rd row of LCD*/ 7
  • 8. ABLab Solutions Sneha Palace, Plot No.60,Laxmi Vihar, Near Appolo Hospital, Bhubaneswar-751005 Website: www.ablab.in | E-mail: info@ablab.in | Ph: 91-674-6573832 lcd_command_write(0xd4); /*Cursor moves to 4th row 1st column of LCD*/ lcd_string_write(third_row_lcd_display); /*String display in 4th row of LCD*/ _delay_ms(500); /*500ms delay*/ lcd_command_write(0x01); /*Clear screen*/ } } /*End of Program*/ Connection Guide The step-by-step procedure for Vertical scrolling in 20X4 LCD interfacing with ATmega16 are as follows:  Insert the DC Pin of 12V DC Adapter to the DC Socket of AVR Trainer Board-100.  Connect PORTB header with LCD data header of AVR Trainer Board-100 with a 10 to 10 FRC Female Connector.  Connect RS, RW & EN pin of LCD control header with PD0, PD1 & PD2 pin of PORTD header respectively of AVR Trainer Board-100 with 1 to 1 Connectors.  Connect the ISP Header of AVR Trainer Board-100 with AVR USB Programmer Header with a 10 to 10 FRC Female Connector.  Connect the 20X4 Alphanumeric LCD to the LCD Header of AVR Trainer Board- 100.  Connect the AVR USB Programmer to the PC/Laptop’s USB Port.  Switch on the power with the help of Power Switch of AVR Trainer Board-100.  Download the Vertical scrolling in 20X4 LCD interfacing with ATmega16 Hex file to AVR Trainer Board-100.  See the output. 8
  • 9. ABLab Solutions Sneha Palace, Plot No.60,Laxmi Vihar, Near Appolo Hospital, Bhubaneswar-751005 Website: www.ablab.in | E-mail: info@ablab.in | Ph: 91-674-6573832 Update Yourself For more Softwares, Tutorials, Sample Codes, Installation Guides, User Guides, User Manuals, Videos, Products & Components and Updates, Please Visit us at: www.ablab.in Mail us at: Info@ablab.in View us at: www.youtube.com/ablabsolutions Like us at: www.facebook.com/ablab.in Join us at: www.facebook.com/groups/ablabsolutions 9

×