Email: Password: Remember Me | Create Account (Free)

Back to Subject List

Old thread has been locked -- no new posts accepted in this thread
???
08/02/00 13:00
Read: times


 
#4090 - RE: XRAM TEST
Dear Göran Persson,

Please refer the function below, using
some manipulation with xptr, it may
help you with your question. If not,
you should form your question as more
selective one.

/*************************************************************************
Function: chk_xram()
Created: 30.07.00
Description: Write patterns 0xAA55, 0x55AA and calculates thier CheckSum
Remarks: DO NOT USE THIS FUNCTION AFTER XRAM INITIALYZED!!!
Returns: 0 - ok, !0 - !ok
*************************************************************************/
unsigned char chk_xram(void)
{
unsigned char chk_sum, i;
unsigned char xdata * data xram_ptr;

for(i=0,xram_ptr=XRAM_START; xram_ptr<XRAM_SIZE; xram_ptr++,i++)
if(i % 2 == 0) *xram_ptr = 0xAA;
else *xram_ptr = 0x55;

for(chk_sum=0,xram_ptr=XRAM_START; xram_ptr<XRAM_SIZE; xram_ptr++)
chk_sum += *xram_ptr;

if(chk_sum)
return 0xFF;

for(i=0,xram_ptr=XRAM_START; xram_ptr<XRAM_SIZE; xram_ptr++,i++)
if(i % 2 == 0) *xram_ptr = 0x55;
else *xram_ptr = 0xAA;

for(chk_sum=0,xram_ptr=XRAM_START; xram_ptr<XRAM_SIZE; xram_ptr++)
chk_sum += *xram_ptr;

for(xram_ptr=XRAM_START; xram_ptr<XRAM_SIZE; xram_ptr++) *xram_ptr = 0;

return chk_sum;
}

Also, some other algorithms for xram
testing are invited.

Regards,
Oleg


List of 4 messages in thread
TopicAuthorDate
C51 and pointers!!            01/01/70 00:00      
RE: C51 and pointers!!            01/01/70 00:00      
RE: XRAM TEST            01/01/70 00:00      
RE: XRAM TEST            01/01/70 00:00      

Back to Subject List