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 support@ccsinfo.com

Access to internal data eeprom of PIC12F683

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



Joined: 17 Mar 2006
Posts: 1

View user's profile Send private message

Access to internal data eeprom of PIC12F683
PostPosted: Fri Mar 17, 2006 6:07 am     Reply with quote

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
PCM programmer



Joined: 06 Sep 2003
Posts: 21708

View user's profile Send private message

PostPosted: Fri Mar 17, 2006 1:13 pm     Reply with quote

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 ?
carlsorj
Guest







access to 12F683 EE
PostPosted: Thu Mar 23, 2006 8:17 pm     Reply with quote

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.
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