PIC32MX Parallel Bus interface to Raspberry PI OR Compute Module - Page 1
Forum section: electronics / general

author: ricko_uk
author_rank: Super Contributor
timestamp: December 20, 2019, 06:12:41 am
content: Hi,I need to transfer large amount of data as fast as possible between a PIC32MX795F512L and a Raspberry Pi (actually the Compute Module version). So I am thinking about using the parallel bus (ideally a 16-bits wide but might just get away with the 8-bits wide). Communication should be able to be initiated by either one of the two (PIC32 or PI) depending on the system status at any given time.Few questions:1) What is the best solution?2) I am thinking to use the Parallel Master Port on the PIC32 side but not sure which pins/lines of the Raspberry Pi/Compute Module to use. Any suggestions?3) Does the Raspberry Pi have a parallel bus set of pins that can be used specifically for this? If not Which pins are best used?4) Are there any such systems implemented? Any reference designs?Many thanks for all help

author: agehall
author_rank: Frequent Contributor
timestamp: December 20, 2019, 07:39:34 am
content: I think you might get better input if you specify the actual parameters, such as how much data are we talking about? MB? GB? TB? How often do you need to transfer this amount of data?

author: andersm
author_rank: Super Contributor
timestamp: December 20, 2019, 08:26:35 am
content: I'd look at USB or Ethernet first.

author: Berni
author_rank: Super Contributor
timestamp: December 20, 2019, 09:20:53 am
content: It is possible to DMA data between GPIO and memory on the raspberry pi, but its probably going to take quite a bit of work to get that to function reliably in both directions.USB is going to be the easiest and fastest solution. You just take some example code for some sort of USB peripheral that transfers data such as a serial port, connect the USB diff pairs together and you got 480Mbit of theoretical bandwidth between the two.Ethernet is also a possibility but the compute module has no Ethernet so you need to use a USB to Ethernet chip. But if you have a USB to Ethernet chip that has a RMII interface instead of a built in PHY then you can just connect the chip directly to the MCUs RMII bus.But depending on how much bandwidth you need its possible you can just use SPI or something since that will run at 30Mbit or so.

author: andersm
author_rank: Super Contributor
timestamp: December 20, 2019, 10:44:00 am
content: Quote from: Berni on December 20, 2019, 09:20:53 amThe MX795 only supports low- and full-speed USB. But at 80MHz, the chip isn't going to be able to produce or consume any massive amounts of data anyway.

author: NiHaoMike
author_rank: Super Contributor
timestamp: December 21, 2019, 05:54:02 pm
content: Most likely your best bets would be either SPI if you want low latency or USB with a FX2 chip if you want high bandwidth.

author: fchk
author_rank: Frequent Contributor
timestamp: December 22, 2019, 07:03:21 pm
content: PIC32MX795 is outdated. PIC32MZ-EF has more than double the clockspeed and USB 2 High Speed Device/Host/OTG with integrated transceiver.

author: SiliconWizard
author_rank: Super Contributor
timestamp: December 22, 2019, 07:18:45 pm
content: I had to do exactly this in a former project (although it was not a PIC32MX), and unfortunately, you can't use a "parallel bus" from an RPi's GPIOs in any efficient way. So if you want high throughput, your only bet is to use USB HS or Ethernet. The former is easier IMO. In my case, I was using an FPGA, so I used an FT232H chip for the USB HS part.You didn't say what kind of throughput you were after? If not too high, SPI may also indeed be a very simple option, except that you stated that either side could "initiate" the transfer... but that could be done in any case using an extra GPIO on the SPI slave's side to notify the master that it should initiate a transfer to get data from the slave...Ethernet would be more involved IMO. An RPi compute module doesn't have Ethernet PHY anyway? So you'd have to add this...

author: iMo
author_rank: Super Contributor
timestamp: December 25, 2019, 11:41:28 am
content: With pic32MX you need around min 8-10 clocks to spit out bytes off the ram via the PMP (8bit). Thus something like 8-10MB/sec max @80MHz clock.PS: you may try to write from PMP to the FT232H (8bit parallel), for example.