LPC177x EMC and SDRAM conundrum

Discussion created by lpcware Employee on Jun 15, 2016
Latest reply on Jun 15, 2016 by lpcware
Content originally posted in LPCWare by teeysensei on Mon Jul 09 02:04:10 MST 2012
Hi everybody!

I'd like to extend my greetings, since this is my initiation post and I hope someone could help me. I am pretty much in the same boat as sebgonzo in his thread (http://lpcware.com/content/forum/lpc1788-sdram-timing-problem), but I didn't want to hijack his thread for my problems.

I'm treading new ground here, working on a design with the LPC1776 harboring an SDRAM. I managed to complete my routing, and went on to try and verify my timings. This is where I got stuck.

Here is what I ended up with,

setup-margin = Tclk - Td - Tsu - TOF + Tskew
hold-margin  = Th(tx) - Th(rx) + TOF - Tskew

RAM Tac = Td = 6ns, Tsu = 2ns, Th = 2.5ns, all the other numbers are from the LPC177x/178x datasheet, page 85, command delayed mode table 19.

1.) Data write:

RAM(su-margin) = 12.5 - 7.3 - 2 - 0.2 = 3 + Tskew
RAM(h-margin)  = 0.2 - 1 + 0.2        = -0.6 - Tskew

Right, so we can solve that with the EMC getting clocked last - a negative clock skew. There's enough room in setup, or use command delay mode.

2.) Data read:

EMC(su-margin) = 12.5 - 6 - 5.3 - 0.2 = 1ns + Tskew
EMC(h-margin)  = 2.5 - 5.2 + 0.2      = -2.5 - Tskew

Here the sunshine sets. By these margins there is no way you can compensate for the hold margin. Trying to delay the RAM (EMC clocked first - negative skew) will break the setup margin. The only way to fix what's broken is to throttle down to about 70MHz (~15ns period).

Also, by looking at the LPC177x/178x user manual, page 157, fig. 13, there is no way to delay the SDRAM without delaying the EMC along with it - except by clocking the SDRAM out from CLKOUT1, since CLKOUT0, already delayed, leads right back into the EMC as the feedback clock.

Am I wrong? I really could use a bucket of sound advice.

I think I've got the maths and the numbers right, please do correct me if I made a silly blunder along the way, since I am in no way an expert at these things. This is just the result of the past several days of heavy research that I've managed to come up with while my head wasn't completely spinning :)

Thank you for the help, I really appreciate it!