News:

Let's find out together what makes a PIC Tick!

Main Menu

writing to ID-location using pickit3

Started by Lemans, Sep 04, 2022, 10:14 AM

Previous topic - Next topic

Lemans

I want to be able to identify individual software-programmes by reading back the ID-locations.
so I can identify the software-version by ID-number.

I used to do this with a micro-electronika programmer; "Microprog". which made it really simple.
due to some other reasons I had to switch to the pickit3, which is a reliable programmer.

but I haven't found a method or procedure to program the ID-locations using this pickit programming a 16F628/648

anyone with a solution?.
regards A

Lemans

#1
it is possible when programming with the pickit3 and using the MPLAB IPE.

open MPLAB IPE
go to settings -> advanced mode -> SQTP

select sequential
start value: ID-number you want to use, for instance "AB"
increment: = 0
location: user ID Memory

click "generate" and save file SQTP-File

go to "operate"
-> select source file
-> select SQTP-file
-> program
done

it works but is tedious as you have to select two files, one hex-file and one SQTP-file with the ID-number.
it would have been nice if you could set the ID-number of your hex-file in the Proton environment

Mapo

Search inside this Bootloader created by Alberto Freixanet, it can reads and writes ID of the pic

tumbleweed

For the 16F628, the format of the IDLOC is a single 4-digit hex word (only the low bytes are used).
This is different than the PIC18.

If you add the following to your basic source then it will place the data into the hex file and should get programmed when you read in the file with the PK3.

Asm
__IDLOCS 0x1234
EndAsm
 

Lemans

Quote from: tumbleweed on Sep 16, 2022, 12:26 PMFor the 16F628,
Asm
__IDLOCS 0x1234
EndAsm

tried this one, but doesn't work.
regards A

tumbleweed

I don't have a 16F628 to try this on, but when I compile this:
Device = 16F628
Xtal = 16

Asm
__IDLOCS 0xABCD
EndAsm

it puts the following in the resulting asm .lst and .hex files:
2000   000A 000B 000C 00722 __IDLOCS 0XABCD
       000D

Loading the hex file into the PK3 using pickitminus it shows the User ID values set to what's in the hex file.

initID.jpg

Lemans

#6
which compiler are you using

works when you put a double "underscore" in front of IDLOCS
I used only 1 underscore

and should be used after the config-statement

great, thanks

Lemans

been using this method for some days now and it works great.
placing the ID-locs direct after start of file and you can identify file and version directly

should have known this some years ago.
regards Anne