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 do I write an ID and read ID from a chip?

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



Joined: 03 Dec 2008
Posts: 45

View user's profile Send private message

How do I write an ID and read ID from a chip?
PostPosted: Mon Nov 16, 2009 12:11 pm     Reply with quote

How do I use #ID to write an ID to a chip?
#ID 0x1234
#ID "serial.num" : Is that means When I write ID to a chip the program find serial number in file "serial.num" and write into it?
#ID CHECHNUM

Where did ID number locate? in EEPROM or special location like configuration memory 2007h.

How do I read this id?

Any concern for this question I appreciate here in advance.
PCM programmer



Joined: 06 Sep 2003
Posts: 21708

View user's profile Send private message

PostPosted: Mon Nov 16, 2009 2:39 pm     Reply with quote

Post your PIC.
cchappyboy



Joined: 03 Dec 2008
Posts: 45

View user's profile Send private message

PostPosted: Mon Nov 16, 2009 3:58 pm     Reply with quote

that is pic16f876
PCM programmer



Joined: 06 Sep 2003
Posts: 21708

View user's profile Send private message

PostPosted: Mon Nov 16, 2009 4:19 pm     Reply with quote

The 16F876 data sheet says this:
Quote:

12.16 ID Locations
Four memory locations (2000h - 2003h) are designated
as ID locations, where the user can store checksum or
other code identification numbers. These locations are
not accessible during normal execution, but are readable
and writable during program/verify. It is recommended
that only the 4 Least Significant bits of the ID
location are used.

16F876 data sheet:
http://ww1.microchip.com/downloads/en/DeviceDoc/30292c.pdf

More information is available in the 16F876 Programming Guide:
http://ww1.microchip.com/downloads/en/DeviceDoc/39025f.pdf
Look in this section:
Quote:
2.3 ID Locations


The CCS manual has a section on the #ID directive.
See page 101 (page 113 in the Acrobat reader):
http://www.ccsinfo.com/downloads/ccs_c_manual.pdf

The following CCS example file shows how to use the #ID directive:
Quote:
c:\program files\picc\examples\ex_checksum.c
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