Page 1 of 1

how to use RS485 communication and SPI expander

Posted: Thu Aug 21, 2008 10:47 am
by saravana_3
hi friends,
I am using the pic16f877a for the RS 485 master slave communication as per the data sheet the SPI or the I2C are the serial communication with the peripherals as a master slave logic, but currently i am using the master slave communication between two pic 16f877a chips, since I need additional I/O ports for my project I am insist to use the expanders MCP23S17, . but I need to connect the master and slave through the PORTC, for RS 485 communication, but the SPI and I2C caonfiguration also in the PORTC , in this case how to manage the RS 485 communication and SPI for the expander at the same time is it possible to use at the same time
thanks
Saran

Re: how to use RS485 communication and SPI expander

Posted: Thu Aug 21, 2008 3:41 pm
by Benj
Hello Saran

It depends which chip you are using. Some of the PIC micro devices share the SPI and UART on the same pins. If this is the case for your chip then you will not be able to implement the RS485 and the SPI without bit banging one of the busses.

Re: how to use RS485 communication and SPI expander

Posted: Thu Aug 21, 2008 10:02 pm
by Sean
In the PIC16F877a the USART and MSSP (SPI/I2C) are both on Port C, but use different pins, so can operate simultaneously. You only need to route each port pin to the appropriate external device.

You will need to decide between SPI or I2C for the port expander device because these use the same controller and port pins.

Note: The USART and MSSP can not be used simultaneously on all 40-pin PIC devices

Re: how to use RS485 communication and SPI expander

Posted: Wed Oct 29, 2008 3:31 pm
by jadiflow
Saran, or anybody else, have you been successfull in using an RS485 interface?

Jan Didden