16F or 18F and advice on selecting a programmer to use

Discussion in 'Embedded Systems and Microcontrollers' started by Micro9000, Sep 22, 2009.

  1. Micro9000

    Thread Starter New Member

    Sep 22, 2009
    10
    0
    Hello, I am a student interested in using a pic 16F or 18F for a project. However, since I am new to microcontrollers I am having trouble figuring out which microcontroller I should use, and how to program it using my PC. I have a USB to 9pin serial cable, and I would prefer to use this cable to connect to the programmer.

    The project I am looking forward to involves moving a DC motor, which is controlled by pushing buttons that are linked to the microcontroller. I unterstand that I may need a driver chip as well, since the current and voltage outputted by the microcontroller itself is to low.

    I have heard of such programmers as Junebug, Pickit 2, and JDM being thrown around, but I am still unsure of which to choose, and if it can be used with a USB to 9pin serial cable.

    But again, my main questions are as follows:
    ____________________________________________

    -For the given project which microcontoller would you use?

    -What device do I need to connect to my PC in order to program the microcontroller?

    -If possible do you know of any tutorials for this particular microcontroller?

    I thank you in advance for your time.
     
    Last edited: Oct 1, 2009
  2. blueroomelectronics

    AAC Fanatic!

    Jul 22, 2007
    1,758
    98
    My Junebug of course :)

    take a look at the Mongoose schematic for driving small motors. It uses the popular SN754410 quad half bridge IC
     
  3. Micro9000

    Thread Starter New Member

    Sep 22, 2009
    10
    0
    I thank you for your prompt response. I think I am going to with either the PIC 16F877 or 16F628. The 18pin 16F628 has 3.5KB of memory, but the 40 pin 16F877 has 14KB of memory. So, from experience would a program written to control one or two dc motors need at least 3KB of memory or more? And, will the Junebug work with a 40 pin chip? In addition would you kindly point me to a reputable site where I may purchase a Junebug? I am searching around and I am unsure of whether or not I can trust some of these sites. Thank you.
     
  4. amjad2000in

    New Member

    Sep 3, 2009
    14
    0
    Hi,

    The JDM Programmer will not work your USB to serial convertor. Bcuz, it is using power from the serial port itself. And as your are using, the convertor for getting the serial port the JDM will not get sufficient current for its working. I don't knw about Pic kit 2 and the other one. But, if these also drags power from serial port, then not going to work with the USB to serial convertor.
     
  5. rjenkins

    AAC Fanatic!

    Nov 6, 2005
    1,015
    69
    I believe the PicKit 2 is a native USB device?

    It also allows in-circuit programming, debugging, single-step execution etc. from within MPLab, so if that is within your budget it may be a good device to start with.
     
  6. blueroomelectronics

    AAC Fanatic!

    Jul 22, 2007
    1,758
    98
    Any PIC with 2 CCP modules takes only a few lines of code to setup HW PWM motor speed control. The 628A only has one PWM module. I'd recommend the 18F over the 16F for new projects simply because they're so much easier to work with than the older 16F designs.

    And yes the Junebug can program almost all 40pin PICs. Creatron Inc or Robotshop sells the kits worldwide.
     
  7. Micro9000

    Thread Starter New Member

    Sep 22, 2009
    10
    0
    Thanks for the response, I have located the Junebug for about $50 on Creatron Inc site:
    http://creatroninc.com/product.php?ProductID=81

    The only thing I don't see is the 40 pin connector for the pic 16F or 18F on the Junebug. Do I need to make the connections from the junebug to the microcontroller while using it on a breadboard? I just want to be sure that this is the correct unit before making my purchase. In addition, it says it is compatible with USB. Does that mean I can use my serial to usb cable? If not, which cable specificaly do I need to hook this up to my PC? This information would really help me out a lot. I thank you again for your time.
     
    Last edited: Oct 1, 2009
  8. blueroomelectronics

    AAC Fanatic!

    Jul 22, 2007
    1,758
    98
    To program any ICD PIC you only need to connect VDD, GND, VPP, PGC & PGD.

    In the download section of my site there is an Inchworm quick project poster with connections for 40, 18 & 8 pin devices.
     
  9. Tahmid

    Active Member

    Jul 2, 2008
    344
    25
    Hi Micro9000,

    PIC 16F is obsolete. Try to learn PIC 18F and you will get everything you want in those.
    Though I never used any purchased Programmer as I made my own USB Programmer copying PICKIT2, I think, any good USB Programmer like PICKIT2 or Junebug will work fine.
    Thanks.
     
  10. BMorse

    Senior Member

    Sep 26, 2009
    2,675
    234
    Look at http://www.OOPIC.com, This has plenty of built in objects for controlling motors through different types of H-Bridge board available, also includes the oDcMotor object with an example schematic on how to connect it to a motor through the LMD18201T H-Bridge and also gives sample code for controlling speed of motor with PWM and also for controlling braking and direction of travel..... plus more! Even controlling 2 DC Motors with an Atari Style joystick.... Development board is based on the PIC16F877 uc and programming is done via parallel port, they provide free software and instructions on how to make your own programming cable, you can also access all the pics registers once you get familiar with it more.... You can program it in Java, Basic or C....

    Really Great starter development kit for any age newbie, my 11 year old loves it he is using one OOPIC S board right now to hack his rumble robot!!!
     
  11. Ruptor

    Active Member

    Apr 26, 2009
    44
    0
  12. Micro9000

    Thread Starter New Member

    Sep 22, 2009
    10
    0
    Hey guys, it has been a while but I have finally got my junebug and micrcontroller. I decided to go with the 18F4685, since it has 96KB of memory and all the inputs and outputs I may need.

    However, I now need to figure out to set it all up and start programming it. I am planning to use mplab 8 and program it using assembly. But, I do not know how to connect the junebug to the 18F microcontroller.

    Here's a pictures illustrating my setup and dilemma:

    [​IMG]

    In addition, here is a diagram of the 18F4685:
    http://ww1.microchip.com/downloads/en/DeviceDoc/39761b.pdf
    (click on "pin diagrams" to the left within the index)

    So, where specifically do I need to make these connections from the ribbon cable on the junebug to the microcontroller on the bread board? I do not see this on the diagram.

    Currently, my guess would be to take a wire and plug it from the ribbon cable to the VPP, which is pin 1, and then the PGD and PGC to pins 39 and 40. But where is the ground pin?

    If any one could be so kind as to point me in the right direction, that would much appreciated. Thanks in advance.
     
    Last edited: Nov 7, 2009
  13. AlexR

    Well-Known Member

    Jan 16, 2008
    735
    54
    16 bit core chips (i.e. PIC16 series) are most definitely not obsolete and there are new PIC16F models being brought out all the time. They may not be as powerful as the PIC18 series and have a more limited instruction set but they are cheap and are powerful enough for many applications. Also generally they are simpler than the PIC18 so they are a better chip series to use to learn the basics of microcontrollers.
    Once you know and are comfortable with one series it takes a minor learning effort to migrate to another more powerful series of microcontrollers.
     
  14. blueroomelectronics

    AAC Fanatic!

    Jul 22, 2007
    1,758
    98
  15. Micro9000

    Thread Starter New Member

    Sep 22, 2009
    10
    0
    I thank you for the response, but I am still a tad confused. I don't understand where the ground pin is located according to the diagram within the PDF I linked. And, is that diagram accurate? I need a diode and .1F (100mF) cap? That's just for testing purposes correct? For instance, I could just connect the pins directly from the ribbon cable to the microcontroller like so:

    [​IMG]

    Sorry for the amount of questions I'm still a bit new to all of this, and I am still just a little confused as to how to make the necessary connections. Thanks.
     
    Last edited: Nov 8, 2009
  16. blueroomelectronics

    AAC Fanatic!

    Jul 22, 2007
    1,758
    98
    You're almost there, you've got MCLR, PGC & PGD...

    Many of the 40 pin PICs have two power VDD, and two GND (VSS)

    So the VDD (both of them) go to +5 and the VSS (both of them) go to GND
     
  17. Micro9000

    Thread Starter New Member

    Sep 22, 2009
    10
    0
    Oh, so I use both VSS pins for the ground and both of the VDD pins are connected to the +5V. Thank you so much!
     
Loading...