MCF5329, SDRAM

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

MCF5329, SDRAM

3,700 Views
VeronicaFNX
Contributor I
Hello,
I have to work with SDRAM. Can anyone give an example on its management?
I have never worked with it
Thanks
  Veronica
Labels (1)
0 Kudos
8 Replies

672 Views
w_wegner
Contributor III
Hi,

what do you mean by "management"? As long as you do not use special low-power modes or switching of the PLL, you just set the controller up with a special initialization sequence (which depends on type of SDRAM you use) and then use the configured memory area.

I only used Mobile-DDR SDRAM on my MCF5373L, so I am not sure if I can answer all regular or standard DDR SDRAM questions, but if you have more specific problems, I will try to help.

For switching of the PLL, I did not manage to do this myself, so I can not be of help in case there are problems in this area...

Regards,
Wolfgang
0 Kudos

672 Views
VeronicaFNX
Contributor I
management ->  It means an example of how to use SDRAM
0 Kudos

672 Views
w_wegner
Contributor III
Hi,

if you mean the initialization sequence, just share with us which SDRAM component you are using, then we can probably give you some values.

Wolfgang
0 Kudos

672 Views
VeronicaFNX
Contributor I
I refer to how reads and writes in SDRAM. I want an example of how it is used, not how it initializes
0 Kudos

672 Views
w_wegner
Contributor III
Then again you must specify what you have and want to know.

Which programming language, which operating system (or other environment)? In C you just set a pointer to a memory region in SDRAM and access it, where you get the pointer (malloc() or plain hand-coded address) depends on your operating system or environment.

Maybe I do not get your problem, but I can not really see a problem up to now...

Wolfgang
0 Kudos

672 Views
VeronicaFNX
Contributor I
Well ... I still have not done anything but I do not know where to start, so asking for help. I have to write data into memory and then read them.

The microcontroller is a coldfire m5329 and the code is in C.

If you can not help me, it does not matter, I will try to do something
 
Thanks
0 Kudos

672 Views
w_wegner
Contributor III
The address range for SDRAM starts at 0x40000000 on the MCF5329.
So assuming the SDRAM is mapped starting at this address and there is nobody else (no OS) using it, just use a pointer set to the address.

Just as an example, if you want to have two arrays of 256 Bytes each and a struct in memory:

unsigned char *array_1, *array_2;
typedef struct _s_data_struct {
int a;
int b;
int c;
} s_data_struct;
s_data_struct *data;

array_1 = (unsigned char *)0x40000000;
data = (s_data_struct *)0x40000000 + 256; /* reserve space for array data */
array_2 = (unsigned char *)0x40000000 + 256 + sizeof(s_data_struct); /* reserve space for first array and struct data */

Then use it like always:
array_1[0] = 0x0;
data->a = 2;

and so on...

You will have to use typecasts to avoid compiler warnings and I am always not sure about the order of the typedef, but for a starting point I hope it helps?

Wolfgang
0 Kudos

672 Views
VeronicaFNX
Contributor I
Thanks,
 
Something like this was what I needed
0 Kudos