SDRAM library
Posted: Tue May 01, 2018 3:54 pm
Hi all,
So I'm testing out the board from this post, things are going smoothly apart from the SDRAM component...
I took the circuit pretty much from eez-open's project and he seems to be having no problems, so I'm reasonably sure the wiring is correct. What I hadn't realised was that lib_sdram was qualified only for certain SDRAMs - in my naivety I had thought an SDRAM was an SDRAM was an SDRAM...
Anyway, Seeed did the assembly of the hard-to-solder parts of the board, and did a pretty good job overall...
... but they rotated the SDRAM chip around by 180 degrees, which shorted ground to 3.3v when I switched on the first board. I modified the SDRAM test application slightly (I have an SDRAM_ENABLE line which has to be pulled low for 4 bits of the ADQ[16] bus on XS1_PORT_16A to be routed to the SDRAM rather than the default QSPI). I then remapped the ports thusly:
... and I get that 0xdeadbeef is being read back as 0 at location 0. Having found the thread about different SDRAMs I paid a bit more attention to the startup in my SDRAM chip (a winbond W9825G6KH). According to the power up on page 7, the DQM and CKE pins must be held high during the initial 200 uS delay. CKE is tied high, so I just needed to alter UDQM and LDQM. I tried adding the following code to the server.xc sdram_init() routine:
... but that didn't help. I also tried bumping the clock-divider up to the maximum 10 (which makes it run *way* slower than the QSPI that the board successfully boots off). Again, no dice.
So there are several possibilities that I can see:
So (eventually :) questions:
Simon
So I'm testing out the board from this post, things are going smoothly apart from the SDRAM component...
I took the circuit pretty much from eez-open's project and he seems to be having no problems, so I'm reasonably sure the wiring is correct. What I hadn't realised was that lib_sdram was qualified only for certain SDRAMs - in my naivety I had thought an SDRAM was an SDRAM was an SDRAM...
Anyway, Seeed did the assembly of the hard-to-solder parts of the board, and did a pretty good job overall...
... but they rotated the SDRAM chip around by 180 degrees, which shorted ground to 3.3v when I switched on the first board. I modified the SDRAM test application slightly (I have an SDRAM_ENABLE line which has to be pulled low for 4 bits of the ADQ[16] bus on XS1_PORT_16A to be routed to the SDRAM rather than the default QSPI). I then remapped the ports thusly:
Code: Select all
on tile[SERVER_TILE] : out port sdram_en = XS1_PORT_1A;
on tile[SERVER_TILE] : out buffered port:32 sdram_dq_ah = XS1_PORT_16A;
on tile[SERVER_TILE] : out buffered port:32 sdram_cas = XS1_PORT_1L;
on tile[SERVER_TILE] : out buffered port:32 sdram_ras = XS1_PORT_1M;
on tile[SERVER_TILE] : out buffered port:8 sdram_we = XS1_PORT_1N;
on tile[SERVER_TILE] : out port sdram_clk = XS1_PORT_1O;
on tile[SERVER_TILE] : clock sdram_cb = XS1_CLKBLK_2;
Code: Select all
start_clock(cb);
// begin added code
// Hold UDQM,LDQM high during the next 200 uSecs. These are
// driven by NOR connected to WE and CAS lines, so drive those low.
partout_timed(we, 1, 0, t);
partout_timed(cas, 1, 0, t);
// end added code
//Wait 200us for clock to stabilise
T :> time;
T when timerafter(time + 200 * TIMER_TICKS_PER_US) :> time;
So there are several possibilities that I can see:
- The SDRAM chip is blown. Connecting it up the wrong way around was fatal and the game is over.
- Something went wrong elsewhere when the SDRAM was powered, maybe on the XMOS, again game over.
- The SDRAM is not compatible with lib_sdram.
- The signal integrity of the board is so bad, that it won't even run at 25MHz.
So (eventually :) questions:
- Has anyone used one of these SDRAMs before ? I have to rotate the SDRAMs on the remaining 4 boards anyway, and the IS45S16160G-7TLA1 is pin-compatible and currently available at mouser. If it's going to solve all the problems, it'd be worth it to just swap out the chips when I do the rotation.
- Have these changes (from the above-linked thread, by infiniteimprobability) been folded into the latest lib_sdram ?
- Is there anything else I could try ? :)
Simon