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

How to write value 300 to eeprom ?

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



Joined: 23 May 2015
Posts: 4
Location: chennai

View user's profile Send private message

PIC 16f877a EEPROM Accessing
PostPosted: Sat May 23, 2015 3:10 am     Reply with quote

Good morning..

I have PIC 16f877a. Now i write the value 300 in this pic EEPROM
I am using following Syntax its only store the value 0 to 255.
so Pls Guid to store the value of 300 in this pic eeprom.

write_eeprom (0x00,300);
i=read_eeprom (0x00);
asmboy



Joined: 20 Nov 2007
Posts: 2128
Location: albany ny

View user's profile Send private message AIM Address

PostPosted: Sat May 23, 2015 7:11 am     Reply with quote

you need to write a WORD

in 2 bytes of EEPROM

see the MAKE8() function
Ttelmah



Joined: 11 Mar 2010
Posts: 19552

View user's profile Send private message

PostPosted: Sun May 24, 2015 1:19 am     Reply with quote

As a further comment, try reading the manual.....

Section:

"How do I write variables to EEPROM that are not a byte?" and the example this links to.
jeremiah



Joined: 20 Jul 2010
Posts: 1358

View user's profile Send private message

PostPosted: Sun May 24, 2015 10:39 am     Reply with quote

I gave you an answer in your duplicate thread as well:

https://www.ccsinfo.com/forum/viewtopic.php?t=53948
gopi



Joined: 23 May 2015
Posts: 4
Location: chennai

View user's profile Send private message

PostPosted: Tue May 26, 2015 9:47 am     Reply with quote

I have use to print above 255 value in PIC 16f877a eeprom.
syntax:

write_program_eeprom(address,data);
value=read_program_eeprom(address);
its work correctly.
gopi



Joined: 23 May 2015
Posts: 4
Location: chennai

View user's profile Send private message

How to store string in PIC 16f877a eeprom
PostPosted: Tue May 26, 2015 9:48 am     Reply with quote

How to store string in PIC 16f877a eeprom.

Pls send the syntax.
temtronic



Joined: 01 Jul 2010
Posts: 9246
Location: Greensville,Ontario

View user's profile Send private message

PostPosted: Tue May 26, 2015 10:34 am     Reply with quote

Simply create a function to compute the length of the string and then store each byte of the string until you get to the 'end of string' character which is a null (0).
I leave it to you to look at the string functions CCS supplies as I assume this is a school project as the 877 is, well, obsolete !

Jay
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