Use of eeprom in ccs PIC16F916

Thread Starter

Daniel37

Joined Nov 22, 2018
1
Hi,
I'm trying to program a PIC16F916 using CCS and i'm having problems with the instructions for use the eeprom.
Reading the ccs manual I thought the following instructions work by themselves
read_eeprom(adress)
write_eeprom (address,value)

But when I try to use them it simply doesn't work, in fact when i add these instructions to my code, the entire program stops working.
Is there any kind of configuration that i need to do before i can use them?
The way i'm using them is "a=read_eeprom(0);" and "write_eeprom(0,a);", where "a" is an int variable i'm using without problem in other parts of the code.
 

John P

Joined Oct 14, 2008
2,064
CCS = Custom Computer Services. They sell a compiler for PIC processors.

I suggest taking a look at the LST file, and see if the assembly language makes sense. I'd be suspicious of anything in there that involves waiting indefinitely for some event to occur, where it might actually never happen. Have you tried just writing, or just reading? Maybe only one of them has a problem.
 

Papabravo

Joined Feb 24, 2006
22,084
Sounds like the functions are referencing the wrong SFR locations. If that is the case they will be waiting on events that will never occur. To be sure you should write your own function for these two functions. Even if they are not as efficient -- at least you will know what the problem is.
 

spinnaker

Joined Oct 29, 2009
7,830
CCS = Custom Computer Services. They sell a compiler for PIC processors.

I suggest taking a look at the LST file, and see if the assembly language makes sense. I'd be suspicious of anything in there that involves waiting indefinitely for some event to occur, where it might actually never happen. Have you tried just writing, or just reading? Maybe only one of them has a problem.
Oh missed that CCS. Thanks.
 
Top