Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

[PIC] Unable to program PIC18F45K50 with PICkit2

Status
Not open for further replies.

K33rg4t3

Full Member level 3
Full Member level 3
Joined
Aug 2, 2015
Messages
165
Helped
7
Reputation
14
Reaction score
7
Trophy points
1,298
Activity points
2,607
Hello all.
This is my first post here!

I am trying to program PIC18F45K50 with PICkit2.
I have sucessfully programmed several chips with this PICkit2, but the PIC18F45K50 turned out to be not supported.
So I've downloaded modified devices file from Microchip forums.
After that the chip was sucessfully recognized, but it always say that "All protect" is enabled (Code Protection).

Even after I erase the chip from PICkit2, it still says that "All protect" is ON.

I have tried with several different PIC18F45K50 and the problem is always the same.

Please note that I have already programmed PIC18F4550 (without 'K') and it worked fine.
My current hardware setup (I am trying to program PIC18F45K50 on breadboard) is also OK, because it works if I replace the PIC18F45K50 with PIC18F4550.

So I have no idea what's wrong. Can anyone help me? I didn't set any "code protect" bits.

I am attaching screenshots from PICkit2 software. It clearly shows that only first two bytes of PINGUINO hex files are properly written to PIC18F45K50. The rest is broken. Also, the verification fails after writing.

PS: I was able to program correctly multiple PICs with my PICkit, including 24F, and 30 families, so I have really no idea why I'm having such bugs with PIC18F45K50.

Here are the screenshots from PICkit2 IDE:
First is reading the brand-new MCU, second is writing, and third is reading it again.
1read.png2trying_to_write.png3read.png
And this is the devices file used:
View attachment PK2DeviceFile.zip
Please help, I really need to program this PIC18F45K50!
 

Are you trying to program both devices with the same HEX file?
While the two devices may be pin-for-pin compatible, that does not mean that can be programmed from the same HEX file (or even the same source file without necessary changes to the configuration settings).
Looking at the Microchip web site for the two devices, the PIC18F4550 lists the PicKit2 as as programmer, the PIC18F45K50 does not. This does not mean that the PicKit2 cannot be made to program the device, but it may require more than a firmware update.
The bottom line is that you may eventually get this to work, but the correct approach is to use supported tools and software.
Also there is a possibly relevant item at http://www.microchip.com/forums/m842235.aspx and also a couple at http://dangerousprototypes.com/tag/pic18f45k50/.
Susan
 
Susan suspicious are correct, although support for the PICkit 2 has all but vanished from the Microchip website, the final released versions of both the standalone software app and firmware, along with the sources, can be downloaded from their archives:

**broken link removed**

The final released versions:

PICkit 2 Software for Windows v2.61

PICkit 2 Device Firmware v2.32

And contain the Release Notes which listed all devices supported by that specific version, I've attached the final PICkit 2 Readme v2-61-00 (a).txt below.

Unfortunately, it does not list the PIC18F45K50, therefore the PIC18F45K50 is not officially support by the PICkit 2.

PIC18F_K_ Devices
-----------------
PIC18F13K22 PIC18LF13K22 PIC18F14K22 PIC18LF14K22
PIC18F13K50 PIC18LF13K50 PIC18F14K50 PIC18LF14K50
PIC18F14K50-ICD
PIC18F23K20 PIC18F24K20 PIC18F25K20 PIC18F26K20
PIC18F43K20 PIC18F44K20 PIC18F45K20 PIC18F46K20


You might be able to find third party modifications, which have modified the final official releases which may enable the PIC18F45K50 to be programmed.

However if not, you will need to either utilize another programmer which support the PIC18F45K50 or choose another microcontroller supported by the PICkit 2.


BigDog
 

Attachments

  • PICkit 2 Readme v2-61-00 (a).txt
    56.8 KB · Views: 196

This thread might help you add device support to PICKIT2, without the risk of installing third party firmware.
 
Sorry Susan, but I am using the valid hex files. Each device has separate hex file programmed especially for it. So that's not the hex files matter.

bigdogguru - You are right, I've already downloaded modified devices file from Microchip forums., as said in the first post. That's what I did from the beginning. I saw that PIC18F45K50 is not supported, so I've downloaded modified devices file from Microchip forums.

abidr - the modified devices file from the first post was said to be created this way by somebody on microchip forums, and as you see, it didn't work for me. Well, maybe it was done incorrectly? How can I add that PIC18F45K50 myself using this application? What values should I type?
 

hello,


on my pickit2 , family PIC-K
the PIC18F45K50 appears in the list .
check your version of file *.dat

my Pickit2 files..
stored into "C:\Program Files (x86)\Microchip\PICkit 2 v2\PICkit2V2.exe"

Pickit2_18F45K50.jpg

View attachment PK2.zip
 

@paulfjujo Thank you, so, I've checked your zip, and:
- your Pickit exe and version are exacly the same as mine, the file size and modification date are also the same
- your devices file is different
I've tried to use what you send but the problem persist.
Nothing changed.
After I "Erase" the PIC18F45K50, the "All protect" warning is still shown. And I am still not able to program it with any hex.
I have also tried "Slow programming", but the problem is still here.

Any other ideas? I really need to program that PIC18F45K50..
 

Attachments

  • pkbug.png
    pkbug.png
    66.5 KB · Views: 271

In the tools Tab of "PICkit 2 Programmer" window see if you have opted for "Enable Code Protect" and/or "Enable data Protect"
 

I know, already tried that.

I was able to disable those options, but they somehow come back "greyed out" after reading.
It looks like they are set permanently in the chip, this is very strange.

I have never had such troubles with other chips, like 18F2550, 18F4550, or 16F or dsPIC * families.
 

Ok first of all delete/backup all instances of C:\Program Files (x86)\Microchip\PICkit 2 v2\PK2DeviceFile.dat and replace with the the one in the attached zip file. It is the one that I have personally edited and it does include the mentioned chip.

Also ensure to disable the following:
"Enable Code Protect" and/or "Enable data Protect"
 

Attachments

  • PK2DeviceFile.zip
    20.6 KB · Views: 226

Maybe your poblem is not with Pickit2
what is your power supply value on your PIC18F45k50 ?
because not using Vdd from Pickit
Post your "config bits file" (...*.cfgsch)
 

@46abidr

Thank you, but it says "unsupported device" with ID 0x5C00. Please take a look at the attachment.
Btw: I had the same error when I used non-modified Devices file from PICKIT2.

@51paulfjujo

The voltage is 4.9 V
I don't have .cfgsch, I have only hex file. This is it: https://github.com/PinguinoIDE/ping...v4.x/hex/Bootloader_v4.14_18f45k50_INTOSC.hex
Btw: but my problem is not hex-file related. I can't write ANYTHING to those PIC18F45K50. I am not even able to clear their protection.


EDIT: Right now I tested on other PC, the problem is still the same.
I have made a video with testing write/erase/read operations with PK.zip attached in one of the posts above.
Video is in the attachments.
Looks like I can't erase the "Code protect" and/or "data protect" stuff.

View attachment pickit_try_to_program_PIC18F45K50.rar
 

Attachments

  • 5c00.png
    5c00.png
    23.3 KB · Views: 230
Last edited:

Head over here read through the website and make a custom PK2DeviceFile.dat for yourself; alternately if you don't want to do anything yourself head over here to download already edited file.
 

hello,


I tried to load your Bootloader...hex into my pickit2 ... without succes
i get an error : unable to read the file
With texte editor i supress the first 2 blank lines into the files
then i can load the hex .. successfully

and with some value as config bits .. to test if FOSC from Internal OSC

Nota: i don't have this PIC to test the loading of hex into it... i only have a 18F4550, or 18F45K22..

Bootloader_loading.jpg

i renamed the hex file ! as zip

View attachment 18f45k50_INTOSC.hex.zip



on your video *.avi

Why do you d'ont have any voltage as VDD ?
whitout any voltage on VDD , you can't do nothing ..
put VDD ON if pickit2 power the MCU

on previous post , you said power is 4,9V
and on pickit2 we can see grayed value of 3,4V
Pickit2 must indicate 4,9V.
 
Last edited:

I tried to load your Bootloader...hex into my pickit2 ... without succes
i get an error : unable to read the file
With texte editor i supress the first 2 blank lines into the files
then i can load the hex .. successfully

I have never such troubles.

and with some value as config bits .. to test if FOSC from Internal OSC


I don't understand, but I think it's not the case, because I can't even CLEAR the all protect (code protect/data protect) bits on my PIC18F45K50, so my trouble is not related to hex files. The "Erase" function of PICKIT2 is not working correctly on PIC18F45K50s.




on your video *.avi

Why do you d'ont have any voltage as VDD ?
whitout any voltage on VDD , you can't do nothing ..
put VDD ON if pickit2 power the MCU

on previous post , you said power is 4,9V
and on pickit2 we can see grayed value of 3,4V
Pickit2 must indicate 4,9V.


You are right, but I am NOT using original pickit2 and I am using PICKIT2 CLONE, where I have to supply the VCC (5V in most cases, and sometimes 3.3V for eg. PIC32s) myself. It's normal and it works OK for me, so please ignore that voltage. I am using this clone as ICSP.


Head over here read through the website and make a custom PK2DeviceFile.dat for yourself; alternately if you don't want to do anything yourself head over here to download already edited file.

I have already checked the device files from the links (both ones). They give me the error as said above.
I don't know how to use device files editor, tough.
 
Last edited:

Hey, I tried to program that PIC with Brenner8 (version 4, the one with three transistors) but it also failed to remove the "all protection" (I used "Erase" option twice!).

Here is the log:
Code:
US-Burn V1.13 a4
-- Windows NT/2000/XP/Vista
-- Version 5.1 (WinXP) Build 2600
-- Service Pack 3
-- PIC-database V.33 (15/08/2012)
-- USB-DLL-Version : 00010000
## NO HEX-file loaded
-- 1 sprut-device(s) detected
-- Brenner8, Firmware V. 0.17
-- Uz_me= 3.431
-- Uz_ee= 3.31
-- Ukor= 0.9647
-- Vdd = 4.824
## firmware defectiv

PIC18F45K50 in database:
 Vpp : 8.5V (8 .. 9V)

## ATTENTION codeprotection is activ
## Block 0 Code Protect: Enabled
## Block 1 Code Protect: Enabled
## Block 3 Code Protect: Enabled
## Boot Block Code Protect: Enabled
## Data EEPROM Code Protect: Enabled

remove CodeProtection: -finished
PIC18F45K50 in database:
 Vpp : 8.5V (8 .. 9V)

## ATTENTION codeprotection is activ
## Block 0 Code Protect: Enabled
## Block 1 Code Protect: Enabled
## Block 3 Code Protect: Enabled
## Boot Block Code Protect: Enabled
## Data EEPROM Code Protect: Enabled

Erase PIC -finished

Erase PIC -finished

Blank-Check :
## 32767 error(s) in FLASH
(-- 7 error(s) in ID, don't care)
-- EEPROM is blank
(-- 9 error(s) in CONFIG, don't care)

what's wrong with those PICs... I have few of them with the same issue...
 

Status
Not open for further replies.

Similar threads

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top