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

Problem: Writing\Reading to\from internal EEPROM

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



Joined: 29 Jun 2010
Posts: 33

View user's profile Send private message Yahoo Messenger

Problem: Writing\Reading to\from internal EEPROM
PostPosted: Tue Sep 21, 2010 3:30 pm     Reply with quote

I don't know about EEPROM writing. What is the allowable Address range for writing data. I need a example about it. Help me please.
I use PIC16F876a


Last edited by HGHK on Wed Sep 22, 2010 1:17 am; edited 1 time in total
PCM programmer



Joined: 06 Sep 2003
Posts: 21708

View user's profile Send private message

PostPosted: Tue Sep 21, 2010 4:11 pm     Reply with quote

Quote:
What is the allowable Address range for writing data ?

Always post your PIC. We don't remember it from your previous posts.
Look in the front of the data sheet for your PIC. It will list the number
of bytes of data eeprom that are available. For example: 256
The address range is then 0 to 255.

Quote:
I need a example about it.

http://www.ccsinfo.com/forum/viewtopic.php?t=43338&start=3
HGHK



Joined: 29 Jun 2010
Posts: 33

View user's profile Send private message Yahoo Messenger

#rom
PostPosted: Wed Sep 22, 2010 6:08 am     Reply with quote

what is doing of :
Quote:

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

in your program?
pleas explain that 0x55 , 0xaa, 0xf00000 are refer to what?
PCM programmer



Joined: 06 Sep 2003
Posts: 21708

View user's profile Send private message

PostPosted: Wed Sep 22, 2010 2:13 pm     Reply with quote

Quote:

0x55 , 0xaa, 0xf00000 are refer to what?

It's a method to pre-load the data eeprom when the PIC is programmed
with your ICD2 (etc.) programmer. So when the PIC first starts running
it will already have eeprom address 0 set to 0x55, and eeprom address 1
will be set to 0xAA. The eeprom address in Flash Memory is found in the
Programming Specification for your PIC. However, see below:

The new method (recommended by several forum members) is to let
the CCS compiler supply the Flash Memory address of the data eeprom.
That way, you don't have to find it in the Programming Specification.
You can do this with the "getenv()" function, as shown below:
Code:

#include <16F877.H>
#fuses XT, NOWDT, NOPROTECT, BROWNOUT, PUT, NOLVP
#use delay(clock=4000000)
#use rs232(baud=9600, xmit=PIN_C6, rcv=PIN_C7, ERRORS)

#ROM getenv("EEPROM_ADDRESS") = {0x55, 0xAA}

//==========================================
void main()
{

while(1);
}

By using this method, you can more easily switch your program to a new
PIC family, such as from 16F to 18F.
HGHK



Joined: 29 Jun 2010
Posts: 33

View user's profile Send private message Yahoo Messenger

write eeprom
PostPosted: Tue Sep 28, 2010 1:03 am     Reply with quote

Only by using write_eeprom without #ROM address={list} I write in eeprom data in PIC16F876A and it not work carefully.
Help me please.
PCM programmer



Joined: 06 Sep 2003
Posts: 21708

View user's profile Send private message

PostPosted: Tue Sep 28, 2010 1:15 pm     Reply with quote

Quote:

I write in eeprom data in PIC16F876A and it not work

See this demo program:
http://www.ccsinfo.com/forum/viewtopic.php?t=17590&start=1
rikotech8



Joined: 10 Dec 2011
Posts: 376
Location: Sofiq,Bulgariq

View user's profile Send private message

PostPosted: Thu Oct 11, 2012 10:47 am     Reply with quote

What is the first compiler version that support
Quote:
getenv("EEPROM_ADDRESS")

Mine is 4.114.
PCM programmer



Joined: 06 Sep 2003
Posts: 21708

View user's profile Send private message

PostPosted: Thu Oct 11, 2012 11:38 am     Reply with quote

Please don't ask eeprom questions all over the forum.
This is your eeprom thread, here:
http://www.ccsinfo.com/forum/viewtopic.php?t=48909
Let's continue working on your eeprom questions there.
Ask your questions in that thread.
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