Programming PICs

Thread Starter

KansaiRobot

Joined Jan 15, 2010
324
Hello and thanks for your help

Several years ago I programmed a 18F2550 using a customized programmer that is sold in the local market. You had to take the chip out of its socket and put it in the programmer, upload the HEX file and then put the chip again in the socket.

Now, with the view of doing onchip programming I am planning to use PICKIT3. But I have never used it so I have several questions. (Btw, I am planning on using now the 18F4450 or maybe 18F4553)

1) I used MPLAB IDE to write my programs. Can I still use it or should I use the -I heard- new MPLAB X??

2) How do I connect the PICKIT3 to the microcontroller??

3) As a compiler I vaguely remember I used the C18 Lite. Do I have to use a different one?

Thank you for the help.
 

blueroomelectronics

Joined Jul 22, 2007
1,757
1. I use MPLAB X (works on OS X) and I like it, I've also used MPLAB 8.xx works fine too.
X appears to be best suited for C, 8.xx ASM. Both are available, take your pick :)

2. VPP, VSS, VDD, PGC, PGD to the pins marked the same on your target PIC. You can and should ignore PCM (low voltage).

3. XC8 is the official C from Microchip, free download from them. You only pay if you need the code optimizers.

You could roll your own PICkit2 with that 18F2550, Google my PICkit2 lite or Junebug schematic.
Also for 18F series PICs you can program in BASIC (Swordfish BASIC compiler).
 

Thread Starter

KansaiRobot

Joined Jan 15, 2010
324
Thank you for you reply.
1. I use MPLAB X (works on OS X) and .
You work on OS X? Are you telling me MPLAB X works on macs! WOW. What version is the minimun? I have a rather old snow leopard at home... It would be great if I can use it!
Pardon my ignorance (I am rather nervous cause I have a dealine). Can MPLABX and PICKIT3 have no problem programming the PICs I wrote in my previous post??? 18F and all?

By the way, the user guide of PICKIT3 says

1 MCLR/VPP
2 VDD
3 Ground
4 PDG (ICSPDAT)
5 PGC (ICSPCLK)
6 LVP

So according to your description I guess Ground is Vss, PDG is PGD and LVP is the one you called PCM???

I remember vaguely that the compiler had to be installed separately from the IDE. But dont remember if I did it before or after...

Thank you again
 

ErnieM

Joined Apr 24, 2011
8,377
Working "in circuit" means you never have to remove the PIC from your hardware. That is a very good and efficient way to work.

MPLAB (X or not) both work and play just fine with the PICkit. In fact, if you leave the thing connected you can debug the code on your PC screen while it is running in your hardware. That is a very powerful feature even if you have to buy a bigger PIC to fit the all pins you need (as you loose 2 pins from doing useful work to just programming and debug).

Yes, LVP is PCM. I have never had the need to use the low voltage programming option so I just need the first 5 pins. I use a 6 pin header but just wire the first five (and put a big dot by pin 1 so I know how to connect the PICkit).
 

OBW0549

Joined Mar 2, 2015
3,566
1) I used MPLAB IDE to write my programs. Can I still use it or should I use the -I heard- new MPLAB X??
You can still use it; the PK3 plays very nicely with MPLAB 8.92, under both WinXP and Win7. I also have MPLAB X, on my MacBook (Yosemite 10.10.2). It runs fine, but I'm having a heckuva time getting used to it because I'm simultaneously trying to learn C.

2) How do I connect the PICKIT3 to the microcontroller??
6-pin, 0.1" (2.54mm) header on your target board, with connection to MCLR, VDD, VSS, PGC and PGD on your PIC. The PK3 just plugs directly onto that header.

3) As a compiler I vaguely remember I used the C18 Lite. Do I have to use a different one?
Nope. AFAIK, any compiler that's compatible with MPLAB will work just fine.
 

yasir_66

Joined Jun 25, 2009
71
hello friends,
I want to interface FS1000A Rx Tx module with pic18f4550. I am familiar to make any port low or high & I know all hardware connections. But i want some help in writing code for Transmit & Receive using FS1000A . So, anyone help me please.
 

takao21203

Joined Apr 28, 2012
3,702
I dont see a beneficiary using the old MPLAB as the IDE is constantly evolving.
With MPLABX you can now view variable content in the debugger/simulator simply hover the name.

The compilers are downloaded installed seperately, you can assign one of them in project properties. Remind to turn off oscillator calibration for most PICs or it wont startup.

As well you get code oncfigurator and project templates, and Intellisense for structure members.

You can power the circuit through PICKIT (also set in project properties) and need 5 wires, or self-power only need 4 wires.

The hardware debugging is mostly not required anymore as controllers with larger memory can have their own debugging display, and interfacing the display doesnt need hardware debugging.

Actually you can also use ICSP with the custom programmer, just connect the ICSP and power supply as well MCLR.
 

Thread Starter

KansaiRobot

Joined Jan 15, 2010
324
One question regarding the compiler (I installed MPLABX on a windows machine with the standard compiler XC8)

Is this XC8 a somewhat descendant of the old C18 lite that I used before? I am hoping so because in my previous programs I used that compiler libraries (for say ADC conversion) and made my life easy and now I would like to use the same libraries again hopefully.

Thanks
 

Thread Starter

KansaiRobot

Joined Jan 15, 2010
324
btw I tried installing MPAB X into my mac. It installed without problem
But when installing XC8 I got the following error and couldnt install it

There has been an error.
Error running /Applications/microchip/xc8/v1.34/bin/xclm-hostinfo: dyld: Library not loaded: /usr/lib/libcurk.4.dylib

Referenced from: /Applications/microchip/xc8/v1.34/bin/xclm
Reason: Incompatible library version: xclm requires version 7.0.0 or later but libcurl.4.dylib provides cersion 6.0.0
the application will exit now.

How can I solve this problem?? (puzzled)
 

Thread Starter

KansaiRobot

Joined Jan 15, 2010
324
One question regarding the compiler (I installed MPLABX on a windows machine with the standard compiler XC8)

Is this XC8 a somewhat descendant of the old C18 lite that I used before? I am hoping so because in my previous programs I used that compiler libraries (for say ADC conversion) and made my life easy and now I would like to use the same libraries again hopefully.

Thanks
Well, I ll reply my own question. It seems that XC8 is indeed a descendant of C18 lite. I have tried my old program with ADC libraries and it works without problem.
 
Top