This is something that interests me as well.
For Serout vs Hserout my personal opinion is that there is no real difference if you are sending several characters as Hserout would wait for each character to be sent whereas with a single character using Hserout would allow the program to continue with no delay.
I personally feel that the real advantage of Hardware serial comes with receiving data.
Using Serin you have to wait for each bit to be received and you have virtually no time to deal with the recieved character before the next one starts to arrive, particularly at higher baud rates. If you miss the start of the character then the data is lost.
Using Hserin the reception of characters is done automagically and upto 2 characters can be buffered which allows you more time to deal with received data. eg at 9600 which is approx 960 characters per second you have just over 1ms in which you can be doing other stuff before the next character arrives and if occasionally you take slightly longer than that the buffer should catch the next character to prevent data loss. Of course if you take too long every time then you have a big problem
The only real advantage I can see for software vs hardware is that software allows the logic levels to be inverted without any additional hardware but I am going to use a MAX232 for an RS232 interface to ensure proper positive and negative levels and I also plan on providing a USB serial interface using one of the tiny USB modules and these have TTL inputs and outputs so connect directly to the PIC USART
No doubt someone will be along with a better answer and I could be totally wrong which is why I am interested in this as I am currently trying to get about 20 pics talking to a master along with a couple of external serial sources !!!!
Last edited by keithdoxey; - 20th September 2006 at 08:29.
Keith
www.diyha.co.uk
www.kat5.tv
Bookmarks