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

PIC18F14K50 internal EEPROM

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



Joined: 31 Dec 2010
Posts: 39

View user's profile Send private message

PIC18F14K50 internal EEPROM
PostPosted: Fri Apr 01, 2011 2:41 pm     Reply with quote

I am trying to write to the internal EEPROM of the PIC18F14K50

I run the following code and it seems to read and write, but when I comment out the write operation and just do the read, it's not reading the data that was previously written.

Is there a fuse I'm missing?

Code:
#include <18F14K50.h>

#fuses HS,NOWDT,NOLVP,MCLR,PUT,NODEBUG,BROWNOUT,NOWRTD,NOCPD
#use delay(crystal=12000000)

#use rs232(baud=9600, UART1, errors)

void main()   
{
   char value;
   
   write_eeprom (1, '$');
   
   value = read_eeprom (1);
   
   printf("\r\nData: %c", value);
   
   while (TRUE)  {
   }
}
PCM programmer



Joined: 06 Sep 2003
Posts: 21708

View user's profile Send private message

PostPosted: Fri Apr 01, 2011 2:46 pm     Reply with quote

Your programming software is probably erasing the eeprom. Look in the
setup window for your programmer (i.e., MPLAB, etc.) and tell it to
preserve the eeprom.
pebbert9



Joined: 31 Dec 2010
Posts: 39

View user's profile Send private message

PostPosted: Fri Apr 01, 2011 3:05 pm     Reply with quote

Thank you, I had to disable it in CCSLOAD.
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