Beginning Microcontroller Programmer

Discussion in 'General Electronics Chat' started by LutherBaker, Sep 30, 2012.

  1. LutherBaker

    Thread Starter New Member

    Sep 24, 2012
    13
    0
    A quick question, I'm starting to read through some microcontroller tutorials and I think I'd like to get a PICKit 3 from Microchip ... but I don't know what else I need.

    For instance, how does the chip I am using actually attach to the PICKit 3? I think I need some type of demo board - but I'm having a hard time seeing all of this clearly defined and laid out.

    Can someone point me in the right direction?

    Thanks,
    -Luther
     
  2. ajm113

    Member

    Feb 19, 2011
    176
    5
    The programming pins will be documented in the MCU's doc and pin outputs on the KIT should be documented in the documentation/manual of the PIC Kit3's and should give a example.

    [​IMG]
    Source: http://allaboutee.com/2011/01/22/how-to-program-a-pic-chip/

    A breadboard will work just fine if it's through hole if you want to save some money using a few LEDs, switches, resistors, etc. Otherwise I would recommend getting a development board to learn if money is not a object. I dont recommend using it as a programmer for actual development if you plan on taking the chip in and out. Trust me this was a big newbie mistake. YOU WILL WARE OUT THE PINS IF YOU DO THIS.

    EDIT: Btw I dont own a PICKit 3, I use a 3rd party company's programmer to do the work. Not recommending you shouldn't use PICKit 3, but this was the only thing available to me at the time and it works well for me.
     
    Last edited: Sep 30, 2012
  3. ErnieM

    AAC Fanatic!

    Apr 24, 2011
    7,392
    1,606
    Last edited: Oct 2, 2012
  4. MrChips

    Moderator

    Oct 2, 2009
    12,447
    3,363
    Get the PICkit3 Debug Express. It comes complete with a prototyping board and everything you need to get started. There is nothing else to buy.
     
  5. LutherBaker

    Thread Starter New Member

    Sep 24, 2012
    13
    0
    Appreciate the feedback. Let me restate a few things to see if I understand the rationale:

    @ajm113 is saying: I "can" use breadboard ... and it would be simple way to get up and running, flashing LEDs, etc. but it wouldn't be quite as "immediately" full featured and capable as a dedicated development board. But on that same token, a dedicated development board will not likely be as flexible as a breadboard -- which could hold multiple microcontrollers which I could wire in as necessary - so that, for real development (once I learn what I'm doing), my own breadboard might serve my purpose better if the circuit I am building is all kinda crazy.

    @ErnieM is saying "read this" :) (great thread by the way) The obvious point being to start with the 18s and 24s which applies somewhat to my original list of microcontrollers. My only question would be, can I still follow along with the 2 new books I just bought? Predko and Morton? They seem to be a bit dated. For what it is worth, I'm a software developer by trade but with zilcho electronic or assembler skills - which is part of the reason I'm starting this. I want to learn and work with Assembly in a "simpler" environment than current iterations of Windows or Mac provide. I will keep reading that thread, it is long.

    @MrChips is saying keep it simple. I saw the Debug Express while I was shopping around ... my concern was that the board didn't seem to have a PIC looking receiving socket so I wondered if there was a PIC hardwired/soldered in onboard. Maybe that is really no big deal, at least, not as it relates to learning. But the naive question I asked myself: how can I smoothly follow along in these books: (Myke Predko's "123 Microcontroller Experiments" and John Morton's "The PIC Controller") if the microcontroller is different.

    Some final summarizing questions ....

    Is this true: the PICKit 3 Debug Express includes a development board ... and the microchip on that board is hardwired/soldered in. Meaning, I can't swap out or work on different chips?

    If so, is it safe to assume that it sort of ... doesn't matter which chip you learn on, and that, for learning, it might just be easier to stick to one very capable chip -- of which ... I assume the PICKit 3 Debug Express has?

    If both of the above statements are true, how do I make use of the 2 books I just bought? Are differences going to be "close" enough? I think Predko's book assumes you are using the PICKit 1 ... complete with LEDs and all.

    All that said, how does something like the Olimex MCP-USB fit in. Is it a PICKit 3 AND development board in one? If so, is the development board well-received and sufficient to learn on? It looks like you can swap microchips in and out ... but per @ajm113, is that just not realistically going to work?

    And finally, would there be any advantage to getting the PIC18 Development Kit over the Debug Express? Both include the PICKit 3.The PIC18 Development Kit seems to include two microcontrollers and suggests that it supports dozens of other ones - I guess they pop in and out? Would any of the PIC16 chips used in the books I have fit anywhere on these boards?

    Sorry for the barrage and possible repetition of questions. I'm still sorting this out.

    Thanks
     
  6. MrChips

    Moderator

    Oct 2, 2009
    12,447
    3,363
    Once you learn the ropes on how to connect, program and download to a PIC using PICkit2 or PICkit3, you can connect to a vast majority of PIC chips. There are only 5 or 6 wires to connect:

    [​IMG]


    Get cracking quickly with the Debug Express and then you can roll your own as you wish.
     
    LutherBaker likes this.
  7. LutherBaker

    Thread Starter New Member

    Sep 24, 2012
    13
    0
    Ok, I know I am beating this to death - so not trying to test anyone's patience ... but seriously, last question :)

    I found the Debug Express Kit - but I see a few other Microchip kits as well and wondered which setups would be a decent way to start.

    • Debug Express Kit (DV164131)
    • Starter Kit (DV164130)
    • PC18 Development Kit (DV164136)
    • Evaluation Kit (DV164132)

    Do I understand the main difference to be that the Debug Express Kit has the chip soldered in and can't really be replaced?

    Is the "Starter Kit" a bit more flexible -- would it allow me develop against other chips like the PIC16F54 or PIC16F648?

    Is the advantage to the Debug Express Kit then, that it has a newer chip - that cannot physically fit in the Starter Kit board?

    Best of both worlds ... would it be wise to get the Debug Express AND the low pin count demo board (DM164130-9) ... which is essentially the Starter Kit? ... or vice versa, get the Starter Kit AND part (DM164130-4) which seems to essentially be the Debug Express demo boards. The stand alone Debug Express board seems to come with 2 blank PCB cards as well ... I'm not sure that is included in the Debug Express Kit?

    What about the PC18 Development Kit (DV164136) ... does that do it all and give me the best board to develop against going forward (after lessons)? ... and or the Evaluation Kit (DV164132) ...

    I "think" that the low pin count demo board would allow me to work through the books (Myke Predko and John Morton) as they generally focus on chips like the PIC16F54 and PIC16F648 ... while the Debug Express board would allow me to move into the 18 series when ready.

    At this level, the money is somewhat nominal so it isn't really a money thing. I'm just looking for a well-rounded beginning kit and trying to avoid another order in a month.

    Thanks.
     
  8. Markd77

    Senior Member

    Sep 7, 2009
    2,803
    594
    They all come with the PICKIT3 so can program the whole range of Microchip microcontollers. The little development boards will only take a small selection, if the chips are even removable.
    I'd recommend just the PICKIT3 on it's own, a solderless breadboard, the PICs from the books and a set of header pins (you can see them on MrChips's photo).
    That's all you need apart from LEDs, resistors, buttons, etc. and it's much more flexible.
     
  9. t06afre

    AAC Fanatic!

    May 11, 2009
    5,939
    1,222
    Start with the PICKIT 3 and the debug express bundle. That should get you started. Then this kit is worn out. You simply move over to using breadboard. Like shown in post #6. I looked at some books by Myke Predko and John Morton. And they looked somewhat outdated to me. Do you plan to use C or assembler for programming?
     
  10. THE_RB

    AAC Fanatic!

    Feb 11, 2008
    5,435
    1,305
    If money is not tight, then I would suggest you get a good full-featured development board like a MikroE EasyPIC7;

    [​IMG]
    http://www.mikroe.com/easypic/

    That includes a built in programmer and will program all PIC16 and PIC18 parts, 3.3v and 5v PICs, costs about $149 for the whole dev board (and you can buy the LCDs for extra $$).

    I was a consultant on the design team for the development of the EasyPIC7 and it really is a great PIC board, their best ever.
     
  11. ErnieM

    AAC Fanatic!

    Apr 24, 2011
    7,392
    1,606
    Just ONE? Heck, I see lots of questions here. <grin>

    But what tried my patients is searching out all those kits. OK, OK, I serched them all out, but since you already did that work LINKS to those products would have helped us help you. <grumble> That's a general gripe I have with everyone's posts: if you'd like us to view some data sheet link to the darn thing. </grumble>

    Debug Express Kit (DV164131) PIC18F45K20 C tutorials, PICkit 3
    Starter Kit (DV164130) PIC16F1829, ASM & C tutorials, PICkit 3
    PC18 Development Kit (DV164136) nice but $$ board,
    Evaluation Kit (DV164132) LCD display

    ANY one you pick will be good place to start. The only bad place to start is skipping the dev board itself: you want a pre-built and pre-tested board to start, least you go insane trying to figure out why "I just want the LED to blink when I push the button, but it does nothing." Skip this step, get a kit with tutorials.

    All the PICs in the PIC10, PIC12, and PIC16 series just use 33 instructions, and are a good place to learn assembly on these parts. PIC18 and up have a much more complex instruction set, and personally I have never spent the time to learn assembly on them: I happily use C for those. Note: C is very good for PICs. Knowing assembler is nice but not essential.

    The PICkit 3 Low Pin Count Demo Board Part Number: DM164130-9 has a socketed DIP chip so yes you can replace it. I have one, have used it as a starting point in some things, and like it.

    I also have the DV164131 board but never soldered onto it. It uses a newer PIC with more room for code, but it's a PIC18.

    Either the DV164130 or DV164131 are great places to start. Once you complete some/all of the tutorials you'll be looking to do more complex things, and since they have breadboard areas you can add things there till you are ready to make your own board. Any PICkit can plug into that so you will have the programmer/debugger in your toolbox to keep going.

    Good tutorials are a great thing.

    The DV164136 and DV164132 strike me as overkill as a starting point, and I am unsure how "basic" their tutorials are. However, if your project intentions cover motor control you may want one. If you are looking there to get a display there are other options: I use alphanumeric displays based on the HD44780 chip that are simple to use, code for them is everywhere.
     
  12. LutherBaker

    Thread Starter New Member

    Sep 24, 2012
    13
    0
    @t06afre
    It seems like I can't go wrong with the PICKit 3 Debug Express - it is inexpensive and should give me several months of work. I had Predko's book from a while back but just purchased Morton's book - is there a really good current book that I should take a look at?

    I do plan on going through several tutorials ... I may even pick up the Gooligum board and work through his tuts - but there are times (while watching the kiddo) that I can easily open up the kindle and just read through some well organized lessons, examples or even a bit of theory ... so would most definitely be interested in a good book. Are the Newnes books well received?

    Regarding the language, I've been writing software for just over 10 years now ... I have a grad degree in CS but my undergrad was in Music ... consequently, I never drudged through the Assembly and Computer Architecture classes most undergrads went through. So, at a fundamental level, I really really want to dig in and get my feet wet with assembler programming. That said, for any real work, I'd definitely weigh the pros and cons ... for something pretty large, c might make things a bit easier but I've always wanted to write direct instructions that were just blazingly simple and fast --- so I really want to work with them in tandem ... with more weight on the low level assembler stuff at first.

    @THE_RB
    I saw the EasyPIC7 board incidentally while browsing around ... I also noticed that they sell an entire suite of tools, compilers, etc. Does that board work really well with the MPLAB and PICKit 3 stuff? It looks awesome ... afraid it would kill any breadboarding/soldering skills I'd like to pick up :) but I was mostly not sure if I'd need to buy into their entire suite of tools - in which case, this might be a better option once I've gotten through some basics and made sure I can find time for the commitment. Awesome suggestion!

    @ErnieM
    So, I totally agree with your sentiments about the missing links and have to say THANKS for actually going through the extra work to look those up and post here. Being a newbie here, if I post anything with links in it, it gets delayed/moderated. I recently asked a question about which Metcal soldering station to get (500 or 5000) and a senior member told me that I didn't need one and that he could do a great job with a $5 iron. I spent 30 minutes tactfully writing a comical reply that suggested that I read "Outliers" and I understand it takes 10,000 to become really good at something --- but my post wasn't asking for advice on how to get good at soldering :) I'm a tool junky and anyone that's used a Metcal loves them ... so I thought I wanted one and just needed to better understand if I needed the extra wattage of the 5000 if most of my work would be circuit boards, etc. (I want to build audio equipment: mixers, compressors, maybe (trying a link here!) a synth with a microcontroller DCO! .... ah, I am dreaming). Anyway, my response to the soldering thing presented a screen saying it required moderation (links to the Outliners book) and it never showed up so I thought I'd keep the links out until I've reached 10 posts or so.

    To your points: I agree that the DV164136 and DV164132 boards look like overkill for my purpose - and you're correct, I actually want to get up and running with the code ... so I want to make sure to get a development board. I like that the DV164131 (PICKit 3 Debug Express) is a little more current so I think you've sold me. Again, thanks for looking up all those numbers. Since I didn't include links, that is exactly why I included them - googling those numbers gives some pretty specific links.

    In the end, I actually contacted Gooligum directly. His development board (another link here!)

    [​IMG]

    looks awesome ... and on his website he actually talks about "why" his tutorials cover the older chips first. He gave me a few suggestions - and his dev board actually comes with the 16F684 which Predko's book covers. In addition, he said that while the PIC16F54 is no longer available, the 16F505 would be a really close replacement and that it would likely be educational to try and make Morton's code and examples work with the newer chip. And fortunately, both chips fit in his dev board.

    So, thanks for all your help in this thread, I indeed purchased a PICKKit 3 Debug Express from Microchip ... as well as Gooligum's assembled dev board. I should be up and running in a few days and will definitely be back to ask more questions as I get ramped up!

    Oh, and after the JBC soldering iron shows up! (I hope I don't regret not getting the Metcal).
     
  13. t06afre

    AAC Fanatic!

    May 11, 2009
    5,939
    1,222
    I have problem finding good books about PICs(that will say books I like ;) ). They are either based on using very old and outdated PICs, using the wrong C compiler, or to basic. If I should recommend one book that it may perhaps be the "Microcontroller Programming: The Microchip PIC Julio Sanchez and, Maria P. Canton" But I do not know if this is a book you will like. I will recommend checking it out on the library first. Much PIC learning material are based on the outdated 16f84. Do not use this chip. As a replacement use the 16f88.
     
  14. ErnieM

    AAC Fanatic!

    Apr 24, 2011
    7,392
    1,606
    Great, you got a PICkit. HOORAY and congratulations!

    You've just saved us all the inevitable "I bought a cheap clone off EBay and now is doesn't do squat" thread.

    That looks like a fine development board too. Has lots of nice pieces to play with, simple LEDs, 7 segments, a pot (and a light dependent resistor) for analog to digital conversion, some buttons, and a dreaded wireless protoboard (which are OK to start with but I hope you outgrow it soon).

    You'll learn lots of good things to use in other projects. Most of the basics are there. Anything it lacks you add on the protoboard area.

    And extra points for getting the ASSEMBLED dev board! As nice it is to say you built it, if it doesn't work you are in a pickle.

    BTW, there is a sub forum here just for Embedded Systems and Microcontrollers called (by pure coincidence) "Embedded Systems and Microcontrollers." As you proceed you will find you get faster answers (I read that one first) if you post your questions there.

    You're almost up to the 10 post "full membership" so you'll soon be unstoppable!

    Good luck!
     
Loading...