How to read Serial number programmed into PIC


Closed Thread
Results 1 to 11 of 11
  1. #1
    Join Date
    Feb 2008
    Posts
    6

    Default How to read Serial number programmed into PIC

    Hello to all,

    Is there a method "i assume there is" to read a programmed serial number value from a PIC?
    Attached Images Attached Images  

  2. #2
    Join Date
    Jul 2003
    Location
    Colorado Springs
    Posts
    4,959


    Did you find this post helpful? Yes | No

    Default

    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

  3. #3
    Join Date
    Sep 2004
    Location
    montreal, canada
    Posts
    6,898


    Did you find this post helpful? Yes | No

    Default

    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.

  4. #4
    Join Date
    Sep 2007
    Location
    USA, CA
    Posts
    271


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by freddayz View Post
    Hello to all,

    Is there a method "i assume there is" to read a programmed serial number value from a PIC?
    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.

  5. #5
    Join Date
    Jul 2003
    Location
    Colorado Springs
    Posts
    4,959


    Did you find this post helpful? Yes | No

    Default

    Yup, I was thinking of the wrong thing.

    tenaja has the right idea.
    <br>
    DT

  6. #6


    Did you find this post helpful? Yes | No

    Default

    The picture he put in comes from the meprog application. The help file has this table:
    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
    From one of the data sheets for a 14 bit core I got this:

    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

  7. #7
    Join Date
    Sep 2007
    Location
    USA, CA
    Posts
    271


    Did you find this post helpful? Yes | No

    Default

    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.

  8. #8


    Did you find this post helpful? Yes | No

    Default

    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

  9. #9
    Join Date
    Sep 2007
    Location
    USA, CA
    Posts
    271


    Did you find this post helpful? Yes | No

    Default

    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.

  10. #10
    Join Date
    Feb 2008
    Posts
    6


    Did you find this post helpful? Yes | No

    Default How to read Serial number programmed into PIC

    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

  11. #11
    Join Date
    Sep 2007
    Location
    USA, CA
    Posts
    271


    Did you find this post helpful? Yes | No

    Default

    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.

Similar Threads

  1. PIC to PIC "wired" serial one-way communication - SERIN2/SEROUT2
    By flotulopex in forum mel PIC BASIC Pro
    Replies: 5
    Last Post: - 14th April 2008, 20:02
  2. PIC to serial with visual basic
    By mbw123 in forum mel PIC BASIC Pro
    Replies: 7
    Last Post: - 31st March 2007, 16:06
  3. Replies: 5
    Last Post: - 20th March 2006, 01:34
  4. Serial Communication (PC to PIC)
    By Simon Brodeur in forum mel PIC BASIC Pro
    Replies: 2
    Last Post: - 11th January 2006, 18:55
  5. serial comm from Pic to STAMP
    By d1camero in forum mel PIC BASIC Pro
    Replies: 1
    Last Post: - 4th April 2004, 23:58

Members who have read this thread : 1

You do not have permission to view the list of names.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts