PIC18F24K50 programming problems - Page 1
Forum section: electronics / general

author: Emil
author_rank: Regular Contributor
timestamp: January 14, 2015, 09:58:08 am
content: I have not been able to program a PIC18F24K50.I use a PICkit3 (Olimex xlone). With the stand alone PICkit 3 programmer software I can not detect the chip, error msg: "No device found". I think this software may not be compatible with the 24k50, as I have not found any supported device list which lists 24k50. Can anyone confirm if this is correct or not? If so, any updates to fix it?Using MPLAB IPE I can choose the correct device, but not connect to it, error msg: "Connection failed."Connections from 18f24k50 (SSOP package) to PK3 programmer:Pin 1 ---> MCLR (with 10K pullup to VDD)Pin 20 ---> VDDPin 8,19 ---> VSSPin 28 ---> PGDPin 27 ---> PGCAs far as I can tell from the datasheet this is correct.I have tried it with two chips on two boards with the same result.I have verified voltage on the VDD pin, checked for continuity between pins and the PK3 and checked for shorts between adjacent pins. I have programmed other PICs using this PK3 so I know the programmer is working.Emil

author: Unknown
author_rank: Unknown
timestamp: January 14, 2015, 11:31:12 am
content: Have you double checked the polarity of the ICSP connectorhttps://www.olimex.com/Products/PIC/_resources/PIC-ICSP-2.jpg?If you have programmed other microchip pic families (dspic, pic16, etc) you have to update the firmware on the pickit, follow chapter 3 on this dochttps://www.olimex.com/Products/PIC/Programmers/PIC-KIT3/resources/PIC-KIT3.pdf.

author: Emil
author_rank: Regular Contributor
timestamp: January 14, 2015, 11:46:10 am
content: Quote from: exapod on January 14, 2015, 11:31:12 amI have checked the polarity. One of the first things I did when I got the programmer was to print the pinout and tape it to the programmer, then marke the MCLR pin on the cable.I have programmed pic16's and NOT updated the firmware. I will try that tonight. Thank you.

author: dannyf
author_rank: Super Contributor
timestamp: January 14, 2015, 11:52:26 am
content: QuoteDouble check your connection.QuoteYou should check Microchip - I would be surprised if it is not supported. One of the issues of PICKIT3 is the need to re-download OS -> that may be your problem.

author: macboy
author_rank: Super Contributor
timestamp: January 14, 2015, 02:43:30 pm
content: First, select device family, PIC18FxxK,thenattempt to talk to it.If you have the wrong (or no) device family selected, the pickit 3 can't identify some chips.

author: 22swg
author_rank: Frequent Contributor
timestamp: January 14, 2015, 08:20:20 pm
content: On PIC24's VUSB3v3 has to be connected to 3.3v if not being used for usb. ?

author: hli
author_rank: Frequent Contributor
timestamp: January 14, 2015, 09:19:53 pm
content: Follow the basic connections in section 2.1 of the data sheet. Especially connect a capacitor to Vusb. Also, since the device has multiple Vdd pins, connect them all (and decouple each of them).Edit: OK, the 24K50 only has one Vdd pin (I looked at the 44K50 that has two). But Vusb still needs to be decoupled properly.

author: Howardlong
author_rank: Super Contributor
timestamp: January 14, 2015, 09:43:23 pm
content: As others have said, check your ICSP connections. Then check again. And again. Seriously. I have spent far too many hours fannying around with this interface only to find it's a schoolboy error.Are you powering this from the PicKit3-a-like or is it self powered?If pwoered from the PK3, check the current demands of the rest of the circuit are minimal.PICs are not alone, debug interfaces are the perennial weak link of flakiness in embedded debugging and programming. Once you've got it figured out it should be reliable though.In the meantime can you tell us what OS you're running, and what MPLAB you're using? There were some versions of MPLAB X that were just awful at detecting PK3s, I wasted a frw days of my life on that too. Screen prints of your error and environment will help.

author: Emil
author_rank: Regular Contributor
timestamp: January 15, 2015, 08:44:40 am
content: Quote from: 22swg on January 14, 2015, 08:20:20 pmIt should be connected to VDD for LF devices, but for F devices it should just be decoupled. I missed that part and have not decoupled it. I Will try adding a cap between Vusb and Gnd.From the datasheet:"When the regulator is enabled (F devices), a low-ESR(< 5?) capacitor is required on the VUSB3V3 pin tostabilize the voltage regulator output voltage. TheVUSB3V3 pin must not be connected to VDD and isrecommended to use a ceramic capacitor of between0.22 to 0.47 ?F connected to ground."

author: Emil
author_rank: Regular Contributor
timestamp: January 15, 2015, 11:18:30 am
content: Quote from: Howardlong on January 14, 2015, 09:43:23 pmI have made two different PCB's with this PIC and checked the connections from both boards to the programmer multiple times. But I'll check again to be sure.QuoteI have tried both.QuoteI have not populated the whole board yet, just what's needed to get the mcu running, so no current demand from the rest of the circuit.QuoteI have used this programmer for maybe two years now and I have also found it to be reliable. No problems in the past that wasn't quickly resolved as soon as I figured out what I was doing wrong.QuoteRunning Windows 7 64bit. I normally use the standalone programming software, I only downloaded MPLAB when I started to suspect the standalone software didn't support the device.I'm using MPLAB X, either 2.05 or 2.30, I will check whan I'm back on my computer tonight. I'll get some screenshorts too.To clarify: the PK3 is detected, but not the PIC.

author: Emil
author_rank: Regular Contributor
timestamp: January 15, 2015, 07:40:42 pm
content: I have added a 330nF cap between Vusb3v3 and gnd (soldered directly to the Vusb3v3 pin). No change.I have measured continuity between all the pins on the PK3 and the corresponding pins on the PIC. I have also checked that none are shortet together. I have verified 10K resistance from MCLR to VCC.It appares I was mistaken thinking that PK3 standalone program does not support the 18F24k50, as I was able to select it manually.Edit: Also tested with a 16f1455 to verify that the PK3 is working.IPE version 2.26MPLAB X IDE version version 2.26PICkit 3 standalone programmer version 3.10.00, device file version 1.63.148

author: Unknown
author_rank: Unknown
timestamp: January 16, 2015, 02:39:08 pm
content: Have you tried to update the firmware on the pickit3 for the family you are using?Please setup a project in mplab x IDE.

author: Emil
author_rank: Regular Contributor
timestamp: January 16, 2015, 02:47:00 pm
content: Quote from: exapod on January 16, 2015, 02:39:08 pmI have uploaded the firmware that came with the PICkit3 software to the PK3. (Not at home at the moment, so I can't check the version number.) Do you know where I can download the most recent version? I have searched but not found any.I'll try making a project in Mplab X.

author: 22swg
author_rank: Frequent Contributor
timestamp: January 16, 2015, 03:27:03 pm
content: PK3 has to change its FW / AP if you change the PIC device. MPLABX - PK3 would normally do this automatically...

author: neslekkim
author_rank: Super Contributor
timestamp: January 16, 2015, 03:33:11 pm
content: I had to use IPE to change the firmware, something with MplabX made it impossible.I also have to run these programs "as administrator" to make things work.. pure crap.But on the ICD3 they have totally different drivermodel, I have no problems with that one. (other than price, but got lucky on the forum here)

author: Howardlong
author_rank: Super Contributor
timestamp: January 16, 2015, 04:08:28 pm
content: If you are on 2.05 MPLAB X, take a look at thishttp://www.microchip.com/forums/m782811-p2.aspxI had the "Connection failed" error and it took a long time to figure it out, it was corrected by the two DLLs mentions in the link.If you don't have the DLLs I can try to find them for you, I have since upgraded to 2.30.Like so many new Microchip things in recent years, they release shit that takes months if not years to finally get to production strength (MPLAB X, Harmony framework, PIC32MZ, their "new" forum software).

author: Emil
author_rank: Regular Contributor
timestamp: January 16, 2015, 04:35:41 pm
content: Quote from: Howardlong on January 16, 2015, 04:08:28 pmI'm using MPLAB X 2.26. Do I still need the DLLs?I tried making a project in MPLAB and program the chip. Got these errors:"The programmer could not be started: Could not connect to tool hardware: PICkit3PlatformTool, com.microchip.mplab.mdbcore.PICKit3Tool.PICkit3DbgToolManager""Connection Failed."I tried running MPLAB as Administrator, no change.

author: 22swg
author_rank: Frequent Contributor
timestamp: January 16, 2015, 08:17:46 pm
content: As this is a clone what programmer is reported in the MPLABX project properties ?

author: Emil
author_rank: Regular Contributor
timestamp: January 16, 2015, 08:59:33 pm
content: Quote from: 22swg on January 16, 2015, 08:17:46 pmPICkit3

author: 22swg
author_rank: Frequent Contributor
timestamp: January 16, 2015, 09:22:35 pm
content: Device ? PIC18f14k50

author: Emil
author_rank: Regular Contributor
timestamp: January 16, 2015, 09:28:17 pm
content: Quote from: 22swg on January 16, 2015, 09:22:35 pmCorrected it now. Still same error.

author: 22swg
author_rank: Frequent Contributor
timestamp: January 16, 2015, 09:46:19 pm
content: If it gets the serial number MPLABX can 'see' programmer but cannot 'start' it... will PICKit3 program another different PIC project ?

author: Emil
author_rank: Regular Contributor
timestamp: January 16, 2015, 09:54:38 pm
content: Quote from: 22swg on January 16, 2015, 09:46:19 pmIt will program other PICs using the standalone PICkit3 software.Using the MPLAB X IDE I get the same errors.

author: 22swg
author_rank: Frequent Contributor
timestamp: January 16, 2015, 10:10:08 pm
content: Have you gone through all the PK3 Project properties, "Power " - " Use latest Firmware" you could try "specific firmware" option...EditAlso On the dashboard side bar ( green arrows) refresh Debug tool status , it will / should show FW and also download info...

author: Emil
author_rank: Regular Contributor
timestamp: January 16, 2015, 10:27:34 pm
content: Quote from: 22swg on January 16, 2015, 10:10:08 pmI have checked "Power target circuit from PICkit3" and I have also tried unchecking it and power the board.I have tried "Use latest firmware" and also to use a specific firmware ersion, I used the only one I could find, PK3FW_013411.jam

author: 22swg
author_rank: Frequent Contributor
timestamp: January 16, 2015, 10:30:52 pm
content: Dashboard ...Green arrows ?

author: Howardlong
author_rank: Super Contributor
timestamp: January 16, 2015, 11:00:42 pm
content: These were the DLLs that fixed the 2.05 problem, and I also include the DLLs that are current, and working, with 2.30.You need to put one in your Windows\System32 and the other in your Windows\Syswow64: the subdirectory structure within the zip file will make it clear which one is which.Save your old DLLs with an appropriate rename!One further test is that as I remember it, Pickit 3 worked perfectly with the old MPLAB 8.92, it was just the MPLAB X nonsense that didn't.ThebadDLLs were:Code:Directory of C:\Windows\System3214/01/2014 20:18 243,200 USBAccessLink.dllDirectory of C:\Windows\syswow6414/01/2014 20:18 199,680 USBAccessLink.dll

author: Emil
author_rank: Regular Contributor
timestamp: January 17, 2015, 01:39:27 am
content: Quote from: 22swg on January 16, 2015, 10:30:52 pm

author: 22swg
author_rank: Frequent Contributor
timestamp: January 17, 2015, 09:07:21 am
content: Too many green arrowsHave you clicked ' Refresh Debug tool status ' (round arrows) on the dashboard side bar ...

author: Emil
author_rank: Regular Contributor
timestamp: January 17, 2015, 10:02:58 pm
content: Quote from: 22swg on January 17, 2015, 09:07:21 amFound 5Now I understand which one you mentWhen clicking "refresh debug tool status" I get another "Connection Failed" message after a while.

author: Skimask
author_rank: Super Contributor
timestamp: January 17, 2015, 11:02:50 pm
content: Pictures...

author: 22swg
author_rank: Frequent Contributor
timestamp: January 18, 2015, 09:52:25 am
content: So MPLABX can resolve the serial number but not connect for other comms ? is your "PK3" in the win 7 Device manager as 'HID-compliant device' and 'USB input device ' (2 entries)

author: Emil
author_rank: Regular Contributor
timestamp: January 18, 2015, 12:05:02 pm
content: The problem is solvedI found the solution in the last post of this tread:http://www.electro-tech-online.com/threads/pickit-3-windows-7-64-bit-mplab-ide-issues.141424/-I ran MPLAB 8.92 as Administrator. (Probably would have worked in MPLAB X and as normal user too.)-I unplugged the PK3, pressed the button on it and held it while connecting usb again, then released the button.-A dialog poped up asking to update the firmware, which it then did.The PK works in MPLAB now. (Both v8.92 and MPLAB X v2.26).If I try with the standalone programmer software I get this message: "The PICkit 3 is in MPLAB mode. Use the tools menu to download an OS compatible with this application."Thank you to everyone who helped me with this.

author: Howardlong
author_rank: Super Contributor
timestamp: January 18, 2015, 04:34:23 pm
content: Well done! Can't ever remember having to do that on a PK3, but I may be mistaken.