CCS C Software and Maintenance Offers
FAQFAQ   FAQForum Help   FAQOfficial CCS Support   SearchSearch  RegisterRegister 

ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

CCS does not monitor this forum on a regular basis.

Please do not post bug reports on this forum. Send them to CCS Technical Support

lost eeprom data when eeprom address upper than 256(18f8722)

 
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion
View previous topic :: View next topic  
Author Message
PCM programmer



Joined: 06 Sep 2003
Posts: 21708

View user's profile Send private message

PostPosted: Thu Aug 19, 2010 3:24 pm     Reply with quote

Try a very simple test program, such as the one shown below.
I ran it in MPLAB simulator with vs. 4.110 and I got this result:
Quote:

Initial values: 55, aa
After writing: 12, 34

That's correct. Try it and see what you get. If it fails, then post your
compiler version.
Code:

#include <18F8722.h>
#fuses INTRC_IO, NOWDT, BROWNOUT, PUT, NOLVP
#use delay(clock=4000000)
#use rs232(baud=9600, xmit=PIN_C6, rcv=PIN_C7, ERRORS)

#rom int8 0xf00000={0x55, 0xAA}

//==========================
main()
{
int8 a;
int8 b;

a = read_eeprom(0);
b = read_eeprom(1);

printf("Initial values: %x, %x \n\r", a, b);

write_eeprom(0,0x12);
write_eeprom(1,0x34);

a = read_eeprom(0);
b = read_eeprom(1);

printf("After writing: %x, %x \n\r", a, b);

while(1);
}
ali1_f



Joined: 19 Aug 2010
Posts: 4

View user's profile Send private message

PostPosted: Fri Aug 20, 2010 1:37 am     Reply with quote

Thanks for your reply.

Its working.

Best Regards
Display posts from previous:   
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group