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

A simple question about User ID

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



Joined: 23 Sep 2009
Posts: 57
Location: Ukraine

View user's profile Send private message Visit poster's website

A simple question about User ID
PostPosted: Tue May 06, 2025 12:37 am     Reply with quote

All controllers, including the basic families, have a User ID in the memory, it can be read by the programmer even if the read protection is set.

In the compiler manual I did not find how to set User ID value in the source code.

There are only commands for reading-writing User ID by PIC18-24 families of controllers from the user code
jaka



Joined: 04 May 2014
Posts: 39
Location: Finland

View user's profile Send private message

PostPosted: Tue May 06, 2025 2:10 am     Reply with quote

You can use this:
Code:
#id 0xac, 0xdc, 0xab, 0xba

There might be limitation for some chips to store only the lowest 7 or 8 bits of User ID word (as was recommended for some very old PICs)

If you want to store full words, you can use this:
Code:
#rom 0x8000 = {0x1234, 0x3550, 0x1111, 0x2222}

This can be used also for parts which have more than 4 User ID locations, e.g. 18F Q10 series which has 128 User ID words. But you need to specify the User ID address. The above example with 0x8000 is for 16F, for 18F is is usually 0x200000.
Eddy71ua



Joined: 23 Sep 2009
Posts: 57
Location: Ukraine

View user's profile Send private message Visit poster's website

PostPosted: Tue May 06, 2025 7:20 am     Reply with quote

Thank you very much! Everything works as it should. Rolling Eyes
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