Home
JAQForum Ver 24.01
Log In or Join  
Active Topics
Local Time 02:43 27 Nov 2024 Privacy Policy
Jump to

Notice. New forum software under development. It's going to miss a few functions and look a bit ugly for a while, but I'm working on it full time now as the old forum was too unstable. Couple days, all good. If you notice any issues, please contact me.

Forum Index : Microcontroller and PC projects : PICkit3 making it work

Author Message
MOBI
Guru

Joined: 02/12/2012
Location: Australia
Posts: 819
Posted: 01:41pm 01 Feb 2013
Copy link to clipboard 
Print this post

Hi,

I tried my PICkit3 on my PIC32 breakout board with all the correct power supplies and decoupling caps etc fitted - checked and measured and triple checked..

I flashed up (as in switched on) my PICkit3, activated the MPLAB IPE, selected the 795 pic, selected the programmer, loaded the MM hex file - so far everything looks ok. I clicked on "connect" and it went through the motions (couldn't have be pleasant ) then came up with "connection fail"

OK, maybe something wrong on my home made board. So..I hooked up to the ICSP socket on the CGMaxi and tried the same thing - still says "connection fail"

Has anyone had any success with these PICkit3 thingys?

Frustrated. (the help file didn't help)
David M.
 
Talbit
Senior Member

Joined: 07/06/2011
Location: Australia
Posts: 210
Posted: 01:48pm 01 Feb 2013
Copy link to clipboard 
Print this post

Just off the top of my head...
You've got to IMPORT the hex file
I had the same trouble.
Somewhere on Geoff's site there is a more detailed explanation.
In the meantime I'll did out my "Idiots guide to programming a PIC" and email it to you direct.
Trevor
Talbit
 
Talbit
Senior Member

Joined: 07/06/2011
Location: Australia
Posts: 210
Posted: 02:01pm 01 Feb 2013
Copy link to clipboard 
Print this post

Try this...
I take no resposibilty if it doesn't work for you. I wrote it for me.
Good luck
Trevor
Sorry I can't convert to a pdf so I'll have to just list it here.
Idiots method for programming a PIC
This method uses MPLAB 8, IC-Prog and the Silicon Chip Sept. 2003 “Portable PIC Programmer”
It assumes you have a .asm file.
1. Open MPLAB
2. Project->New or Open
3. Choose location of the new Project and name your new Project.
4. If the Files box is not displayed View->Project View->Output
5. Project->Add Files to Project
6. Find and choose the .asm file
7. Project->Add Files to Project
8. In Files of Type: choose Linker Scripts (*.lkr)
9. In Microchip, in MPASM Suite/LKR, in Program Files,
find the PIC type.lkr. i.e. 16f628a.lkr
10. Load in the .lkr file
11. You should have this showing the .asm file and the .lkr file



12. In the Files box, double click on the two files (.asm & .lkr) to be sure there is something there then close those windows.
13. Configure->Select Device - Choose the PIC from the list
14. Project->Build All
15. If all is well you should get Build Succeeded in the bottom of the Output window
16. The .hex file will be in your project directory. Check that it’s there before proceeding.
17. Close MPLAB
18. Connect the PIC programmer.
19. Open IC-PROG, and select the correct device from the pull down list.
20. File->Open File
21. Select the .hex file Open
22. The hex listing should appear in the window.
23. Program All to program the PIC !



Maximite
This is the way to program a raw PIC in the Maximite using a PICKit3 –Not to be confused with uploading a new MMBASIC from Geoff Graham.

Detailed programming sequence:
1. Start MPLAB.
2. Make sure no other project/workspace is open by selecting File -> Close Workspace from the toolbar.
3. Select the target device by selecting Configure -> Select Device. Select the Maximite PIC
4. Open the Configuration Bits dialog by selecting Configure -> Configuration Bits from the toolbar. Make sure the checkbox labeled 'Configuration bits set in code' is SET.
5. Select the Programmer - PICKit3 - and enable it.
6. Connect the Maximite to the PICKit3. See Maximite project.
7. Import the HEX file by selecting File -> Import
8. Importing the .hex BEFORE selecting the programmer or target
device will cause the HEX file to be cleared from memory, so it is
important to do it in the order shown here.
9. Program the device. Programmer -> Program




Other PICs can be programmed in circuit.
______
From the PIC data sheet find MCLR, Vdd, Vss, PGD & PGC pins and make up a breadboard to connect to the PICKit3. Pull MCLR bar high to Vdd with a 10K resistor. Add a 0.1uF cap from Vdd to ground.
See schematic “dsPIC33FJ64GP802-I/SP_PICKit3.schdoc”
Refer also to Mauro Grassi’s PICKit3 explanation in Silicon Chip July 2010 “Programming PICs: How It’s Done”


Use MPLAB…
1. Connect PICKit 3 to PC
2. Open MPLAB
3. Configure-> Select Device – Choose the PIC from the list.
4. Programmer-> PICKit3
5. Connect target PIC breadboard to PICKit3
6. Programmer-> Settings Choose Power Tab
7. Power Target Circuit from PICKit3
8. File-> Import – All Load Files
9. Navigate to where the .hex file is and Open
10. View-> Program Memory to view it.
11. Programmer -> Program
12. Wait for verification.

Not tried yet
22/10/2012 TD


Talbit
 
bigmik

Guru

Joined: 20/06/2011
Location: Australia
Posts: 2914
Posted: 02:47pm 01 Feb 2013
Copy link to clipboard 
Print this post

Hi David,

Did you try to power the Pic32 using the PicKit3 (it wont work) or did you also power the pic?

On the Maximite I use a USB cable for the MM (to supply power) and a USB cable for the PicKit3 to drive the pk3

Regards,

Mick

PS. also as Talbit said... dont LOAD the firmware you need to IMPORT it, but I realise that you cant detect the target device yet..

Also have you selected the correct 795 device (795L in CGCMM) and possibly you need to select 695L for the CGCMM.

Regards,

Mick
Mick's uMite Stuff can be found >>> HERE (Kindly hosted by Dontronics) <<<
 
MOBI
Guru

Joined: 02/12/2012
Location: Australia
Posts: 819
Posted: 04:10pm 01 Feb 2013
Copy link to clipboard 
Print this post

Thanks all to the advice. Still having difficulties but still working through it.

I was powering the CG via DC plug input. Perhaps I try the USB.

I am also using MPLAB X IDE and/or MPLAB X IPE. The MPLAB system seems unable to connect to the PICkit3 even though it knows it is there (comes up in the IPE tools list).

Getting frustrated, but keeping on trying.

Have to go mow the lawn (about 2 acres), so will be a while getting back to the coal face.


David M.
 
MOBI
Guru

Joined: 02/12/2012
Location: Australia
Posts: 819
Posted: 04:23pm 01 Feb 2013
Copy link to clipboard 
Print this post

I had one last try before heading off. Plugged the MM in with the USB and selected VUSB. Everything connected ok (I am using MPLAB IPE as I have latest MPLAB X and it doesn't marry up with suggestions)

Anyway, when I press "connect" it does, so rather than try and programme the MM, I selected "Read" and it did just that.

What is the difference between powering using USB and DC in? Seems to me they should both work??

Back to work.

David M.
 
donmck

Guru

Joined: 09/06/2011
Location: Australia
Posts: 1313
Posted: 06:10pm 01 Feb 2013
Copy link to clipboard 
Print this post


Have a read through:
http://www.dontronics-shop.com/pic-kit3-low-cost-programmer- debugger.html

There may be some useful info there, that I added in the last 2 days.

Don...
https://www.dontronics.com
 
MOBI
Guru

Joined: 02/12/2012
Location: Australia
Posts: 819
Posted: 07:19pm 01 Feb 2013
Copy link to clipboard 
Print this post

Thanks Don; handy info.

My system seems to be spasmodic. Sometimes the MPLAB IPE connects to the target PIC and sometimes not, and that is with the same configuration each time. If I keep trying to connect, it will keep on displaying "failed to connect", but...if I remove the 4 way USB hub from the PC, wait and then reapply, then when I select "connect" it generally does...however...sometimes it says "failed to download programme executive" and fails to connect.

I hope the pic-kit3 is not so finniky..

Anyway, it did connect and find the device id etc and was happy,so...I decided to take a big plunge and try and reflash the CGMM. With heart in mouth, I clicked the "erase" button and sure enough it did. So...I loaded in the MMBasic with the bootloader and reflashed the MM. It did and it verified. The trouble is that now my MM doesn't boot up.

What have I done!!!
David M.
 
MOBI
Guru

Joined: 02/12/2012
Location: Australia
Posts: 819
Posted: 07:28pm 01 Feb 2013
Copy link to clipboard 
Print this post

No Panic....

I remembered in all the info provided that one has to "import" the hex file from the tool bar and not "load" from the main screen.

Anyway, the long and the short of it is, I have it working again but now I have to re load the MMBasic latest version - no problems there..

I hope someone else benefits from my almost need for a defibrillator!!!

Phewwww!
David M.
 
paceman
Guru

Joined: 07/10/2011
Location: Australia
Posts: 1329
Posted: 01:22am 02 Feb 2013
Copy link to clipboard 
Print this post

Geez David - I've got a de-fibrillator - had it for years but now I don't know if I should attempt all this.

 
elproducts

Senior Member

Joined: 19/06/2011
Location: United States
Posts: 282
Posted: 10:54am 02 Feb 2013
Copy link to clipboard 
Print this post

  MOBI said  
I flashed up (as in switched on) my PICkit3, activated the MPLAB IPE, selected the 795 pic, selected the programmer, loaded the MM hex file - so far everything looks ok.


MPLABX IPE (stand alone programmer application) is still in Beta I believe.
Use the MPLABX IDE.
That's released and works well for me.
www.elproducts.com
 
Print this page


To reply to this topic, you need to log in.

© JAQ Software 2024