• Like
  • Save
Pc to avr atmega16 microcontroller communication(led display) Circuit diagram and C program/ C code ablab solutions
Upcoming SlideShare
Loading in...5
×

Thanks for flagging this SlideShare!

Oops! An error has occurred.

Pc to avr atmega16 microcontroller communication(led display) Circuit diagram and C program/ C code ablab solutions

  • 1,741 views
Published

 

Published in Technology , Business
  • Full Name Full Name Comment goes here.
    Are you sure you want to
    Your message goes here
    Be the first to comment
No Downloads

Views

Total Views
1,741
On SlideShare
0
From Embeds
0
Number of Embeds
0

Actions

Shares
Downloads
0
Comments
0
Likes
2

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 PC to ATmega16 communication (LED display) 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 ...................................................................................................... 5 Update Yourself......................................................................................................... 6 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 PC with ATmega16 microcontroller using RS- 232 Driver and RealTerm software. Then, we will send data from PC to the microcontroller which can be seen in the RealTerm monitor and the LED array. We will repeat the above process. Hardwares Required  AVR Trainer Board-100-1pcs  AVR USB Programmer-1pcs  12V DC Adapter-1pcs  RS-232 Driver-1pcs  10 to 10 FRC Female Connector-3pcs  USB AM-AF Cable(Optional)-1pcs  USB to Serial Cable-1pcs Softwares Required  AVR Studio 4  WinAVR -2010  SinaProg Hex Downloader  USBasp Driver  RealTerm  USB to Serial Driver C Program //**************************************************************// //Microcontroller :ATmega16 //System Clock :8MHz //Baud Rate :9600 //Data Bits :8 //Stop Bits :1 //Parity :No Parity //Project :PC to ATmega16 Communication (LED display) //AVR Compiler :AVR-GCC 4.3.2 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 //Author :ABLab Solutions // :www.ablab.in // :info@ablab.in //Date :1st January 2012 //**************************************************************// #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 8000000 /*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)*/ #include<avr/usart.h> /*Includes usart.h header file which includes all the usart functions*/ void main(void) { DDRB=0xff; /*All pins of PortB are declared output (LED array is connected)*/ unsigned char usart_received_data; /*Variable declaration*/ usart_init(); /*USART initialization*/ /*Start of infinite loop*/ while(1) { 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 usart_received_data=usart_data_receive(); /*Data receive from PC */ PORTB=usart_received_data; /*Received data is displayed in LED array*/ } } /*End of program*/ Connection Guide The step-by-step procedures for PC to ATmega16 communication (LED display) are as follows:  Insert the DC Pin of 12V DC Adapter to the DC Socket of AVR Trainer Board-100.  Connect PORTB header with LED header of AVR Trainer Board-100 with a 10 to 10 FRC Female Connector.  Connect the ISP header of AVR Trainer Board-100 with AVR USB Programmer header with a 10 to 10 FRC Female Connector.  Connect the RS-232 Driver header with PORTD header of AVR Trainer Board-100 with a 10 to 10 FRC Connector.  Connect the USB to Serial cable to DB-9 connector of RS-232 Driver and USB port of PC/Laptop.  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 PC to ATmega16 communication (LED display) Hex file to AVR Trainer Board-100.  Send data from PC/Laptop and see the output. 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 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 6