Joined: 03 Jan 2004 Posts: 19 Location: UK - Brighton
H/W and S/W UART
Posted: Sun Jan 04, 2004 10:48 am
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)
H/W vs S/W uart
Posted: Sun Jan 04, 2004 1:53 pm
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.
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