The PICKit3 programmer can do it but you would have to read the Manual to find out how.
I know that it works, having used it in the past, but that was on 32 BIT PIC devices.
Not all, if any, 8 Bit devices may be able to support it.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
You may be able to write incremental serial numbers using MPLAB IPE with "SQTP". Suggest you download MPLABX and install IPE. Then read the documentation regarding SQTP, As I understand it you can configure to write sequential or random numbers to program memory, eeprom, or UserID locations.
I have never used this and am not sure what programmers are supported with SQTP.
This appears to be a "demo" with no instructions or help other than the posted code.
Can it write to UserID or EEPROM locations where Serial numbers are typically stored?
What is the format of the .cnt file ?
Where is is the explanation ?
How would this be implemented in a production environment for say 100 chips?
Last edit: William Roth 2021-02-25
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I just got home. I was previously responding on my cell phone.
Loaded exampleprogram_to_autocreate_version_and_timestamp.gcb from the folder D:\GCB@Syn40\GreatCowBasic\Demos\converter_solutions I am running RC4), so change to your installation folder.
I compiled the program . As part of the compilation process - the #include "gcbversionnumber.cnt" statement issued a version number.
During this process the compiler
- creates a new source called gcbversionnumber.gcb.
- creates a file in the same folder as the user program called gcbversionnumber.cnt.
gcbversionnumber.cnt is a text file and it can be opened in the IDE. gcbversionnumber.cnt contains the number 1.
gcbversionnumber.gcb is the routine used to expose the variables. It is created/updated by the converter.
This number value was exposed in the user program as versionString. Subsequent compilations increments this value.
That is about all I can think of. It auto-creates and auto-increments a build number that is exposed as a string.
Usage can be adapted as part of the build process to revert the gcbversionnumber.cnt if errors happen but that is down to the implementation details.
I just looked at my setip. I have 17 copies of Hexmate. Microchip use it the merge, manage and update hex. There is a huge resource of info on the web re Hexmate.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
@Stan. You are correct - this code is in a lot demos - this would have been used for LCD, GLCD display etc. I also use when I am developing a library to ensure I am testing the latest version.
:-)
Last edit: Anobium 2021-02-25
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Hello
can somehow have a data variable where this number will be increased every time i program a chip ?
a production serial numbering
The PICKit3 programmer can do it but you would have to read the Manual to find out how.
I know that it works, having used it in the past, but that was on 32 BIT PIC devices.
Not all, if any, 8 Bit devices may be able to support it.
You may be able to write incremental serial numbers using MPLAB IPE with "SQTP". Suggest you download MPLABX and install IPE. Then read the documentation regarding SQTP, As I understand it you can configure to write sequential or random numbers to program memory, eeprom, or UserID locations.
I have never used this and am not sure what programmers are supported with SQTP.
https://microchipsupport.force.com/s/article/How-to-load-a-SQTP-file-in-MPLAB-IPE
mplab ide will better avoid it if possible, since i have to learn it :)
intresting in gcbasic capabiliies
Update.
I just used SQTP with MPLAB IPE 5.40 using a SNAP Programmer. It worked very well and added a serial number to the USERID area of a PIC18F27Q43.
There is no reason that this could not work with a PICKIT3 or with most other PIC microcontrollers. Just follow the instructions in the provided link.
This took me all of about 15 minutes to figure out.
Last edit: William Roth 2021-02-25
GCB has no built in capability to do what you want. I suggesed MPLAP "IPE" Not MPLAB "IDE".
IPE is relatively simple
Sorry. You can do within the compiler.
See the converter https://github.com/Anobium/Great-Cow-BASIC-Demonstration-Sources/blob/master/Converter_Solutions/ExampleProgram_to_autoCreate_version_and_timestamp.gcb
This will serialise, auto increment, add dates etc.
How? Please provide detailed steps plus a working example
See GitHub post above, and, in the Help.
Last edit: Anobium 2021-02-25
This appears to be a "demo" with no instructions or help other than the posted code.
Can it write to UserID or EEPROM locations where Serial numbers are typically stored?
What is the format of the .cnt file ?
Where is is the explanation ?
How would this be implemented in a production environment for say 100 chips?
Last edit: William Roth 2021-02-25
The code is documented. There is more in the Help.
The file format is a text file. Contains the version number.
Use exposed variables as you wish.
or, do not use the method.
Last edit: Anobium 2021-02-25
I just got home. I was previously responding on my cell phone.
Loaded
exampleprogram_to_autocreate_version_and_timestamp.gcb
from the folderD:\GCB@Syn40\GreatCowBasic\Demos\converter_solutions
I am running RC4), so change to your installation folder.I compiled the program . As part of the compilation process - the
#include "gcbversionnumber.cnt"
statement issued a version number.During this process the compiler
- creates a new source called
gcbversionnumber.gcb
.- creates a file in the same folder as the user program called
gcbversionnumber.cnt
.gcbversionnumber.cnt
is a text file and it can be opened in the IDE.gcbversionnumber.cnt
contains the number 1.gcbversionnumber.gcb
is the routine used to expose the variables. It is created/updated by the converter.This number value was exposed in the user program as
versionString
. Subsequent compilations increments this value.That is about all I can think of. It auto-creates and auto-increments a build number that is exposed as a string.
Usage can be adapted as part of the build process to revert the
gcbversionnumber.cnt
if errors happen but that is down to the implementation details.As shown in the source program.
I have not looked at the Help, but, must be something similar in the Help in terms of the details.
i see thanx
Not use ite yet, but example is self explanatory.
However this means that i have to "compile+program" every time, which even not original asked, is not bad for now :)
Then, Hexmate is the answer.
I just looked at my setip. I have 17 copies of Hexmate. Microchip use it the merge, manage and update hex. There is a huge resource of info on the web re Hexmate.
Anobium, A lot of your code has a date/time whatever.
In the ili touch test it overwrites the clear label, even when commented out
@Stan. You are correct - this code is in a lot demos - this would have been used for LCD, GLCD display etc. I also use when I am developing a library to ensure I am testing the latest version.
:-)
Last edit: Anobium 2021-02-25