free 8051 Microcontroller Projects AVR PIC Microcontroller Projects Tutorials Ebooks Libraries, interfacing tutorials, lcd tutorial, stepper motor, dc motor 8051 assembly language programming electronics and communication ECE CSE pdf ebooks library BE final year project ideas Embedded systems

 
8051 microcontroller 8051 microcontroller
Forums

8051 Microcontroller Projects AVR PIC Projects Tutorials Ebooks Libraries codes :: Forums :: Discuss and Learn :: 8051 Discussion Forum
 
<< Previous thread | Next thread >>
Second asynchronous interface on a 80C51- atmel application note
Moderators: Ajay, Junied , abbas1707, Arun Kumar V, pdi33, Shailesh NAYAK, ۞ TPS ۞, shyam, sashijoseph
Author Post
Nicolas30
Thu Oct 02 2008, 05:01AM
 User Offline
Registered Member #4888
Joined: Tue Nov 13 2007, 11:10PM

Posts: 9
Thanked 0 times in 0 posts
I am using this Atmel application note:

http://www.atmel.com/dyn/resources/prod_documents/doc3ab877f2ec329.pdf


I would like to work to 9600 bauds, I change the TH1 register value to 0FDH and the SR_SPEED to 4, but this application don´t works with this values.
Somebody can help me?
Thanks.

Now works fine, we should not change the value of the TH1 register, always 0E8H.

But, what are the values for SR_SPEED variable, if we have TH1=0FDH ?







[ Edited Thu Oct 02 2008, 10:04AM ]
Back to top


Ajay
Thu Oct 02 2008, 02:55PM
Rickey's World Admin

 User Offline

Registered Member #1
Joined: Fri Feb 24 2006, 04:56AM

Posts: 3752
Thanked 695 times in 654 posts
the timer mentioned there is not the same timer you are looking for. As you can see its a software UART, so there should be someone to provide delay for minimum unit(a bit) to be transferred. This delay is kept multiple of what is loaded into timer (0xE8). and delay is maintained using a counter (si_count).

so you should not play with the timer instead you just have to vary si_count variable's value to change your final baud rate.

if you looked in our tutorial section, you will find software uart code in Serial Communication tutorial, which can be used with assembly as well as C programs. I am sure it will be useful for you. Drawback is you can only have half duplex communication.

www.rickeyworld.info
If you feel satisfied with the user's forum reply please click on the thank button.

Obey forum rules!
Respect others!
Back to top


Ajay
Thu Oct 02 2008, 02:56PM
Rickey's World Admin

 User Offline

Registered Member #1
Joined: Fri Feb 24 2006, 04:56AM

Posts: 3752
Thanked 695 times in 654 posts
[topic moved to 8051 discussion forum]

www.rickeyworld.info
If you feel satisfied with the user's forum reply please click on the thank button.

Obey forum rules!
Respect others!
Back to top


Nicolas30
Fri Oct 03 2008, 12:18AM
 User Offline
Registered Member #4888
Joined: Tue Nov 13 2007, 11:10PM

Posts: 9
Thanked 0 times in 0 posts
Thank you Ajay, but I need to have two 9600 bauds serial port, for this reason I need to load the register TH1 with 0FDH value, in this situation I dont know which is the si_count variable to make the second serial port works properly to 9600 bauds.
Many thanks
Back to top


Ajay
Fri Oct 03 2008, 12:39PM
Rickey's World Admin

 User Offline

Registered Member #1
Joined: Fri Feb 24 2006, 04:56AM

Posts: 3752
Thanked 695 times in 654 posts
I think atmel has not given much information in their application note.

But what i felt from application note i explained. code is bit confusing, but still ok if it works.

If you want you can try code in tutorial too.

www.rickeyworld.info
If you feel satisfied with the user's forum reply please click on the thank button.

Obey forum rules!
Respect others!
Back to top



This post has been thanked 1 time
 Nicolas30 
ExperimenterUK
Fri Oct 03 2008, 04:54PM
 User Offline
Registered Member #9602
Joined: Tue Aug 05 2008, 04:15PM

Posts: 152
Thanked 30 times in 29 posts
Nicolas30 wrote ...

Thank you Ajay, but I need to have two 9600 bauds serial port, for this reason I need to load the register TH1 with 0FDH value, in this situation I dont know which is the si_count variable to make the second serial port works properly to 9600 bauds.
Many thanks


@Nicolas30

As I understand the method,
for hardware and software ports to be the same set si_count to 32
as they do in the pdf.

Just don't ask me why



[ Edited Fri Oct 03 2008, 04:58PM ]

Learning all the time
Back to top



This post has been thanked 1 time
 Nicolas30 
Nicolas30
Mon Oct 06 2008, 03:52AM
 User Offline
Registered Member #4888
Joined: Tue Nov 13 2007, 11:10PM

Posts: 9
Thanked 0 times in 0 posts
I tested the web tutorial code and works fine,
in the transmission there is no problem
but the problem is in the reception to synchronize the data input, we can do that by pooling or through an external interrupt.
Thx
Back to top


Ajay
Tue Oct 07 2008, 06:19AM
Rickey's World Admin

 User Offline

Registered Member #1
Joined: Fri Feb 24 2006, 04:56AM

Posts: 3752
Thanked 695 times in 654 posts
well it also depends on how much speed you are using, i usually use 1200 after all its software..

www.rickeyworld.info
If you feel satisfied with the user's forum reply please click on the thank button.

Obey forum rules!
Respect others!
Back to top



This post has been thanked 1 time
 Nicolas30 
Nicolas30
Fri Oct 10 2008, 03:25AM
 User Offline
Registered Member #4888
Joined: Tue Nov 13 2007, 11:10PM

Posts: 9
Thanked 0 times in 0 posts
9600 bauds, Ok

rxd ----------- int0
|____P0.5

thnx.
Back to top


Ajay
Tue Oct 14 2008, 07:09AM
Rickey's World Admin

 User Offline

Registered Member #1
Joined: Fri Feb 24 2006, 04:56AM

Posts: 3752
Thanked 695 times in 654 posts
Great Nickolas I think its the best method to use soft UART.

If possible provide your proposed schematic, I will add it in my tutorial will be helpful to everyone.

www.rickeyworld.info
If you feel satisfied with the user's forum reply please click on the thank button.

Obey forum rules!
Respect others!
Back to top


 

Jump:     Back to top

Syndicate this thread: rss 0.92 Syndicate this thread: rss 2.0 Syndicate this thread: RDF
Powered by e107 Forum System

8051 Microcontroller Projects 8051 AVR tutorials PIC microcontroller, 8051 assembly language programming electronics and communication ECE CSE pdf ebooks library BE final year project ideas Embedded systems