View previous topic :: View next topic |
Author |
Message |
hav
Joined: 17 Mar 2006 Posts: 1
|
Access to internal data eeprom of PIC12F683 |
Posted: Fri Mar 17, 2006 6:07 am |
|
|
I started a new project where I like to store 3 x byte and recall them again after power is restored to the product again.
I use the CCS PCWH 3.241, and the code read_eeprom(address) and write_eeprom(address,data).
I have looked at my LST file and seen thet the assembler code match the procedure that the datasheet sayes i shall.
But I can not recall my data or it may not be storaged.
Does anybody have a clue on what I missing?
Thanks for any help.
CODE:
.
.
.
#Define IHB_EE 00
#Define IMB_EE 01
#Define ILB_EE 02
.
.
.
/ ----------------------------------------------------------------------------
//
//
// ----------------------------------------------------------------------------
VOID SETON_WRITE()
{
write_eeprom(IMB_EE, Highbyte);
write_eeprom(IMB_EE, Midbyte);
write_eeprom(ILB_EE, Lowbyte);
}
// ----------------------------------------------------------------------------
//
//
// ----------------------------------------------------------------------------
VOID SETON_READ()
{
Highbyte = read_eeprom(IHB_EE);
Midbyte = read_eeprom(IMB_EE);
Lowbyte = read_eeprom(ILB_EE);
} _________________ Harry |
|
![](templates/subSilver/images/spacer.gif) |
PCM programmer
Joined: 06 Sep 2003 Posts: 21708
|
|
Posted: Fri Mar 17, 2006 1:13 pm |
|
|
Make a test program similar to the one in the following post:
http://www.ccsinfo.com/forum/viewtopic.php?t=19607&start=1
The 12F683 has its data eeprom at address 0x2100 so you
can use the same #rom statement as shown in that program.
The 12F683 doesn't have a hardware UART, so you'll have to
use a soft UART instead.
One question:
Are you testing this in hardware or are you trying to do testing
with the MPLAB simulator ? |
|
![](templates/subSilver/images/spacer.gif) |
carlsorj Guest
|
access to 12F683 EE |
Posted: Thu Mar 23, 2006 8:17 pm |
|
|
If you are using the standard compiler from CCS it is simple - following is all I did:
byte minvalue;
minvalue = read_eeprom(0x01);
write_eeprom( 0x01, minvalue );
If you are trying to look at it with the debugger you have to use the debug header from microchip. However, I don't think the debugger works reading the EE, I used an MELabs programmer to get the EE data - it works. |
|
![](templates/subSilver/images/spacer.gif) |
|