View previous topic :: View next topic |
Author |
Message |
rwskinner
Joined: 08 Dec 2006 Posts: 125 Location: Texas
|
18F4550 + SPI + RS232 |
Posted: Thu Jan 14, 2010 11:09 am |
|
|
I hadn't done this before and I'd like to know if there are any problems with the SPI and Hardware RS232 sharing the RX line (RC7 is RX and SDO), especially since I will be using both. RS232 will be a Modbus Slave and I don't need things causing problems.
Anything to look out for? Suggestions, tips....
Thanks,
Richard |
|
|
PCM programmer
Joined: 06 Sep 2003 Posts: 21708
|
|
Posted: Thu Jan 14, 2010 4:49 pm |
|
|
Presumably your Modbus Rx line is coming out of a MAX232-type chip,
so the Rx pin on the PIC is being driven. You can't just disable the UART
in the PIC and enable the hardware SPI, because then you would have
the SDO pin fighting the MAX232 signal. Now, you could get a MAX242
or similar chip, that has tri-statable Rx outputs. Then you could only
enable that output when the PIC's hardware UART is enabled (and the
SPI module is disabled). This would require an extra i/o pin on the PIC
to control the tri-state control input on the MAX242. |
|
|
rwskinner
Joined: 08 Dec 2006 Posts: 125 Location: Texas
|
|
Posted: Fri Jan 15, 2010 2:01 pm |
|
|
Thanks, I was afraid of that. I'll use SW SPI on a different set of pins then. |
|
|
|