Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

Example of AVR program for RS232 communication

Status
Not open for further replies.

david90

Advanced Member level 1
Joined
May 5, 2004
Messages
423
Helped
9
Reputation
18
Reaction score
4
Trophy points
1,298
Activity points
3,611
Does anybody have an AVR example program that demonsrate rs232 communication?
 

avr rs232 tutorial

I think in every datasheet of AVR microcontrollers, there are example for UART communication (in C), I usually copy them for my program.

regards,
 

avr rs232 example

thanks a bunch. Do you happen to know any serial com gcc code? I've tried to search for it but nothing.
 

avr rs232

This is a port of the Atmel VT100 terminal driver to avr-gcc/avr-libc to play with it in Windows HyperTerminal
**broken link removed**

Code:
* This is an avr-gcc port of the orignal version 2.1
* Copyright (C) 2003 Atmel Corporation
* for the IAR EWAAVR 2.28a Compiler
*
* ported by Martin Thomas 
*  [I]**broken link removed**[/I]
 

avr rs232 gcc

search for "avrlib" on google there many library for avr
 

rs232 to avr

david90 said:
Does anybody have an AVR example program that demonsrate rs232 communication?

is that you need?or you need the programme?
 

avr rs232 communication

void Init_USART( uint baud )
{
UBRRH = (uchar)(baud>>8);//set baudrate
UBRRL = (uchar)baud;

UCSRB = (1<<RXEN)|(1<<TXEN)|(1<<RXCIE);//enable the receiver and sander,enable receive interrupt
UCSRC = (1<<URSEL)|(1<<USBS)|(3<<UCSZ0);//set the format of frame : 8 data bits, 2 stop bits
}

sand data:
void Tx_Data( uchar data )
{
while ( !( UCSRA & (1<<UDRE)) );//put data into buffer,sand data
UDR = data;
}

receive data use interrupt:
#pragma interrupt_handler USART_Rx:12

void USART_Rx( void )
{
uchar temp;
temp=UDR;//read data from UDR register
..........
}
 

Status
Not open for further replies.

Similar threads

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top