PDA

View Full Version : 18F4550 UART and SPI



yba2cuo3
- 1st September 2006, 15:39
Unfortunately the UART Rx and SPI SDO functions on the 18F4550 share the same pin. I can't think of a simple solution which retains both ports without going to a different PIC. Has anyone come across a similar problem &/or have a possible solution?

Thanks,
Marc

Normnet
- 2nd September 2006, 02:58
Possibly reset and reconfigure for other use.

Norm

SteveB
- 2nd September 2006, 03:46
Use the PBP software solution for one the functions. Both work well, especially with a fast clock rate (which is likely since you are proabably using the 4550's usb, and if you not, other alternative PICs are a better choice).

For what it's worth, when faced with a similar choice, I used the software SPI and hardware Serial. This allowed me to create an interrupt driven serial buffer for RX. I can recieve data packets "in the background" and then process the data in my main loop as needed. I also "hacked" the PBP SHIFTOUT macro to remove a bunch of 'needless' (in my case) delays (nop and goto $ + 2 commands), increasing the data output rate.

HTH,
Steve

yba2cuo3
- 3rd September 2006, 01:31
Thanks for the excellent feedback Steve!

I didn't think about using a PBP software solution. I'm using the 4550's USB & trying to get things to work with an ENC28J60. Unfortunately, when I received my Ethernet PICtail daughter card it didn't contain the latest Rev B5 silicon, which supports SCK from DC-20MHz. I will likely upgrade otherwise SCK needs to be >8MHz, as per errata.

Regards,
Marc