CCS C Software and Maintenance Offers
FAQFAQ   FAQForum Help   FAQOfficial CCS Support   SearchSearch  RegisterRegister 

ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

CCS does not monitor this forum on a regular basis.

Please do not post bug reports on this forum. Send them to support@ccsinfo.com

H/W and S/W UART

 
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion
View previous topic :: View next topic  
Author Message
johnh



Joined: 03 Jan 2004
Posts: 19
Location: UK - Brighton

View user's profile Send private message

H/W and S/W UART
PostPosted: Sun Jan 04, 2004 10:48 am     Reply with quote

Hello,

Can someone explain the general pros/cons of using a Hardware UART and the pros/cons of using a software UART?

John
_________________
There are 10 kinds of people who understand binary, those who do and those who don't
hillcraft



Joined: 22 Sep 2003
Posts: 101
Location: Cape Town (South africa)

View user's profile Send private message Send e-mail Visit poster's website

H/W vs S/W uart
PostPosted: Sun Jan 04, 2004 1:53 pm     Reply with quote

I would think that the HW uart is far superior becuase all the uart processing is done by the processor without taking away time from your program. What I mean is this: If you implement a software uart and you create a function to send a byte then the the function will have to create a start bit, send it out, send out your 8 bits serially and create and send your stop bit. Now, this all takes up clock cycles because the code is executed by the processor in the foreground. Another thing to remember is that the S/W uart functions take up valueble memory space that could be used by your program if you used a H/W uart. Another thing to look at is that a S/W uart will probably have delays so as to deal with the BAUD rate timing. The delays will off course waste precious cycles.

Here is another thing to remember. Even if the processor has a H/W uart on say pin C6 and C7 and you go and use say pin B3and B4, the compiler will then implement a S/W uart for those pins. The compiler will only use a hardware uart if the device supports it and if the appropriate pins, in their appropriate directions are specified.
Display posts from previous:   
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group