Problems with Swordfish. PICkit2 and a PIC18K4550

Coding and general discussion relating to the compiler

Moderators: David Barker, Jerry Messina

MattH
Registered User
Registered User
Posts: 51
Joined: Mon Jan 01, 2007 8:03 pm
Location: Allentown, PA

Re: Problems with Swordfish. PICkit2 and a PIC18K4550 (RESOL

Post by MattH » Mon Jul 28, 2014 7:09 pm

I suspect the 10k resistor to pin \MCLR
I'm using 10k on MCLR for years with out any problems. I don't think that's your problem.
Check pin 2,3 for 5V. I always use external power. I don't trust USB power for programming.

Aresby
Posts: 64
Joined: Fri Mar 16, 2012 8:35 am
Location: Milton Keynes, UK
Contact:

Re: Problems with Swordfish. PICkit2 and a PIC18K4550

Post by Aresby » Mon Jul 28, 2014 7:28 pm

Well, you're right.

I still don't know what the problem is but it's not the 10k (now 33k) pull up on MCLR.

Apart from the PSU components (so that 5v and 3.3v are supported) there's only handful of components:

0.1uF decouplers on both sides of the chip VDD/VSS

0.47uf on pin 18, Vusb / RC3?

Resonator where it should be (no caps, included in resonator and we know the chip runs fine when burnt directly)

However, I've just noticed the reset switch connected to MCLR does nothing when pressed - the LED keeps blinking on and off. Surely it should freeze / go off and then restart?

There is something going on with this board that I must figure out but not now, as time has caught up with me. It could be something as simple as a poor joint / solder bridge :(

This is the board (from the well known auction site) http://www.ebay.co.uk/itm/321294837918?var=510214454772 although he shows the older board with just the 5v power supply option.
Aresby
Swordfish & PIC Newbie

SHughes_Fusion
Posts: 219
Joined: Wed Sep 11, 2013 1:27 pm
Location: Chesterfield

Re: Problems with Swordfish. PICkit2 and a PIC18K4550

Post by SHughes_Fusion » Thu Jul 31, 2014 4:03 pm

I remember seeing something similar myself but I can't remember for sure what the cause was.

However, really daft point but have you checked the PIC is the right way round on the demo board? I had one board where I'd fitted the PIC upside down and that may be the one I'd seen this problem on.

It isn't clear from your posts but have you used the PICKit 2 programming software independently but I'd suggest seeing if it can auto-detect the device on the board. I'm wondering if telling the PICKit which device it is to write on the command line maybe by-passes some of the checks it otherwise makes.

The only other suggestion would be to try resoldering the relevant pins, it could be a poor connection, and to use a multimeter to check shorts and continuity of the programming lines.

Aresby
Posts: 64
Joined: Fri Mar 16, 2012 8:35 am
Location: Milton Keynes, UK
Contact:

Re: Problems with Swordfish. PICkit2 and a PIC18K4550

Post by Aresby » Thu Jul 31, 2014 6:03 pm

All good points.

However, once the chip has been successfully written to (on the breadboard) it runs quite happily on the demo board. So that means the chip is right way round and enough (good) connections are made to allow it to run (Xtal, decoupling caps etc). I will, however, check that all pins are properly soldered etc.

PICkit2 will not auto-detect this chip (it reports that chips of the 18F family are not auto-detected) so I just select it from the drop-down list.

As I said though, the reset switch on the demo board does nothing (I seem to recall it should freeze / stop the program running whilst pressed and it would start again on release).

When I attempt to read the chip whilst on the demo board (using the PICkit2) I get all zeroes and PICkit2 reports Code and Data protection have been applied - patently not the case. So it is finding something amiss with the demo board.

I'm away for a few days now but I will certainly be sorting this out when I get back as it's not rocket science!

I'm just very happy I have proven the chip can be written to via the PICkit2 and that it at least then runs on the demo board.
Aresby
Swordfish & PIC Newbie

SHughes_Fusion
Posts: 219
Joined: Wed Sep 11, 2013 1:27 pm
Location: Chesterfield

Re: Problems with Swordfish. PICkit2 and a PIC18K4550

Post by SHughes_Fusion » Fri Aug 01, 2014 8:09 am

That's odd. The PIC18F series have device IDs so should be autodetectable. Are you on the latest operating system for your PK2? The manual doesn't say anything about needing to select the device in this family, only the PIC12F series as they don't have device IDs.

I did find a problem a while back where I was struggling to program a 18F24K22 until I realised I wasn't on the latest software on my PK2 - I'd previously been programming it with the PK3 I have at work.

The latest version I can find is 1.62 - unfortunately Microchip seem to be trying to erase the PICKit2 from their website so the only link I can find easily is from
http://tutorial.cytron.com.my/2012/08/2 ... t-new-pic/
They link to the file here:
http://ww1.microchip.com/downloads/en/D ... -62-14.zip

(Interesting that I missed this one as it adds support for some PICs I'd been avoiding on my 'home' projects as they weren't programmable on the PK2)

Also check if you are running the 2.61 version of the programmer software - there is a link on here if not:
http://www.microchip.com/forums/tm.aspx ... 45&mpage=1

Aresby
Posts: 64
Joined: Fri Mar 16, 2012 8:35 am
Location: Milton Keynes, UK
Contact:

Re: Problems with Swordfish. PICkit2 and a PIC18K4550

Post by Aresby » Thu Aug 14, 2014 4:14 pm

I've installed the latest software / firmware as per the previous post, but it has, if anything, made matters worse!

PICkit2 now reports "No device found" whereas previously it at least thought it had detected a PIC chip.

Time is against me now so I shall dip into and out of this project as time permits.

In the meantime if anyone has any further ideas do drop them here :wink:
Aresby
Swordfish & PIC Newbie

bitfogav
Registered User
Registered User
Posts: 169
Joined: Sat Oct 09, 2010 1:39 pm
Location: United Kingdom

Re: Problems with Swordfish. PICkit2 and a PIC18K4550

Post by bitfogav » Thu Aug 14, 2014 5:39 pm

Have you tried to completely remove the resistor R2 on the RKPK40 Prototype board and see if the pic will programme with the pickit2?..

I use a diode and resistor on my MCLR pin, I have always found that the pickit2 don't like the MCLR voltage going back into the main power line when programming..

Jon Chandler
Registered User
Registered User
Posts: 185
Joined: Mon Mar 10, 2008 8:20 am
Location: Seattle, WA USA
Contact:

Re: Problems with Swordfish. PICkit2 and a PIC18K4550

Post by Jon Chandler » Fri Aug 15, 2014 2:25 pm

I don't know if this will help....

I've found when the PICkit is acting strange, the best this to do is disconnect it from the PC, close the GUI, and start over. This is especially necessary if power has been shorted and the PICkit has shut down, but usually cures any other weirdness too.
Jon

Check out the TAP-28 PIC Application board at http://www.clever4hire.com/throwawaypic/

Aresby
Posts: 64
Joined: Fri Mar 16, 2012 8:35 am
Location: Milton Keynes, UK
Contact:

Re: Problems with Swordfish. PICkit2 and a PIC18K4550

Post by Aresby » Tue Jul 21, 2015 6:49 pm

I thought I'd answer my own question as I finally found the answer.

The demo/development board is a RKPK40 Prototype PCB for PIC18F4550 etc for use with PicKit Self Build Kit which you can get in several places including eBay for just under a tenner, postage included and a free PIC18F4550 thrown in for good measure.

The problem is that PICkit2 does not connect the way you would expect it to, that is, face up so you can see the LEDs and arrow pin etc. No, it has to lie face down, which is quite frankly ridiculous - but a short 6-pin to 6-pin cable allowed me to place it face up again.

So now it works just fine. It was previously being connected backwards with Pin 6 going to Pin 1 and so on. I'm surprised the PicKit2 survived and that it powered the board giving the impression everything was OK!

Just in case anyone else ever uses this board (which is very good BTW, this issue notwithstanding). Only took a year to solve!
Aresby
Swordfish & PIC Newbie

bitfogav
Registered User
Registered User
Posts: 169
Joined: Sat Oct 09, 2010 1:39 pm
Location: United Kingdom

Re: Problems with Swordfish. PICkit2 and a PIC18K4550

Post by bitfogav » Tue Jul 21, 2015 9:28 pm

Nice you found you're issue in the end :)
I actually did buy one of these boards awhile ago and also couldn't programme the board via the pickit2,
The issue I had was with the MCLR line and R2.

I removed resistor R2 and used a diode and resistor in series and connected back up to resistor R2 terminals.

Post Reply