Page 1 of 1

Hardware VS Software serial

Posted: Thu Mar 21, 2019 9:50 am
by Lord Grezington
Hi Everyone

Has anyone done any comparason testing between hardware and sofware serial protocols?

I am doing a layout for a prototype PCB and need to make a decision on which pins to use with SPI.

I am using a dsPIC30F3011 wit ha fast clock speed of 117964800.

Thanks

Re: Hardware VS Software serial

Posted: Thu Mar 21, 2019 8:27 pm
by kersing
Rule of thumb: use hardware if possible. Less overhead and less chance of timing issues.

Re: Hardware VS Software serial

Posted: Thu Mar 21, 2019 8:47 pm
by medelec35
kersing wrote:Rule of thumb: use hardware if possible. Less overhead and less chance of timing issues.
I totally agree with that.
Especially as interrupts interfere with software generated code, but not hardware generated code.

Re: Hardware VS Software serial

Posted: Fri Mar 22, 2019 10:28 am
by Lord Grezington
Thanks Guys

The problem that I have is that the 30F3011 only has one hardware SPI, and this happens to be on teh same pins as the UART channel 1 hardware. Again it just so happens that the RX TX pins for the UART channel 1 hardware is also PGD & PGC. I like the fact that UART channel 1 is on the PGC & PGD as I have ftdi cables made up to take the UART out for serial plotting data on the PC (fits on the ICSP header). But I need the SPI to contoroll the IC's on the dev board fairly consistantly.

Now, I like the 16bit MCU's as they are fast, the 30F3011 befasue it works @ 5V, and it is the only one I can find that has 40pins in a TH package (I use TH for dev boards as my SM soldering is poor).

Would you suggest that taking the above into account that I use the software SPI and hardware UART - mainly because SPI is synchronous and UART is asyncronous?

Thanks

Re: Hardware VS Software serial

Posted: Fri Mar 22, 2019 11:28 am
by medelec35
Personally,
If can only use one with hardware, then it would have to be asynchronous.
With asynchronous, in theory it will be more affected by interrupts than synchronous.
So best to use UART for hardware, even more so if RX is required?

Re: Hardware VS Software serial

Posted: Fri Mar 22, 2019 12:26 pm
by Lord Grezington
Yeah, just what I thought...

For this Dev board Rx is not needed.

Thanks Martin