cancel
Showing results for 
Search instead for 
Did you mean: 

RAM Retention

gabriele2
Associate II
Posted on June 18, 2004 at 12:48

RAM Retention

8 REPLIES 8
gabriele2
Associate II
Posted on May 28, 2004 at 13:06

Hello,

I'm using the ST72C254 microcontroller. After a external reset without power-down I find that the value of the variables in RAM changed. The value changes after 30-40 times. Did you just find the same problems?
alok2
Associate II
Posted on June 02, 2004 at 02:28

Are you sure you are not using startup routines of the compiler ? These reset the variables to 0 or the init value declared. If you want to use the RAM values after reset, I think you dont have to use startup. What do you say ?

gabriele2
Associate II
Posted on June 03, 2004 at 04:58

Hello, in the startup routine I use only the RSP instruction and the CALL to 2 functions: CheckRAM and MAIN. In the MAIN function I have a never-ending loop that continues to write 0 in 4 variables. In the CheckRAM routine, called after reset, I control if the value of the 4 variables is 0. I see that in this so simple program the value is still not 0 after 1 hour. If the program is more complex the value changes after 30-40 external reset (5 seconds between 2 resets)

alok2
Associate II
Posted on June 15, 2004 at 02:34

Which compiler you are using ? Metrowerks/cosmic/assembly tool chain ? Can you attach your source code ?

gabriele2
Associate II
Posted on June 17, 2004 at 08:15

Hi, I'm using the COSMIC compiler version 4_2b. In the attached files you can see that after power_on 4 variables are set to 0. In the main loop the 4 variables are always set to 0 and it is the only instruction done. Then after every reset in the function ConfrontoRAM I check if the variables are all 0, if it isn't the green led is switched off else it is switched on. I see that after 30 minutes the green led is switched_off. This problem is seen in the ST72254 but the same software doesn't have any problem in the st72264

________________

Attachments :

main.rtf : https://st--c.eu10.content.force.com/sfc/dist/version/download/?oid=00Db0000000YtG6&ids=0680X000006I09G&d=%2Fa%2F0X0000000bUp%2Ffn.G8LJDlLjM1AEAjDEwZojKIZa0vXUi8ygS1oEdJ8E&asPdf=false

STARTUP.S : https://st--c.eu10.content.force.com/sfc/dist/version/download/?oid=00Db0000000YtG6&ids=0680X000006I0B1&d=%2Fa%2F0X0000000bUo%2FMgnswLgRVyA9K9eSGYpBi_d0u77E6PM9MH20XRXS6Js&asPdf=false
luca239955_st
Associate III
Posted on June 17, 2004 at 13:12

Hi,

maybe some spurious interrupt that you're not servicing? Try to disable interrutps explicitly in the startup. Just a thougth.

How are you creating resets? With the reset line (button)? Watchdog? LVD?

By the way, I can't compile your code as it is posted, I guess you have modified the header file; please post it.

Regards,

Luca

gabriele2
Associate II
Posted on June 17, 2004 at 14:07

Hi, I attach the vector table and the I-O definition of the ports. I create an external reset on the reset pin using a signal generator. The problem is not visible if the reset is caused with a WDG reset.

Thank you

________________

Attachments :

io72212.rtf : https://st--c.eu10.content.force.com/sfc/dist/version/download/?oid=00Db0000000YtG6&ids=0680X000006I0Aw&d=%2Fa%2F0X0000000bUk%2FnuuVQgjgKkU.tHhdipTS564nFo7kqwGJDKSP0dPa.0Y&asPdf=false

vector.rtf : https://st--c.eu10.content.force.com/sfc/dist/version/download/?oid=00Db0000000YtG6&ids=0680X000006I08S&d=%2Fa%2F0X0000000bUl%2F7ksBM9vjW1i.dsTl2A8EUI1fqhXbfybEbI.cweKJxa0&asPdf=false
luca239955_st
Associate III
Posted on June 18, 2004 at 12:48

Hi,

I see no problem with the code.

On a side note (that I'm afraid won't help you much), to access the single bits of hardware registers, there's an alternative that is probably a bit simpler (but maybe less portable) than the structures you have declared:

_Bool

mailto:PA0@PADR:0

; // absolute bit variable

Good Luck,

Luca