HaYaMoTo
Posts: 26
Joined: Sat Dec 03, 2016 11:11 pm

Interfacing FPGA with my raspberry Pi !

Tue Nov 05, 2019 11:09 am

Good morning,

I'm working on a complicated project using Raspberry Pi, I've done the biggest part of the project and all i need now is adding some tricks image processing inside ! and since the raspberry pi isn't good in dealing with images and frames as well (speed problem). I was wondering if there is a possibility of using a FPGA to do this part of the project and connecting the FPGA and the Raspberry Pi together. Actually, i only need the FPGA to make decisions and give them to the raspberry pi to complete its work ?

Thanks a lot.

User avatar
mark3112
Posts: 46
Joined: Mon Apr 09, 2018 10:39 am

Re: Interfacing FPGA with my raspberry Pi !

Tue Nov 05, 2019 1:22 pm

SPI works for me using a pair of shift registers. I have two 8 bit output latches and switch between them when data is being sent. That way one can be loaded whilst the other is live on the shift register.
You can make a real CPU in a FPGA, but you can’t make a real FPGA in a CPU.

ejolson
Posts: 6612
Joined: Tue Mar 18, 2014 11:47 am

Re: Interfacing FPGA with my raspberry Pi !

Tue Nov 05, 2019 6:27 pm

mark3112 wrote:
Tue Nov 05, 2019 1:22 pm
SPI works for me using a pair of shift registers. I have two 8 bit output latches and switch between them when data is being sent. That way one can be loaded whilst the other is live on the shift register.
How fast can you transfer data?

HaYaMoTo
Posts: 26
Joined: Sat Dec 03, 2016 11:11 pm

Re: Interfacing FPGA with my raspberry Pi !

Tue Nov 05, 2019 8:16 pm

mark3112 wrote:
Tue Nov 05, 2019 1:22 pm
SPI works for me using a pair of shift registers. I have two 8 bit output latches and switch between them when data is being sent. That way one can be loaded whilst the other is live on the shift register.
Can you explain more ?

User avatar
mark3112
Posts: 46
Joined: Mon Apr 09, 2018 10:39 am

Re: Interfacing FPGA with my raspberry Pi !

Wed Nov 06, 2019 6:28 pm

How fast can you transfer data?
Without checking the FPGA’s specs I think its internal maximum clock is about 400MHz. So, let’s play safe and divide by 2, so 200Mbs for the Cyclone III chip?

Can you explain more ?
Yep, what do you want to know? But I have only worked with Altera parts, many years ago.
OK, I confess the circuit doesn’t interface with the PI, I mostly use STMF4xx’s, but that will simplify the circuit as you can clock the circuit from the PI’s clock.

Blue block – The output area. Multiplexers for selecting 8 bit block. Note the SSR0/1_Load signals that control selection of elements and the multiple debug signals (slap them on a spare output and attach to a signal analyser).
Green block – Assemble 48bit words
And stuff.

Pic attached.
Attachments
FPGAtoSPI.jpg
FPGAtoSPI.jpg (249.18 KiB) Viewed 1171 times
You can make a real CPU in a FPGA, but you can’t make a real FPGA in a CPU.

trejan
Posts: 3064
Joined: Tue Jul 02, 2019 2:28 pm

Re: Interfacing FPGA with my raspberry Pi !

Wed Nov 06, 2019 8:43 pm

If you want a parallel interface then there is the Secondary Memory Interface peripheral. It does use nearly all the GPIOs and isn't very well documented though. Gert Van Loo's IDE prototype could do 44MB/s.

The other alternative would be to use something like one of the Cypress EZ-USB chips to bridge the FPGA to one of the USB ports on the Pi. Needs more hardware but it would be portable to other host machines.

Return to “General discussion”