[sdiy] New SPI SRAM
Richie Burnett
rburnett at richieburnett.co.uk
Mon Jul 16 00:13:23 CEST 2018
> I started seeing references to QSPI PSRAMs in some of the embedded
> development forums last year. At that time they were all coming out of
> obscure fabless outfits in China who were keeping the data sheets under
> NDA and not selling to anyone that wasn't in their treehouse. Nice to see
> a big player like ISSI doing this...
Definitely. They surely have lots of uses, particularly with low current
drain of SRAM.
> most of the STM32 that I'm using now have solid QSPI ports and even
> allow memory mapping so it's conceivable that dropping one of these
> little 8-pin parts in could really open up the storage options.
Sadly dsPICs don't have the quad-speed SPI, or do the memory mapping for
you. However, I've found that using DMA to transfer blocks of memory into
dsPIC RAM via SPI works pretty well. With a bit of planning you can hide
the time taken for the "paging in" of external RAM contents by starting the
DMA process before the data is needed, etc, so that it happens in the
background while the CPU core is working on something else.
I know you mentioned about the SPI DMA not controlling the CS line on
dsPICs. This is a pain for single byte transfers, but it doesn't seem to be
a problem for big block transfers. I just load the DMA RAM with the full
outgoing packet (Command + Address + Data,) drop the CS line and initiate
the DMA transfer. The only thing to watch out for is that the SPI transmit
DMA complete interrupt will go active as soon as the DMA controller has
loaded the last byte into the SPI transmit register, so don't raise the CS
line just yet!!! This had me scratching my head for a while, wondering why
the last byte of every packet didn't get written. I now use the SPI receive
DMA complete interrupt to determine when the transfer is complete, because
that doesn't go active until the last byte is received, (even though I don't
actually care about the received data at times when I'm writing to the
external SRAM.) Otherwise, I didn't encounter any unwanted surprises.
> Would be even nicer if you could get them at the big distributors...
Yep. Farnell, RS, Digikey, Mouser, etc, all currently don't stock them :-(
Will let you know if my samples ever arrive from the Cayman islands!
-Richie,
More information about the Synth-diy
mailing list