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.

Communication Atmega 8535 with RS232

Status
Not open for further replies.

dimas_lilik

Full Member level 2
Joined
Aug 13, 2007
Messages
125
Helped
13
Reputation
26
Reaction score
11
Trophy points
1,298
Location
Indonesia
Activity points
1,943
I want to connect the 2 micro controller .
Atmega 8535 I used to take temperature data in some remote place. while 89S52, I use to view data and controls all Atmega 8535 ( 10 pcs).
Can anyone provide solutions for data communications between Atmega 8535 and 89S52 by using the RS232
 

nandhu015

Advanced Member level 5
Joined
Feb 11, 2006
Messages
1,965
Helped
300
Reputation
600
Reaction score
224
Trophy points
1,353
Location
India
Activity points
9,853
Here is a tutorial for atmega

Code:
http://www.avrfreaks.net/index.php?name=PNphpBB2&file=viewtopic&t=45341

and here is for 8051

Code:
http://8052.com/tutser.phtml

set the same baud rate in both avr and 8051 and communication will be fine
 

dimas_lilik

Full Member level 2
Joined
Aug 13, 2007
Messages
125
Helped
13
Reputation
26
Reaction score
11
Trophy points
1,298
Location
Indonesia
Activity points
1,943
thanks Nandhu, I'll try, although I am still confused with the Cristal clock on Atmega 8535 (4 MHz) and 89s52 (11 MHz). Does not affect the baud rate?
 

nandhu015

Advanced Member level 5
Joined
Feb 11, 2006
Messages
1,965
Helped
300
Reputation
600
Reaction score
224
Trophy points
1,353
Location
India
Activity points
9,853
dimas_lilik said:
thanks Nandhu, I'll try, although I am still confused with the Cristal clock on Atmega 8535 (4 MHz) and 89s52 (11 MHz). Does not affect the baud rate?

Sure, there will be problems. Select the crystals that supports standard baud rates.
For example 11.0592MHz (By the way i havnt seen 11.000MHz crystal).
 

ChrisC

Member level 2
Joined
Sep 30, 2009
Messages
51
Helped
14
Reputation
28
Reaction score
2
Trophy points
1,288
Location
London, UK
Activity points
1,760
dimas_lilik said:
thanks Nandhu, I'll try, although I am still confused with the Cristal clock on Atmega 8535 (4 MHz) and 89s52 (11 MHz). Does not affect the baud rate?

It can do, although bear in mind that the actual baud rate can vary by up to 2% (though a variation of 1% or less is generally preferred) from the ideal rate, which gives you a bit of flexibility when it comes to clocking the UART from a system clock which isn't baud-rate friendly. I don't know about the 8952, but the AVR datasheets have a pretty good section on baud rate selection including tables of precalculated settings across a wide range of system clock frequencies, showing the error % for each baud rate.


So whilst using a baud-rate friendly system clock frequency is generally the best option if you're doing a lot of UART-based comms, if there are other constraints on the design which prevent you from doing this then it isn't the end of the world. The very first embedded system I worked on commercially was an 8535 (the original AT90S version, not the ATmega one you've got...) based HVAC controller clocked at 8MHz, which would quite happily chuck data back and forth across its UART all day long at 9600 and 38400 baud with no errors. We had 80 of them set up in the test department running 24/7 with continuous monitoring/logging, and whilst I did get quite a few fault reports (how else can you learn if you don't make mistakes!) the only comms-related ones were all down to firmware bugs - not once did any of those controllers (nor the thousands more that were subsequently installed around the world in the time I was with the company) have any comms problems at the hardware level.
 

Status
Not open for further replies.

Similar threads

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Top