Example: Write / Read to IPS6404 PSRAM (8 MB)

Post your cool example code here.
ag123
Posts: 243
Joined: Thu Mar 07, 2019 6:15 am
OS: linux
IDE: eclipse, arduino 1.8.5
Core: Roger's
Board: Maple mini, Bluepill

Re: Example: Write / Read to IPS6404 PSRAM (8 MB)

Post by ag123 » Wed Jan 15, 2020 2:41 pm

stevestrong wrote:
Wed Jan 15, 2020 2:05 pm
I just wonder why is there a big difference between with and w/o DMA, since I optimized quite a lot the non-DMA read and write routines.
I mean the USB and systick IRQs should not have such an influence.
don't worry too much about that difference, it is pretty fast after all ! in the stm32 running codes, there are interrupts etc.
if some other parts of the stm32duino 'system' say an interrupt handler hogs time it can lead to delays which has nothing to do with the program codes

just to share an interesting screen print
sump.png
sump.png (63.44 KiB) Viewed 369 times
this is from here
https://www.sump.org/projects/analyzer/
and i found the codes from here
https://github.com/syntelos/jlac

i actually ported/made a sump logic analyzer out of my pill f401cc recently. but the codes are too rough to release currently. i hit quite a bit of problems and finally just managed to make it work. the gpio read polling GPIOB_BASE->IDR (input register) is done in program codes.
separately i hooked a timer interrupt to generate test signals and i write the values of the counter in GPIOB_BASE->ODR
if the pin reading polling codes has been running throughout, i'm expecting the 'oscilloscope' plot to go from zero to the top and back down again making triangular waves.
initially i'm surprised why the chart looks this way. i kind of conclude that while i loop and read GPIOB_BASE->IDR (i.e. input registers) the main codes in loop() are not running while some other interrupts are being serviced. and timer interrupts runs on the clock and write to GPIOB_BASE->ODR this has no delays.but the program codes in loop() are delayed. hence, by the time the main loop() codes run again, it is delayed and values are lost between that detour

and what you did don't need dma, that is a big deal because the spi psram is wired to spi1 and it shares the dma controller with adc1. this is trouble because, if i (or anyone) wants to do dma to both the psram and adc they are stalled. the only way is to patch wires from spi3 to spi1 and not use spi1 just so that it is possible to use both spi3 dma + adc1 dma. or alternatively is to let the adc run on dma and write to psram using program codes

the nice thing about stm32f401, f411 and f4* in general is that there is spi3, it simply isn't there on the blue pills & maple mini (stm32f103c{8,b}, oh ops spi3 can only do 21 Mbps ~ 2.5 MB/s, that's slower than just bit banging the data with spi hw assistance :lol:

Bingo600
Posts: 14
Joined: Sun Jul 21, 2019 6:23 pm
OS: Linux
IDE: CodeBlocks & make
Core: Rogers
Board: Bluepill

Re: Example: Write / Read to IPS6404 PSRAM (8 MB)

Post by Bingo600 » Fri Jan 24, 2020 5:28 pm

@ag123

When soldering the PSRAM , did you populate the 100nF cap ?
What about the "suggested" 10K pullup on /CS ?

I have 10 x LY68L6400SLIT lying around ;) ;)

/Bingo

ag123
Posts: 243
Joined: Thu Mar 07, 2019 6:15 am
OS: linux
IDE: eclipse, arduino 1.8.5
Core: Roger's
Board: Maple mini, Bluepill

Re: Example: Write / Read to IPS6404 PSRAM (8 MB)

Post by ag123 » Fri Feb 14, 2020 4:17 am

oops didn't realize your response earlier. nope, i just solder the psram on the pads below the F401 black pill board
those are intended for a spi flash, but spi psram is pin compatible.

schematics for the F401 black pill
https://mcu.selfip.com/viewtopic.php?f=25&t=138#p1461

Post Reply