Teensy 4.1 possible to hook up sdram?

Status
Not open for further replies.

biwog

New member
Moderator edit: see this thread for more info



Hi,

I've checked in the datasheet of the 1060 that it has an external memory interface for sdram. So I'm thinking and research how hard it would be to hook up some sdram (around 64MB) to the teensy or if it isn't possible at all.

There is this other board called daisy with an stm m7 64mb sdram an dac on board. So I was wondering if something like this could be achieved with the teensy.

Kind regards

Biwog
 
Last edited by a moderator:
Not possible. Many of the required signals are not accessible.

But you can add QSPI PSRAM.

https://www.pjrc.com/store/psram.html

The raw performance for cache misses is obviously lower for 4 bit QSPI compared to 8 or 16 bit SDRAM. But for many common uses where the 32K cache helps, the speed can be pretty good.
 
I'm afraid currently there is no good solution for more than 16MB RAM.
One could come up with the idea of simply using multiple (more than 2) PSRAMs on QSPI. But that's difficult because they would need multiple chipselect lines - and even if you do that, the very useful cache would get into trouble. You would have to disable it. That would be very negative for the performance.

However, if you don't need it to be superfast, and do not need the cache, you can just add a few chips to SPI.
 
Last edited:
SDRAM needs about 26 pins to connect to it, several control lines and an 8-bit databus and 12 or so address bits.
 
If I were to create a custom board with the MIMXRT1062 and the Teensy bootloader chip and connect an SDRAM chip like the IS42S16320D would that work with the Teensyduino ecosystem?
 
I've made this by looking into the 1062 EVAL board. I've made my own PCB based on the Teensy where all pins are exposed.
SDRAM should work like the attached schematic right? I mean, since I looked at the EVAL board.


SDRAM.jpg
 
Best will be to have a new Teensy 4.xx or 5.xx board ;)
I have do expansion board for a stm32f429 discovery long time ago , but here the pins was available on board (bigger format).
@Paul , does your next board have sram + sdram directly soldered in place ?
 
I've made my own PCB based on the Teensy where all pins are exposed.
SDRAM should work like the attached schematic right? I mean, since I looked at the EVAL board.

If you made a breakout board with all those signals routed to pins, connecting a SDRAM chip might work. But it might not. SDRAM is sensitive to signal routing. You can see on NXP's eval board the many traces between the chips have zig-zag routing to closely match the lengths. They're also on a multi-layer PCB with ground plane which give good signal quality at the high speeds used. Whether a SDRAM chip could work with ordinary wires of differing (and much longer) length and spacing farther from ground is a good question.

Even if you get the hardware side working, you'll have work on the software side to make it useful. At the very least you'll need to edit the linker script and startup code. NXP's SDK examples might help. The mbed software (porting to Teensy discussed some time ago on this forum) might also help, as it now supports running on both Teensy and the NXP eval boards. You will also need to be very careful about using any software which reconfigures the EMC_xx pins needed for SDRAM. For example, just running analogWrite(2, 128) will take away one of the essential SDRAM pins, as pin 2 is NXP pin "EMC_04".

If you get all of these details right, it probably should work.
 
If you made a breakout board with all those signals routed to pins, connecting a SDRAM chip might work. But it might not. SDRAM is sensitive to signal routing. You can see on NXP's eval board the many traces between the chips have zig-zag routing to closely match the lengths. They're also on a multi-layer PCB with ground plane which give good signal quality at the high speeds used. Whether a SDRAM chip could work with ordinary wires of differing (and much longer) length and spacing farther from ground is a good question.

Even if you get the hardware side working, you'll have work on the software side to make it useful. At the very least you'll need to edit the linker script and startup code. NXP's SDK examples might help. The mbed software (porting to Teensy discussed some time ago on this forum) might also help, as it now supports running on both Teensy and the NXP eval boards. You will also need to be very careful about using any software which reconfigures the EMC_xx pins needed for SDRAM. For example, just running analogWrite(2, 128) will take away one of the essential SDRAM pins, as pin 2 is NXP pin "EMC_04".

If you get all of these details right, it probably should work.

Thanks Paul!
To eliminate issues I actually copied all those traces straight from the EVAL over to my PCB design.
I feel confident with what you said that it should work. The software side will have to be the next step once I get the board working.

I plan to pay someone with knowledge to make the software but I will still share the schematic and code freely here in the forum! :D
 
For more suggestions on the SDRAM connection, you might check out NXP's hardware design guide.

https://www.nxp.com/webapp/Download?colCode=MIMXRT105060HDUG

They might require creating an account on their site to download this file. Annoying, but you should be able to get it without having to actually contact anyone at NXP or sign anything like a NDA.

The most relevant if is on page 18. Here's a screenshot.

View attachment 32194

Many thanks Paul for taking the time to guide me. Let's see if I succeed. I promiss to share the work in here! :)
 
Many thanks Paul for taking the time to guide me. Let's see if I succeed. I promiss to share the work in here! :)
Hey mate. Did you have any luck with this? I'm pretty interested to try this. I know there's other boards that can do this but I want to stay within the teensy ecosystem.
 
Status
Not open for further replies.
Back
Top