View previous topic :: View next topic |
Author |
Message |
Eddy71ua
Joined: 23 Sep 2009 Posts: 57 Location: Ukraine
|
A simple question about User ID |
Posted: Tue May 06, 2025 12:37 am |
|
|
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
|
|
Posted: Tue May 06, 2025 2:10 am |
|
|
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
|
|
Posted: Tue May 06, 2025 7:20 am |
|
|
Thank you very much! Everything works as it should.  |
|
 |
|