How to embed user ID into PIC


Closed Thread
Results 1 to 11 of 11

Hybrid View

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


    Did you find this post helpful? Yes | No

    Default

    I found this snip on Microchip website
    Code:
    	// read serial number from PIC ID memory at address 0x200000 - 0x200007
    	DWORD ReadIDMemory(void) {
    	DWORD IdMemory=0;
    	DWORD Temp;
    	BYTE i;
    	TBLPTR = (unsigned short long) 0x200000;
    
    	for(i=0;i<8;i++) {
    		_asm
    		TBLRDPOSTINC
    		_endasm
    		Temp=TABLAT;
    		Temp<<=((7-i)*4);
    		 IdMemory+=Temp;
    		}
    	
    	return IdMemory;
    }
    Steve

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

  2. #2
    Join Date
    Nov 2003
    Location
    Greece
    Posts
    4,161


    Did you find this post helpful? Yes | No

    Default

    I find these a little complicated and limited to 18 series.

    My good old programmer, (ELNEC PIKprog+), is doing this serialization in a very good manner. Also gives an option where to store the serial number, so one can choose to store in EEPROM or Code space. Reading then is childs play.

    Ooh, and it counts automatically of course with programmable step.

    I'd like though to have this option on my ICD2. Maybe one day Microchip will do it. Hope I am alive then!

    Ioannis

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


    Did you find this post helpful? Yes | No

    Default

    It is limited to PIC18 only if you want to access it at RunTime, unless most programmer are capable of reading the IDLOCS. And as you say, some also offer the automatic serialization, a nice plus.
    Steve

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

  4. #4
    Join Date
    Aug 2008
    Posts
    66


    Did you find this post helpful? Yes | No

    Thumbs up

    Alright, I manage to get it to work now. Thanks for the info guys.

Similar Threads

  1. SMS via pic
    By kenandere in forum GSM
    Replies: 15
    Last Post: - 10th March 2010, 10:00
  2. pic to pic ir link versus wired link : help please anyone
    By xnihilo in forum mel PIC BASIC Pro
    Replies: 13
    Last Post: - 30th May 2008, 21:01
  3. Multiple PIC programming
    By Nicholas in forum mel PIC BASIC Pro
    Replies: 0
    Last Post: - 7th May 2007, 23:47
  4. Serial Pic to Pic using HSER
    By Chadhammer in forum mel PIC BASIC Pro
    Replies: 5
    Last Post: - 11th March 2005, 23:14
  5. pic basic pro (novice user)
    By f6ggy in forum mel PIC BASIC Pro
    Replies: 1
    Last Post: - 3rd October 2003, 14:29

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