I'm trying to understand how to connect a SPI device (a mifare RC522 RFID board) over long distance to my RPi via SPI.
I searched and find I could connect those via SPI over RS485 using a MAX490. (http://forum.arduino.cc/index.php/topic,93234.0.html)
Could anyone explain, maybe with a schematic, how to connect those devices? And do I need some software changes?
Answer
The single-ended SPI signals can be converted to differential pairs, which are more robust in presence of EMI and can go the distance. Then the differential pairs can be converted back to single-ended SPI signals, and connected directly to peripherals (ADC, I/O expanders, and such). That's what the original forum post is proposing.
MAX490 has 2 different sub-circuits.
One sub-circuits is a differential bus transmitter. It can convert a normal single-ended SPI signal to a differential signal.
The other sub-circuit is a differential bus receiver. It can convert a differential signal back to single-ended.
(fig. 2 in the datasheet)
In order to connect the SPI bus this way, 3x MAX490 would be required on each side. Something like this.
The above approach has a clock delay problem. So it has limitation in bus length and bit rate. This is what @Andy was referring to in his comment.
Here's an application note that further explores clock delay and proposed a solution (and this one too). However, that solution requires 2 separate SPI peripherals on the microcontroller.
Here's another app note on clock delay in the context of high speed SPI.
No comments:
Post a Comment