Anobium / PICKitPlus

This is the PICkitPlus device database repository. This is the device database used by PICkitPlus for the PICkit 2 and PICkit 3 programmers. The parts database is partially supported by the original Microchip PICkit GUIs software - rename the dat file. To obtain the PICKitPlus software, see our website. Here:
http://www.pickitplus.co.uk
48 stars 22 forks source link

Write progmem, eemem, userIDs and config. #11

Closed Anobium closed 3 years ago

Anobium commented 3 years ago

Approach:

1. Write using PK+GUI with no verify Using IPE-PK4 generated hex file.
Disable Verify in PK+GUI. Write the HEX using PK+GUI.

2. Verify using IPE-PK4 Verify in PK4 usng the IPE-PK4 generated hex file.
Result Expected from IPE-PK4 Verify No errors in IPE.

3. Verify using PK+GUI Back to PK+GUI, load the Using IPE-PK4 generated hex file, and verify. Result Expected from PK+GUI Verify No errors in PK+GUI.

Anobium commented 3 years ago

Results from 2. Verify using IPE-PK4 - failed on CONFIG.

IPE results.

The following memory area(s) will be verified:
program memory: start address = 0x0, end address = 0xffff
configuration memory
EEData memory
User Id Memory
Verify failed.  [config mem] 0x300000, expected 0x70, got 0x77
You have set the program speed to Normal. The circuit on your board may require you to slow the speed down. Please change the setting in the tool properties to low and try the operation again.
Verify failed
Verify Failed

Set the memory regions as follows in IPE to isolate the failure.

image

EEMem = pass UserID = pass PROGMEM = pass CONFIG = fail


Isolation using IPE shows the error to be with CONFIG verify.

The following memory area(s) will be verified:
configuration memory
Verify failed.  [config mem] 0x300000, expected 0x70, got 0x77
Verify failed
Verify Failed
Anobium commented 3 years ago

Resolved. But, took 33 hours of work over 4 days.

The Q43 is fundamentally different from other PIC with respect to config. The datasheet is clear that the config are defined in BYTES not WORDS. Config 1 to 8 and 10. However, this is NOT the only change. The ICSP programming protocol (which is NOT defined in the 'PIC18FXXQ43 Family Programming Specification' is that the order of the config BYTEs is not compatible with all config operations what went before.

The Q32 obviously requires the BYTES in the order 1-2-3 etc to 10, but, if this is compared to all PICs prior then the WORDs are written in byte order of 2,1,4,3,6,5,8,7,10,9 - this is because the PICKitPlus GUI data model is WORD based and was never written to handle a config defined as a byte.

To resolve was required a fundamental decision to maintain the PICKitPlus GUI data model as WORDs for the config and to byte exchange the config during write, read and verify operations. This is the best approach as the PK2 Scripting Language was not able to support the byte exchange operation (I did try).

I found the different (BYTE exchange ) by examination of the ICSP on-the-wire inspection of the transmission. This is NOT clear in the data sheet and there is major change to the requirement to set the config byte MASK when writing. This again was not required in the prior ISCP protocol.

This is a major change to the software where all version of the PICKitPlus applications prior to December 2020 cannot support the Q43 chips and an upgrade is required.


Summary. After lots of on the wire examination and testing the chip works.