ID Locations
Moderator: Benj
ID Locations
From the data sheet for PIC18F2480/2580/4480/4580;
"ID Locations
Eight memory locations (200000h-200007h) are
designated as ID locations, where the user can store
checksum or other code identification numbers."
How can these be accessed via FlowCode?
"ID Locations
Eight memory locations (200000h-200007h) are
designated as ID locations, where the user can store
checksum or other code identification numbers."
How can these be accessed via FlowCode?
Last edited by dbasnett on Fri Oct 14, 2011 1:33 pm, edited 2 times in total.
- Steve
- Matrix Staff
- Posts: 3434
- Joined: Tue Jan 03, 2006 3:59 pm
- Has thanked: 114 times
- Been thanked: 422 times
Re: ID Locations
You can read back the HEX file (using PPP or similar).
If you want to read back while the program is running, then only some chips allow this. Look in the datasheet for the chip for more info (usually in the "Special Features of the CPU -> ID locations" section). For example:
If you want to read back while the program is running, then only some chips allow this. Look in the datasheet for the chip for more info (usually in the "Special Features of the CPU -> ID locations" section). For example:
16F877a datasheet wrote:14.17 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 4 Least Significant bits of
the ID location are used.
18F4455 datasheet wrote:25.6 ID Locations
Eight memory locations (200000h-200007h) are
designated as ID locations, where the user can store
checksum or other code identification numbers. These
locations are both readable and writable during normal
execution through the TBLRD and TBLWT instructions
or during program/verify. The ID locations can be read
when the device is code-protected.
Re: ID Locations
Added this to the supplementary code
#pragma DATA 0x200000, 68,101,119,97,121,110,101,66
and received the following error:
Sending program...
Erasing the PICmicro
NOTE: EEPROM data will also be erased!
Writing program memory
...
Writing EEPROM memory
Writing configuration memory
Writing id-locations
Reading program memory
Reading configuration memory
Reading data memory
Finished reading PICmicro contents
Programming failed:
Data memory check failed
(NOTE: if the PIC is code-protected, this message will be
displayed even if the program has been sent correctly)
That took 4.072 seconds
Return code = 0
FINISHED
This does not appear to affect the operation of the actual code. I did notice that the ID location in the Expert Config of the chip is NOT the address above.
#pragma DATA 0x200000, 68,101,119,97,121,110,101,66
and received the following error:
Sending program...
Erasing the PICmicro
NOTE: EEPROM data will also be erased!
Writing program memory
...
Writing EEPROM memory
Writing configuration memory
Writing id-locations
Reading program memory
Reading configuration memory
Reading data memory
Finished reading PICmicro contents
Programming failed:
Data memory check failed
(NOTE: if the PIC is code-protected, this message will be
displayed even if the program has been sent correctly)
That took 4.072 seconds
Return code = 0
FINISHED
This does not appear to affect the operation of the actual code. I did notice that the ID location in the Expert Config of the chip is NOT the address above.
Re: ID Locations
Yes, here is the entire supplementary code:
//Definitions and function declarations:
//======================================
#pragma DATA _EEPROM,0,255,"Copyright - acme.com, 2011",255,255
#pragma DATA 0x200000, 68,101,119,97,121,110,101,66
//Function implementations:
//=========================
I did notice in the expert config of the chip(18F4580) that it has different ID locations defined (0x3FFFFE) in the Misc. section.
//Definitions and function declarations:
//======================================
#pragma DATA _EEPROM,0,255,"Copyright - acme.com, 2011",255,255
#pragma DATA 0x200000, 68,101,119,97,121,110,101,66
//Function implementations:
//=========================
I did notice in the expert config of the chip(18F4580) that it has different ID locations defined (0x3FFFFE) in the Misc. section.
- Steve
- Matrix Staff
- Posts: 3434
- Joined: Tue Jan 03, 2006 3:59 pm
- Has thanked: 114 times
- Been thanked: 422 times
Re: ID Locations
The "ID Location" setting at 0x3FFFFE is the location of the built-in read-only ID of the chip (i.e. it identifies the chip type and revision). This is not the same as the User ID Locations.
Are you able to program the ID Locations using PPPv3 directly? I've tried with an 18F4455 chip and it seems to work. Also, programming this chip's EEPROM memory and ID Locations via Supplementary Code seems to work fine too.
I've also tried the same thing with an 18F4580 device and it has worked fine. I can only assume your chip is broken.
Are you able to program the ID Locations using PPPv3 directly? I've tried with an 18F4455 chip and it seems to work. Also, programming this chip's EEPROM memory and ID Locations via Supplementary Code seems to work fine too.
I've also tried the same thing with an 18F4580 device and it has worked fine. I can only assume your chip is broken.
Re: ID Locations
Defective chip seems like the answer, but other than the download to the chip all seems well.
I have attached the hex file and hope that you can download it to a 4580 and see if you get errors.
If you attach a EB004 to Port D the program should toggle D3 of the EB004 once per second. Thanks.
I have attached the hex file and hope that you can download it to a 4580 and see if you get errors.
If you attach a EB004 to Port D the program should toggle D3 of the EB004 once per second. Thanks.
- Attachments
-
- TrainerTarget_v4.hex
- (13.06 KiB) Downloaded 229 times
- Steve
- Matrix Staff
- Posts: 3434
- Joined: Tue Jan 03, 2006 3:59 pm
- Has thanked: 114 times
- Been thanked: 422 times
Re: ID Locations
The problem with the HEX file seems to be with the EEPROM data. If I change the first character of the EEPROM memory data to 0x7F (instead of 0x80), then it works fine. It looks like for the first location, the top bit needs to be clear. I really don't know why this is the case!
Re: ID Locations
I tried 127 and 64 for the first byte of the EEPROM data and still had the same error.
I have attached the new hex file(64 as first byte of EEPROM). Thanks for your help.
I have attached the new hex file(64 as first byte of EEPROM). Thanks for your help.
- Attachments
-
- TrainerTarget_v4.hex
- (13.06 KiB) Downloaded 158 times
- Steve
- Matrix Staff
- Posts: 3434
- Joined: Tue Jan 03, 2006 3:59 pm
- Has thanked: 114 times
- Been thanked: 422 times
Re: ID Locations
I'm sorry, but I do not have the time to deal with this at the moment. We are very busy with developing Flowcode V5 and I have already spent a few hours on this issue.
To help you solve this, you should try producing programs without data memory and/or ID location data to narrow down the problem. It does seem strange though that you are getting different results to me.
To help you solve this, you should try producing programs without data memory and/or ID location data to narrow down the problem. It does seem strange though that you are getting different results to me.
Re: ID Locations
Removing the supplementary code clears the error. As I have said the error does not seem to impact the operation or correctness of the data that is loaded. When things calm down I hope you have time to investigate this further. A lot of us are looking forward to v5. Good luck.