Interfacing 16-bit SDRAM on K65

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Interfacing 16-bit SDRAM on K65

947 Views
anton_svensson
Contributor I

I'm having problems interfacing a 16-bit SDRAM on the k65.

The SDRAM being used is an MT48LC4M16

The SDRAM is connected as in the picture attached.

 

The problem I get is when I try to access the SDRAM, with an 32 bit access not with 16 or 8 bit, and writing the prechargeall command I get some sort of exception and landing at 0x10066958.

 

When accessing with 16/8 bit I won't get any information to the SDRAM, writing and reading all result in 0x0 in values.

 

Anyone had similar problems?

 

Best regards

Anton

Original Attachment has been moved to: Sdram.cpp.zip

Tags (2)
0 Kudos
4 Replies

615 Views
Masmiseim
Senior Contributor I

Hey,

i think you have a  timing mismatch between the controller and the SD-RAM. This is not setting a CAS-Latency of two:

bP = (UINT8 *) (SDRAMADDR + 0x20);

Try 0x400 instead.

Regards

0 Kudos

615 Views
anton_svensson
Contributor I

Hi Markus!

I tried you're idea and it didn't change anything.

When looking in the reference manual for the SDRAM I get that the CAS-latency is set on A6-A4, so 0x20 would refer to A5 and CAS = 2.

But I'm thankful for the tip!

Best regards

Anton Svensson

0 Kudos

615 Views
xiangjun_rong
NXP TechSupport
NXP TechSupport

Hi, Anton,

Can you refer to the documentation and code based on K65:

How to access SDRAM based on K65 SDRAM controller

Pls refer to the code, if you still have issue, pls update here.

BR

Xiangjun Rong

0 Kudos

615 Views
anton_svensson
Contributor I

Hi!

I've used that documentation and code as an example.

The weird behaviour I have at this point is that it seems that I can write to the lowest bit when accessing as a 16-bit device through the SDRAM controller. However it seems like I only can access one adress.

A write of 0xFFFF will result in a read of 0x1.

A write of 0xFF0 will result in read of 0x0.

If I try it as a 32-bit device in the controller, I can write to the lowest 16 bits, but still only on one adress as it seems.

A write of 0xFFFF will result in a read of 0xFFFF.

A write of 0x1234 will result in a read of 0x1234

Best regards

Anton Svensson

0 Kudos