cancel
Showing results for 
Search instead for 
Did you mean: 

Regarding SRAM

bbbodekar
Associate II
Posted on July 18, 2003 at 02:05

Regarding SRAM

5 REPLIES 5
bbbodekar
Associate II
Posted on May 17, 2011 at 11:54

Dear Friemds,

I am tryig to write and read the SRAM. I have initialised the SRAM at 0x2000 to 0x3fff in the PSDSoft, and in my 'C' code, i have initialised it in the SRARTUP.A51 file to be at location 2000h.

For accesing the SRAM, i have used a structure as -

typedef xdata struct sram_regs

{

unsigned int version ;

} mem_regs ;

and for accessing it i have -

xdata mem_regs SRAM _at_ SRAM_ADDR ;

where

define SRAM_ADDR 0x2000

This decleration/usage is like the one for the PSD_Regs defined in the sample code.

But i still am not able to read the memory properly. I need to read the data from it after every 2 sec, but it always shows some different data.

Is there some more to it, like setting the pointer or something like that.

Kindly recommend as to what to do

Regards,

Bhushan.

joseph2399
Associate II
Posted on May 17, 2011 at 11:54

If you want to do both write and read to the SRAM, you need to setup SRAM to the Combined Space Mode. This is done by setting the appropriate bits in the VM register at MCU runtime. Please take a look at Figure 53 and Table 87 of the uPSD3200 data sheet.

bbbodekar
Associate II
Posted on May 17, 2011 at 11:54

Dear Sir/ Madam,

Thanks for you kind reply. I have gone through the Fig 54 and table 87 regarding the SRAM configuration.

Like you said, i have to use the SRAM as an internal EEPROM, from which i have to do the read and write.

I want to know that to configure the SRAM in combined memory space, -

1. do i need to configure the Main flash memory and the Secondary flash memory ( both ) into the combined memory space.

2. is it enough to configure the battery backup on the pin PC2 to VSTBY. will that provide the backup for the SRAM data during the power fail.

I have UPSD3200 dev.kit but i intend to use uPSD3233B-40 in future for my product development.

Regards,

Bhushan.

joseph2399
Associate II
Posted on May 17, 2011 at 11:54

I want to know that to configure the SRAM in combined memory space, -

1. do i need to configure the Main flash memory and the Secondary flash memory ( both ) into the combined memory space.

Answer: Yes. You may want to take a look at our design example 2 (USB demo), it does reads/writes to the SRAM.

2. is it enough to configure the battery backup on the pin PC2 to VSTBY. will that provide the backup for the SRAM data during the power fail.

Answer: Yes. But be careful that some of the older DK3200 eval boards had a wong value resister installed, therefore VSTBY will not work properly, I am not sure if you got one of those. Please read the errata sheet from our website at:

http://www.st.com/stonline/prodpres/memory/psd/pdf/dk3200er.pdf

bbbodekar
Associate II
Posted on May 17, 2011 at 11:54

Hello,

Thanks for your reply.

I checked my board and found R33 to be 4.99K but couldnt see the values for R39 and R40 as they are under the LCD.

Also i have gone through with what you have suggested regarding the SRAM, will try that and let you know if it works. But i have not been able to locate in which code the SRAM is accessed in the USB example.

Regards,

Bhushan.