Anonymous
Not applicable
Apr 07, 2012
06:53 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Apr 07, 2012
06:53 AM
Hello. Is SRAM memory deleted if software or watchdog reset occurs? I know that RAM memory is volatyle, and i am using PSoC5.
Here is the code i would use for testing if SRAM is deleted or not if reset occurs. I am wondering if it is ok.
#include <device.h>
void main()
{
unsigned char *P = (unsigned char*)0x20000000;
unsigned char cnt = 0;
if(*P != 0xAA)
{
*P = 0xAA;
Pin1_Write(1); //led1 is on if SRAM is erased
Pin2_Write(0);
}
else
{
Pin1_Write(0);
Pin2_Write(1); //led2 is on if SRAM is not erased
}
for(;;)
{
cnt++;
CyDelay(1000);
if(cnt == 16)
CY_SET_REG8(RESET_CR2, 1); //software reset
}
}
Labels
- Labels:
-
PSoC 5LP
9 Replies