Now I would ask, how do you read these ID location in PBP?
Ioannis
From MPASM
For PIC18, I guess Darrel have the right ticket for that. Something based around the followingUsage
This directive is used in the following types of code: absolute or relocatable. For information on types of code, see Assembler Operation.
This directive is not commonly used, but does provide an easy method of serializing devices. __idlocs can be read by a programmer. PIC18 devices can read this value at run-time, but PIC12/16 devices cannot.
http://www.picbasic.co.uk/forum/showthread.php?t=4093
Steve
It's not a bug, it's a random feature.
There's no problem, only learning opportunities.
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.
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
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.
Alright, I manage to get it to work now. Thanks for the info guys.
Bookmarks