Reading Device ID from within PBP


Closed Thread
Results 1 to 6 of 6

Hybrid View

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


    Did you find this post helpful? Yes | No

    Default

    yes indeed that was simple to read the PIC ID using one part of the Darrel's code and a 18F4680
    Code:
        '   READING pic18f4680 DEVICE ID
        '
        DEFINE OSC 20
        DEFINE LOADER_USED 1
        DEFINE HSER_RCSTA 90h ' Enable serial port & continuous receive
        DEFINE HSER_TXSTA 24h ' Enable transmit, BRGH = 1
        DEFINE HSER_SPBRG 129 ' 9600 Baud @ 20MHz, 0.16%
        DEFINE HSER_CLROERR 1 ' Clear overflow automatically
        ID1 var byte
        ID2 var byte
        GOTO START
    
    @  #include "RTconfig.inc"
    
    START:  
        @ ReadConfig?CB _DEVID1, _ID1
        @ ReadConfig?CB _DEVID2, _ID2
        HSEROUT ["DEVID1=",HEX ID1,"    DEVID2=",HEX ID2]
        STOP
    Serial communicator show...
    Code:
    DEVID1=82    DEVID2=0E
    Using a my programmer to read the device, i have...
    Code:
    L0100: >> 24.02.2007, 13:10:13
    L0101: Reading device: Microchip PIC18F4680.
    L0102: Device insertion test ...
    L0103: Checking device ID ...
    L0104: Device ID: DEVID2=0Eh  DEVID1=82h
    L0105: Reading device ...
    L0106: Verifying device at VCCmax. ...
    L0107: Verifying device at VCCmin. ...
    L0108: Reading device - done.
    L0109: Elapsed time: 0:00:30.6
    L0110: Buffer checksum in range of device [0h..7FFFh]: 00FD3D23h
    Somehow interesting. i bet you will be able to change and create your own device ID in the ID locations at run time as well. Nice place to save the software version...
    Last edited by mister_e; - 24th February 2007 at 18:26.
    Steve

    It's not a bug, it's a random feature.
    There's no problem, only learning opportunities.

  2. #2


    Did you find this post helpful? Yes | No

    Red face oh you can change it alright

    Along with erasing osccal values, some of the free software or maybe a glitch has managed to erase the device id as well. i have a few pics that show up as unknown. I'm quickly becoming an expert on what NOT to do. lol.

Similar Threads

  1. PBP Book
    By Bruce in forum Off Topic
    Replies: 83
    Last Post: - 4th October 2021, 12:55
  2. Watchdog Timers
    By Squibcakes in forum mel PIC BASIC Pro
    Replies: 4
    Last Post: - 27th August 2014, 18:03
  3. RF Modules
    By tonyfelloni in forum mel PIC BASIC Pro
    Replies: 44
    Last Post: - 26th June 2010, 17:42
  4. Replies: 2
    Last Post: - 8th February 2009, 05:10
  5. @ Device Parameters
    By Randy_Suwanee in forum General
    Replies: 2
    Last Post: - 11th August 2004, 14:40

Members who have read this thread : 0

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