Programming PICs

Discussion in 'The Projects Forum' started by KansaiRobot, Apr 9, 2015.

  1. KansaiRobot

    Thread Starter Active Member

    Jan 15, 2010
    318
    5
    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.
     
  2. blueroomelectronics

    AAC Fanatic!

    Jul 22, 2007
    1,758
    98
    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).
     
    KansaiRobot likes this.
  3. KansaiRobot

    Thread Starter Active Member

    Jan 15, 2010
    318
    5
    Thank you for you reply.
    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
     
  4. ErnieM

    AAC Fanatic!

    Apr 24, 2011
    7,388
    1,605
    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).
     
  5. OBW0549

    Well-Known Member

    Mar 2, 2015
    1,308
    885
    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.

    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.

    Nope. AFAIK, any compiler that's compatible with MPLAB will work just fine.
     
  6. blueroomelectronics

    AAC Fanatic!

    Jul 22, 2007
    1,758
    98
    Lol, I got my mnemonics mixed up, yes it's PDG (data) & PGC (clock). MPLAB needs Java but should work with SL.
     
  7. yasir_66

    Active Member

    Jun 25, 2009
    71
    1
    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.
     
  8. MaxHeadRoom

    Expert

    Jul 18, 2013
    10,545
    2,370
    Thread hijack, you need to start your own.
    Max.
     
    KansaiRobot likes this.
  9. takao21203

    Distinguished Member

    Apr 28, 2012
    3,577
    463
    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.
     
  10. KansaiRobot

    Thread Starter Active Member

    Jan 15, 2010
    318
    5
    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
     
  11. KansaiRobot

    Thread Starter Active Member

    Jan 15, 2010
    318
    5
    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)
     
  12. takao21203

    Distinguished Member

    Apr 28, 2012
    3,577
    463
    then ur OS is 2 old. maybe you can install v7 of the library?
     
  13. KansaiRobot

    Thread Starter Active Member

    Jan 15, 2010
    318
    5
    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.
     
  14. KansaiRobot

    Thread Starter Active Member

    Jan 15, 2010
    318
    5
    It seems the only thing remaining in this thread is the problem with the libcurl version. What does this library do?
     
Loading...