Hello to all,
Is there a method "i assume there is" to read a programmed serial number value from a PIC?
Hello to all,
Is there a method "i assume there is" to read a programmed serial number value from a PIC?
That depends.
16F's can NOT read the serial number at Run-Time.
They can only be read by an ICSP Programmer.
18F's CAN read the numbers at run-time.
If you have PBP2.50, it can be read with READCODE.
If you have a prior version of PBP, you can use this ...
Run-Time Config
http://www.picbasic.co.uk/forum/showthread.php?t=4093
<br>
DT
ok... i'd misread the post... once again
<hr>
maybe not after all... do you mean in your PIC code or with YOUR PIC programmer?
Last edited by mister_e; - 17th April 2008 at 01:18.
Steve
It's not a bug, it's a random feature.
There's no problem, only learning opportunities.
I believe the other guys are off here. The programmer allows you to change any memory position at all, during programming. That way you can set a random value in your code, and change it to a specific serial number when you program. For instance, you can set "x=123" in your code, and look at where the MOVW 123 command is in the asm file, and change that to your new serial number.
Yup, I was thinking of the wrong thing.
tenaja has the right idea.
<br>
DT
The picture he put in comes from the meprog application. The help file has this table:
From one of the data sheets for a 14 bit core I got this:Code:Device Type Code Data EEPROM ID Address Address Address 12-bit core 0-1FF none 200-203 0-3FF none 400-403 0-7FF none 800-803 14-bit core 0-1FFF 2100-21FF 2000-2003 17Cxxx 0-3FFF none none 18Xxxxx 0-1FFFF F00000-F003FF 200000-200007 24FJxxx 0-157FE none none 24HJxxxx 0-2ABFE none F80010-F80016 30Fxxxx 0-17FFE 7FF000-7FFFFE none 33FJxxxx 0-2ABFE none F80010-F80016
13.10 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 four least significant bits of the ID location are used.
So the answer to his question is that the locations programmed by the meprog serial number function are only accessable during program/verify.
Last edited by falingtrea; - 18th April 2008 at 15:54.
Tim Barr
Tim, I believe you are mixing up two unrelated features with two different products.
Yes, the picture comes from meprog; I am aware of this because I have it. The meprog allows you to program that incrementable "serial number" into any location you wish. You may program it into the "run-time unreadable" PIC ID Location if you want--but you don't have to! If you want to read it during run-time, then it would be advisable to find a different location to program the serial number to. Again, Meprog allows you to specify any location in memory. The last memory location (or near it) is an easy one, since you can be certain you aren't overwriting code (unless you have a bootloader).
Just because the PIC has a "serial number/ID" location does not mean you have to program the meprog "serial number" into that location. They are two entirely separate--yet compatible--features in two different products.
Now I'm confused. I ran MeProg and looked everywhere, including the ini file and could not find anything about changing the location where the serial number is programmed, when using the automatic Serial Numbering option. I agree that you could put the serial number anywhere, but my point is that MeProg seems to hard code the Serial Number function to the ID memory locations. I am using the beta version of the software, which may or maynot make a difference.
Tim Barr
Look at the JPG in the original post. The third textbox is "Starting Address." Not only do you get to select where the serial number goes, but you get to select the size of it, too.
Tenaja,
So there is indeed a way to read the programmed Serial number during run time. Can you show me an exmaple on how to read it? I am a rookie at reading EEPROMS from PIC's.
Thanks-N-Advance - Freddayz
I have done it with a different compiler, the commands will not be the same in PBP.
Since MELabs makes PBP and the programmer, I think a short call to them will get you a trustworthy answer.
Bookmarks