RS485 Communication

I have a 4200 dev board and I need to be able to communicate using RS485. I do not see any examples in any of the 4xxx sample folders for RS485 communication. The user manual says that it has the capability, however.

In addition to needing a sample file that will work, I also need to know which serial port I would use for RS485, or do any of the serial ports work?

Thanks!

I need to configure the serial port A to communicate two boards by rs485, but I can’t configure any of them. I was reviewing the library RCM33XX and then I was this couple of instructions to configure the serial ports B, C and D:

WrPortI(PCFR, &PCFRShadow, PCFRShadow&0xEA); //clear bit 4,2,0 to normal function
//bits 5,3,1 normally inputs
WrPortI(PCDR, &PCDRShadow, PCDRShadow|0x15); //set bits 4,2,0 high

What do I need to configure serial port A?

Thanks!!

To communicate using RS485 you’ll need a conversion chip like the Maxim MAX481 or similar.

You can use any serial port, but you’ll also need a control signal to enable the driver circuit when transmitting and disable it when receiving.

The schematic for the OP7200 which you can download from the Rabbit site has RS485 on it, so you can get some ideas from there.

Just remember that the OP7200 is 5V and the RCM4200 is 3v3

Well, you can of course just use serAopen(…) to open serial port A and transmit/receive as normal - however for RS485 you need to drive the receiver-enable and driver-enable lines of whichever RS485 chip you are using.

Be aware that Serial Port A is used by the programming cable so any hardware you add which uses PC6 and PC7 must not interfere with the ability to program the module - otherwise you’d need to remove the module from your own board to program it.

I used a sample in \Samples\BLxS2xx\RS485 , connect to serial port C.

It took me a while to figure out though.