• AVR Freaks

PICkit2 Devicefile Editor

Page: < 12345.. > >> Showing page 5 of 6
Author
davegsm82
New Member
  • Total Posts : 27
  • Reward points : 0
  • Joined: 2007/02/05 15:48:34
  • Location: 0
  • Status: offline
Re: PICkit2 Devicefile Editor 2017/04/07 15:25:22 (permalink)
0
I've modified the file with the config bits and device ID from the datasheet, set the EEPROM size, set the Flash size, set the config masks and blanks, set the number of config and ID words.
 
Unfortunately when I open PK2 and select the 18F26k40 I get the following error message, seems to be something to do with the configBlank array;
 
See the end of this message for details on invoking 
just-in-time (JIT) debugging instead of this dialog box.

************** Exception Text **************
System.IndexOutOfRangeException: Index was outside the bounds of the array.
   at PICkit2V2.DeviceData.ClearConfigWords(UInt16[] configBlank)
   at PICkit2V2.DeviceData..ctor(UInt32 progMemSize, UInt16 eeMemSize, Byte numConfigs, Byte numIDs, UInt32 memBlankVal, Int32 eeBytes, Int32 idBytes, UInt16[] configBlank, UInt32 OSCCALInit)
   at PICkit2V2.PICkitFunctions.ResetBuffers()
   at PICkit2V2.PICkitFunctions.PrepNewPart(Boolean resetBuffers)
   at PICkit2V2.FormPICkit2.selectPart(Object sender, EventArgs e)
   at System.Windows.Forms.ComboBox.OnSelectionChangeCommitted(EventArgs e)
   at System.Windows.Forms.ComboBox.OnSelectionChangeCommittedInternal(EventArgs e)
   at System.Windows.Forms.ComboBox.WmReflectCommand(Message& m)
   at System.Windows.Forms.ComboBox.WndProc(Message& m)
   at System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& m)
   at System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m)
   at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)


************** Loaded Assemblies **************
mscorlib
    Assembly Version: 2.0.0.0
    Win32 Version: 2.0.50727.5485 (Win7SP1GDR.050727-5400)
    CodeBase: file:///C:/Windows/Microsoft.NET/Framework/v2.0.50727/mscorlib.dll
----------------------------------------
PICkit2V2
    Assembly Version: 2.61.0.0

 
Can anyone PLEASE help me out with this?
 
Dave.
#81
timijk
Super Member
  • Total Posts : 1216
  • Reward points : 0
  • Joined: 2007/11/26 00:30:07
  • Location: Taiwan
  • Status: offline
Re: PICkit2 Devicefile Editor 2017/04/08 00:42:51 (permalink)
3 (1)
the maximum number for the ConfigMasks and ConfigBlank is 9, if your ConfigWords is more than that, it might cause problems.
#82
davegsm82
New Member
  • Total Posts : 27
  • Reward points : 0
  • Joined: 2007/02/05 15:48:34
  • Location: 0
  • Status: offline
Re: PICkit2 Devicefile Editor 2017/04/08 01:28:54 (permalink)
0
Hi Timijk,
 
my number of config words is 6, when I open the boxes to change the config words it seems like you can't remove them so I have to set [6] and [7] to 0x0000.
 

 
Thank you for your help.
#83
timijk
Super Member
  • Total Posts : 1216
  • Reward points : 0
  • Joined: 2007/11/26 00:30:07
  • Location: Taiwan
  • Status: offline
Re: PICkit2 Devicefile Editor 2017/04/08 03:44:48 (permalink)
3 (1)
The source code is at http://www.microchip.com/development-tools/downloads-archive
it's at the bottom of the page.
 
You can use Microsoft Visual Studio to debug it. Or you can post the zipped file here, I can take a look at it.
 
#84
scasis
Super Member
  • Total Posts : 121
  • Reward points : 0
  • Joined: 2011/01/07 01:18:59
  • Location: 0
  • Status: offline
Re: PICkit2 Devicefile Editor 2017/04/08 07:36:51 (permalink)
0
Hi,
just set ConfigWords to the number of registers the part needs and set ConfigBlank and ConfigMask to 0 for not required words. In the arrays 8 item will always be seen. There is a Config9Blank and a Config9Mask in the Pk2Devicefile structure, set theses as well.
 
On the other hand, the editor only copies the reference of array element, so duplicate a part or a script and change only the name field. Save the file and reopen it. If You edit array content before reopening the file, the array in the original part or script will be modified as well. 
post edited by scasis - 2017/04/08 07:40:32
#85
davegsm82
New Member
  • Total Posts : 27
  • Reward points : 0
  • Joined: 2007/02/05 15:48:34
  • Location: 0
  • Status: offline
Re: PICkit2 Devicefile Editor 2017/04/08 13:59:03 (permalink)
0
Thank you Timijk and scasis,
 
I've used a fresh copy of the device file and copied the 26K22, renamed it 26K40, closed the editor and reopened it.
 
After this I've copied all the values i worked out for the 26K40 from the datasheet, after doing this I've opened PK2 again and it doesn't generate an error when opened, however I can't get it to communicate with the 26K40, it just says "No device Detected" when you click read, whether thats using manual device selection or automatic.
 
Are there any suggestions for things to try to get this communicating? I've noticed there are different scripts for various functions.
#86
scasis
Super Member
  • Total Posts : 121
  • Reward points : 0
  • Joined: 2011/01/07 01:18:59
  • Location: 0
  • Status: offline
Re: PICkit2 Devicefile Editor 2017/04/09 05:02:06 (permalink)
3 (1)
Hi,
the PIC18FxxK40 and PIC18FxxK42 families use a new programming method based on SPI.
See programming specification: DS40001772.
#87
davegsm82
New Member
  • Total Posts : 27
  • Reward points : 0
  • Joined: 2007/02/05 15:48:34
  • Location: 0
  • Status: offline
Re: PICkit2 Devicefile Editor 2017/04/09 07:22:03 (permalink)
3 (1)
scasis
Hi,
the PIC18FxxK40 and PIC18FxxK42 families use a new programming method based on SPI.
See programming specification: DS40001772.




Oh no, I guess this means my wheezy old PK2 or PK3 won't be able to program it then :( 
 
I do have an ICD2 kicking about somewhere but I suppose that will be the same story.
#88
Jim Nickerson
User 452
  • Total Posts : 6187
  • Reward points : 0
  • Joined: 2003/11/07 12:35:10
  • Location: San Diego, CA
  • Status: offline
Re: PICkit2 Devicefile Editor 2017/04/09 07:51:06 (permalink)
0
I think your PK3 will still work once updated to handle the newer chips.
The programming specification says the 24 bit payload is "SPI" compatible .
#89
davegsm82
New Member
  • Total Posts : 27
  • Reward points : 0
  • Joined: 2007/02/05 15:48:34
  • Location: 0
  • Status: offline
Re: PICkit2 Devicefile Editor 2017/04/09 08:03:00 (permalink)
4.5 (2)
JANickerson
I think your PK3 will still work once updated to handle the newer chips.
The programming specification says the 24 bit payload is "SPI" compatible .




Thanks Jim. 
 
Seems a shame that the workhorse PK2 is being left behind, it's my go-to programmer and I fear I may just look for a different micro, rather than have to resort to the PK3. Looking at the programming specification it's as if microchip has changed the number of entry clock cycles to an odd value (33) instead of the old 32, meaning that any programmer would require a firmware upgrade at the very least to be able to write to them.
 
Real shame as I had big plans.
 
Dave.
#90
Jim Nickerson
User 452
  • Total Posts : 6187
  • Reward points : 0
  • Joined: 2003/11/07 12:35:10
  • Location: San Diego, CA
  • Status: offline
Re: PICkit2 Devicefile Editor 2017/04/09 08:06:00 (permalink)
3 (1)
Looking at the programming specification I wonder if a simple SPI based programmer is in our future ?
I thought I saw the PK2 source code available.
#91
davegsm82
New Member
  • Total Posts : 27
  • Reward points : 0
  • Joined: 2007/02/05 15:48:34
  • Location: 0
  • Status: offline
Re: PICkit2 Devicefile Editor 2017/04/09 08:19:26 (permalink)
3 (1)
Quite possibly Jim, realistically it's not a bad idea, but it seems a bit of a shock to the system to suddenly change programmer language with no backward compatibility support. Usually there's some kind of transition period but it doesn't appear that way this time. 
 
The speicification does say 'describes an SPI-based programming method... ' which would lead you to think that perhaps this is an alternative, i.e. original method still works, but after thrashing away with this device on a breadboard it seems like it doesn't want to play. I wish microchip would make this clearer and a bit less ambiguous.
 
Currently I couldn't stomach trying to come up with my own programmer (or modding the PK2) and download software, I just don't have the time. The Project that this device was destined for is going to take up enough of my time as it is so it looks like I might have to backtrack a little and find something else (if anyone can suggest a 64K 28 pin SOIC package with EEPROM, USART, I2C and separate SPI then I'd love to hear from you), currently I'm using a 18F2620 but I need separate I2C and SPI :( 
#92
Jim Nickerson
User 452
  • Total Posts : 6187
  • Reward points : 0
  • Joined: 2003/11/07 12:35:10
  • Location: San Diego, CA
  • Status: offline
Re: PICkit2 Devicefile Editor 2017/04/09 08:25:10 (permalink)
3 (1)
I think the  PK3 is pretty inexpensive.
I am not familiar with the Atmel programming specification, I wonder if this is a unifying attempt ?
 
#93
qhb
Superb Member
  • Total Posts : 9998
  • Reward points : 0
  • Joined: 2016/06/05 14:55:32
  • Location: One step ahead...
  • Status: offline
Re: PICkit2 Devicefile Editor 2017/04/09 13:31:40 (permalink)
3 (1)
JANickerson
I am not familiar with the Atmel programming specification, I wonder if this is a unifying attempt ?

The Atmel interface is very similar to SPI!
It even uses the SPI pins on the Atmega chips we've used.
#94
BorisZarkov
New Member
  • Total Posts : 2
  • Reward points : 0
  • Joined: 2016/01/08 19:40:06
  • Location: 0
  • Status: offline
Re: PICkit2 Devicefile Editor 2017/04/26 15:06:22 (permalink)
3 (1)
Hello, did someone add PIC32MZ2048ECG device so far? 
Is it possible to duplicate PIC32MX460 and modify it to fit PIC32MZ. 
It is very hard for me to find requred microcontroller data, and when i found something it is difficult to understand.
Can someone help me to create this device.
#95
scasis
Super Member
  • Total Posts : 121
  • Reward points : 0
  • Joined: 2011/01/07 01:18:59
  • Location: 0
  • Status: offline
Re: PICkit2 Devicefile Editor 2017/04/26 23:17:12 (permalink)
4 (1)
Hi,
in the original version of program (PICkit2 V2.61) and the device file (Pk2DeviceFile 1.61.xx) have are several problems with PIC32MZ, and PIC32MK type controllers:
- The Device Id of 32-bit controllers masked with a mask having only 8 bits, parts cannot identified correctly.
- The Revision ID not shifted down to bit 0. Not so important.
- The program can handle only 9 config registers, and these registers have only 16 bits.
- The download buffer has 256 bytes, but PIC32MZ, and PIC32MK have a raw size of 512 words. PIC32MX having 128 word page size can handled using ProgMemWritePrepareScript and ProgMemWriteScript downloading data for a raw in two passes.
- The programming Executive hard coded into the application, but PIC32MZ, and PIC32MK controllers require different ones.
#96
BorisZarkov
New Member
  • Total Posts : 2
  • Reward points : 0
  • Joined: 2016/01/08 19:40:06
  • Location: 0
  • Status: offline
Re: PICkit2 Devicefile Editor 2017/04/27 04:11:45 (permalink)
3 (1)
Thank you for fast answer,
Actually I use PICKit3.3 but there must be no difference, that is why I not mention it.
So far I have changed ID , config address , memory size and config masks.
When I try to flash my PIC there is error "Programming Program Flash Failed"
 

 
Now I try to alternate download buffer size, I have copied FlashWrPrep script and try to add more word elements, but PK2device file editor sad me "You cannot change the number of elements in script"
 
I have not much experience with microcontrollers. Is there easyer way to flash my 32MZ2048ECG with pickit3. I use mikroC to develop firmware.
#97
timijk
Super Member
  • Total Posts : 1216
  • Reward points : 0
  • Joined: 2007/11/26 00:30:07
  • Location: Taiwan
  • Status: offline
Re: PICkit2 Devicefile Editor 2017/04/27 07:41:19 (permalink)
0
If you are using the PICkit 3 scripting tool (standalone application), you can "revert to MPLAB mode" and installed MPLAB X which also has MPLAB IPE.  Then you can use MPLAB IPE to flash your device with the HEX file.
 
http://www.microchip.com/...load.axd?file=0;987764
post edited by timijk - 2017/04/27 07:50:27
#98
P Lameijn
Super Member
  • Total Posts : 1967
  • Reward points : 0
  • Joined: 2004/01/22 18:30:23
  • Location: The Netherlands
  • Status: offline
Re: PICkit2 Devicefile Editor 2017/06/04 02:59:16 (permalink)
3 (1)
Has anyony already added (or tried to add) the 24FJ1024GA610 to the pickit2 devicelist?
I started it, but I see a problem with the config words (the're not continuous).
The dual boot mode may also be a problem.
 
I would like to get it working, because we have quite a number of PK2's in the field (for small updates)
Would be a shame to have to swap them all for a PK3.
(works bad, is slow, and has no decent working standalone GUI ...)
 

Regards,
Peter
#99
mindthefrequency
New Member
  • Total Posts : 7
  • Reward points : 0
  • Joined: 2017/02/27 18:15:29
  • Location: 0
  • Status: offline
Re: PICkit2 Devicefile Editor 2017/07/07 18:19:50 (permalink)
0
While trying to add the PIC16F1765 to my PK2DeviceFile.dat file, I seem to have found a device ID mismatch between the actual PIC device ID (hard coded) and the PIC16F1765 Memory Programming Specification ("40001754A.pdf", page 8, table 3-1 DEVICE ID VALUES).
 
Before any updates are made on the PK2DeviceFile.dat:
connecting the PicKit to the uc and running the PICKit 2 programmer software returns:
 Device: Unsupported Part (ID=0x3080)
 
But according to "40001754A.pdf" and table 3-1 DEVICE ID VALUES, PIC16F1765 should return the ID value: 0x3081
 
Meaning I can only get the PIC16F1765 recognized by PICKit 2 when I set its DeviceId field to 0x3080 in the PK2DeviceFile.dat file.
 
Hope this makes sense!? Curious to know if I'm the only one who has found this problem.
 
Also, if anyone could help me by referring a device that would work as a good starting point to edit the PIC16F1765 in the PK2DeviceFile.dat file, It would be awesome.
So many options and I cant really get around whats happening inside the scripts!
 
Thanks in advance
Page: < 12345.. > >> Showing page 5 of 6
Jump to:
© 2019 APG vNext Commercial Version 4.5