SRAM for MC56F8367

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

SRAM for MC56F8367

876 Views
padmaashok765
Contributor II

Hi

I am using two 128K X 16 Asynchronous SRAM for my project with mc56f8367 (codewarrior 10.7).

I am unable to find any example code to store and access data from sram.

I am facing trouble while programming. Can anyone help me .

Thanks in advance.

Labels (1)
Tags (3)
0 Kudos
5 Replies

717 Views
dynapb
Contributor IV

Hi Padma

It would be helpful to know how you have the SRAM chips connected to the DSC.

As Xiangjun Rong pointed out above, what CS lines are you using to access the SRAM.

A schematic or description would be good.

The example Code in CS_56F8367_PE.c (IN the attached file above) is very straightforward pointer access to memory:

These 2 lines define the location in memory (the second one could be SRAM).

      unsigned int * IOPointer=(unsigned int *)0x0008010;
      unsigned int * RAMPointer=(unsigned int *)0x0D10000;

These 2 lines write values to the locations.

      (*IOPointer)=0x1234; //base address is 008 Hex in cpu bean
      (*RAMPointer)=0x5678; //base address is D10 Hex

If you want to read from the locations you define a variable and then assign the value at the memory location to the variable.

Create the var.

      unsigned int  MemValue;

Assign a memory location value to the var.

      MemValue = *RAMPointer;

So if RAMPointer had 0x5678 in it, now MemValue would have 0x5678 in it.

Hope this help some.

Pete

0 Kudos

717 Views
xiangjun_rong
NXP TechSupport
NXP TechSupport

Hi, Padma,

For detailed information about the Asynchronous SRAM, pls refer to the Chapter 4
External Memory Interface (EMI).

Pls refer to the figure 4-3, you use 128K*16 bits SRAM, the memory address is from A0~A16, the A17~A23 are used to decode the /CS signal. I suppose for example, you use /CS2 for one 128K SRAM, /CS3  for another 128K SRAM.

1)For /CS1, you can use the address:

A23   A22   A21   A20                A19   A18   A17   A16.................

0         0       0       1                     1        1       1

You can access the 0x00 0000 to 0x 1E 0000 as the /CS2 address

You can set the Chip Select Base Address Registers 2 as 0x1E05

For /CS2, you can use the address:

A23   A22   A21   A20                A19   A18   A17   A16.................

0         0       0       1                     1        1       0

You can access the 0x00 0000 to 0x1C 0000 as the /CS3 address

You can set the Chip Select Base Address Registers 2 as 0x1C05

For the other register, you can set based on your requirement.

You can PE to set the EMI register.

Hope it can help you

BR

XiangJun Rong

pastedImage_1.png

0 Kudos

717 Views
padmaashok765
Contributor II

Hi

Thankyou. Still i find difficulties while programming as i have not used sram before.

Kindly can you send me a simple program to write a data and read that same data from sram.

0 Kudos

717 Views
xiangjun_rong
NXP TechSupport
NXP TechSupport

Hi, Padma,

Pls refer to the example code, the project is based on CodeWarrior for DSP56800E tools, it creates a project and uses PE to configure the external SRAM for MC56F8367EVM, it uses a pointer to access external SRAM.

Hope it can help you

BR

Xiangjun Rong

0 Kudos

717 Views
padmaashok765
Contributor II

Hi,

There is no example code for mc56f8367 SRAM module in codewarrior 11.1 package. 

0 Kudos