4th December 2007

Tutorial 1 – 18F4550 Development Hardware setup

Tutorial Goal: Introduce and describe development setup

    As mentioned in the Introduction, I am going to be working with the following until further notice:

    • PIC18F4550
    • PicKit 2
    • MPLAB IDE V8.00
    • MPASM V5.14

    Here is a picture of my setup:

    18f4550 protoboard

    Small FAQ:
    Q: Some of the wires are not as straight as they should be. Could you fix them?
    A: No.

    I am using a 5V (1A) DC adapter as a power source. I cut off the end and attached the banana plugs.

    The LED on the top left (with 1KOhm adapter) serves as an ON-light. Also, if anything accidentally shorts, the light turns off. (I will be using 1K resistors for LEDs since they provide an adequate amount of current and because I have many of them. Resistors as low as 270 Ohms may be used safely for regular 20mA LEDs.)

    The PicKit 2 package is an In-Circuit Serial Programmer (ICSP). This means that the PIC can stay on the development board during programming. Unfortunately, the programmer did not come with a connector to the PIC so I had to make one.

    pin header

    Unable to find a 6 pin header, I purchased a longer one and cut off 6 pins. I trimmed the long side of the pins to fit into the PicKit and soldered the wires onto the short side, using a red wire to indicate pin 1. Then, I wrapped the black tie thing shown in the picture around the soldered connections to make sure they don’t touch. It turned out ugly, but functional.

    PicKit2 ICSP connections: 1 - VPP, 2 - VDD, 3 - VSS(GND), 4 - PGD, 5 - PGC, 6 - PGM (or NC)

    I’m not sure where I found the above diagram, but I believe if was some MicroChip PDF.

    Looking at the 18F4550 datasheet, the corresponding pins are:

    • Vpp (1)
    • Vdd (11)
    • Vss (12)
    • PGD (40)
    • PGC (39)

    The 18F4550 supports low-voltage programming (using 5V instead of ~11V). To use LVP, the PGM (38) pin needs to be set high. If LVP is disabled, it functions as an I/O pin. (Side note: An HVP programmer must be used to enable LVP on a new PIC. Also, with LVP enabled, PGM (38) no longer functions as an I/O pin.)

    The 5V/GND connections on the 18F4550 should be made as follows:

    • 5V (11)
    • 5V (32)
    • GND (12)
    • GND (31)

    Notice that there are 2 connections for Vdd (5V) and Vss (GND). All four must be made.

    I believe that the PicKit programmer can power the chip via these pins, however it is better to use your own power source. Connecting both a 5V signal and the PicKit to pin 11 relieves the programmer (and the USB port) or the unnecessary current draw. Either way, the Vdd pin of the programmer does need to be connected to Vdd on the 18F4550.

    I believe this fully describes my setup. Any suggestions or questions about this post can be posted as replies and will (probably) be answered in a timely manner.

    This entry was posted on Tuesday, December 4th, 2007 at 3:26 pm and is filed under 18F4550 Assembly Tutorial. You can follow any responses to this entry through the RSS 2.0 feed. You can leave a response, or trackback from your own site.

    There are currently 29 responses to “Tutorial 1 – 18F4550 Development Hardware setup”

    Why not let us know what you think by adding your own comment! Your opinion is as valid as anyone elses, so come on... let us know what you think.

    1. 1 On February 4th, 2008, zaid said:

      hello, is polarity -ve +ve an issue when working with pic? or we just can plug as long its 5volts??

    2. 2 On February 8th, 2008, Andrey said:

      Yes, polarity is definitely an issue. You must plug the +ve voltage into pins 11 and 32 and 0V into pins 12 and 31. If you reverse the connections, you will likely have a broken chip.

    3. 3 On June 15th, 2008, Brian Letts said:

      Hi, its good to see a site and tutorials dedicated to the 18F. Your tutorials and site are a credit to you. Keep up the good work.

      Brian

    4. 4 On July 19th, 2008, Dr. Amer said:

      That is really nice. However I would love to see, some USB based projects, as 18F4550 has built in USB 2.0 support. That is nice work. Moreover a C or BASIC version would be more user friendly.

    5. 5 On August 5th, 2008, Jeff Greer said:

      Great site! Thank you for the useful information. I hope to see it continue.

      Jeff

    6. 6 On August 14th, 2008, JPM said:

      Are you using stranded or solid wire for your breadboarding? When I started out, with stranded, it got to be rather cumbersome twisting the stranded ends all the time and then dealing with wires that wouldn’t go into the breadboard hole. But then, I came across a spool of solid, multi-conductor telephone wire! Great for breadboarding! Plus there are many different colors.

    7. 7 On October 15th, 2008, minal said:

      Help me to write code in c language with c18 compiler for pic18f4550 demo board.i am new one.

    8. 8 On February 15th, 2009, siddharth said:

      thanks a lot for the connections, it was so useful.

    9. 9 On March 26th, 2009, dingarac said:

      Can anybody give me the PC software for commutation of PC with 18f4550

    10. 10 On April 15th, 2009, sridhar said:

      this is a nice job. it would be helpful if you can give a functional programmer circuit. like ICSP.

    11. 11 On May 10th, 2009, jpp said:

      I have one question… Do you know if this same setup works with the pic16f877a?
      i was looking at the datasheets and they are quiet similar.
      It seems like it could work.. but im a beginner with this stuff and maybe there’s something i dont know.

    12. 12 On February 9th, 2010, PG said:

      You say “I believe that the PicKit programmer can power the chip via these pins” – can anyone confirm/deny this? I already have a PicKit and a looming 4550 project – *surely* just the PicKit is enough?

    13. 13 On May 15th, 2010, kouqiang said:

      A comment to “Notice that there are 2 connections for Vdd (5V) and Vss (GND). All four must be made.” in
      “Tutorial Goal: Introduce and describe development setup” :

      I found that it also works only wired a Vdd(5V) and a Vss(GND),i use my multimeter to test the two Vdd and Vss pin,they are connected in chip, so i think that we can wired just one Vdd and one Vss.

    14. 14 On June 7th, 2010, Martin said:

      I just programmed a 18f4550 and used only the pickit, without external power source, from an usb port of my laptop… I think that is enough.

    15. 15 On July 18th, 2010, onclov2000 said:

      Quick question, how did you get the MPlab to recognize you were programming a 18F4550? I hook my pik kit 2 up and it says that 18F4550 isn’t a chip that can be programmed by this device, (which happens with the 16F913, which I use an external program to mplab), any ideas? Maybe I have a setting wrong?

    16. 16 On August 4th, 2010, Ivan said:

      Yes , you can program the pic with just th power source from the pickit itself. But, from my own experience(in my own developement board), it can’t power the PiC in running mode. Wonder if it *IS* capable of doing that, or it’s just for supplying power when programming.

    17. 17 On November 15th, 2010, skkj said:

      Isn’t LVP mode is enabled by default for new PICs?

    18. 18 On April 2nd, 2011, Wishy said:

      Taken from Microchips PICkitTM 2 Programmer/Debugger User’s Guide
      “To avoid heavy current load errors, it is recommended to keep the target current
      consumption below 25 mA.” Basically the current limit is 100mA but the programmer may take 75mA of this leaving 25mA for the application.

      In other words, if your target application draws more than 25mA (i.e. not much at all) then you need to use an external power supply.

    19. 19 On May 5th, 2011, Andy said:

      Hi, I’m developing a DIY USB gamepad with 8 buttons (i.e. 4 directional, 1 select, 1 start, and 2 action buttons)

      I’d like to know if I would need to write a driver for the host. I’m using Windows 7 Basic.

      Any other information related to the project would be most appreciated.

      Thank you.

    20. 20 On May 6th, 2011, Kamal said:

      Well done ;)

    21. 21 On July 12th, 2011, Mark said:

      Your photos are not showing up. Any chance in re-posting them?

      Cheers

    22. 22 On October 13th, 2011, Fastgeek said:

      Hi. I have powered my pics from Pickit2 for a long time even running with a handful of LED’s! No problem, just don’t try to pull more than 150 mA or so out of the Pickit. It does automatically detect external power when you use that.

    23. 23 On November 16th, 2011, BILAL said:

      HI,
      I AM A BEGINNER IN MCU’s FIELD KINDLY GUIDE ME HOW TO USE PIC18F4550 AS USB INTERFACE DEVICE,
      I WANT TO COMMUNICATE MY PIC WITH MY PC

    24. 24 On December 18th, 2011, Chandan Khanal said:

      Sir, Can you please suggest me for PIC18F4550 programmer schematic. I’m desperately need of this.

    25. 25 On March 8th, 2012, sait said:

      it´s usable for pickit 3

    26. 26 On April 3rd, 2012, Ahmad said:

      I cant see the oscillator in your cct, can it work?

    27. 27 On May 29th, 2012, Joao said:

      Excellent work, this really is so helpful for someone that never work with PIC, tanks
      keep up the excellent work

    28. 28 On January 17th, 2013, Saif said:

      i donot know anything about mplab.i want a code for interfacing of usb with pic18f4550 in ccs pic c compiler. ccs pic c compiler is different from mplab. if you can help plz contact me.

    29. 29 On October 2nd, 2013, Sebastian said:

      Hi! Excellent website you’ve got going here!!!
      I didn’t quite get the HVP and LVP part… I need to use first a HVP programmer if I want to use a LVP programmer??? Could you elaborate a bit more please?

      Thanks!

    Leave a Reply

    • Sponsored Links

      December 2007
      M T W T F S S
          Nov »
       12
      3456789
      10111213141516
      17181920212223
      24252627282930
      31  
    • Donate