Page 1 of 1

Reading SPI SRAM with python

Posted: Sun Sep 08, 2019 1:54 am
by liudr
I have a project that needs pi to read bursts of data from arduino at a high rate and large quantity. Arduino doesn't have enough memory to hold all data so it needs a fast interface to send to pi. The fastest way I can think of is to have arduino fill an SPI SRAM module with data, inform pi via serial port. Pi reads data off SRAM and replies to arduino so it can fill it up again. The SRAM works at 20MHz to 40MHz. I figure that pi can read at 20MHz with the 40 pin header and SRAM on printed circuit board. Arduino can use serial port but the highest speed is 2Mbaud and arduino will freeze I fear some issues with multitasking and shallow hardware buffer on pi that will prevent pi from reading all data. ... hp?t=61955

What would you do if you need your arduino do this? Raspberry pi's USB ports are not available t hook up an FTDI serial USB chip, which I did test to run at 2Mbaud without missing data.

Re: Reading SPI SRAM with python

Posted: Sun Sep 08, 2019 11:35 pm
by liudr
It turns out that at 2Mbaud rate with hardware serial, rpi 0w loses a few bytes in the transmission. I used 1Mbaud at my target data transfer quantity and frequency and that worked.