A Fresher's Question...

Discussion in 'Embedded Systems and Microcontrollers' started by mpnvineeth, Sep 12, 2012.

  1. mpnvineeth

    Thread Starter New Member

    Sep 3, 2012
    5
    0
    Hi all,
    I am a fresher in the realm of microcontrolers.
    I wish to start learning it. I wish to start it through PIC.
    Which should I start using? 16F series, 18F series? or the higher?
    Whichever it be, please specify the IC number.
    another question is, which one is better, starting from assembly language or using C?

    I look forward to the words of those numerous pioneers...
     
  2. ErnieM

    AAC Fanatic!

    Apr 24, 2011
    7,394
    1,606
    I have a standard answer to this question.

    There is always a huge debate on starting from assembler or C or some other higher language. Assembly may seem simpler then C but I am not convinced. I've used both, but way prefer to use C. Keep in mind I was a programmer long before I ever touched a PIC, where I started programming them in assembly.

    If you do go the way of assembly stay with one of the parts with the 33 instruction set (ie, not the 18 series or above). Assembly in the higher units is a huge hurdle to jump and one I have not bothered to follow, I use C for them. The assembler program (part of MPLAB) and the C compiler ("integrates" into MPLAB) are both free to download.

    Either way, start with one of the dev boards kits from the linked post above. One has tutorials in assembler, the other in C. The tutorials are free to download to get your feet wet today.
     
  3. nigelwright7557

    Senior Member

    May 10, 2008
    487
    71
    I would start with one of the little PIC's maybe 12f510.
    PIC's are notorious for having hidden bits in a register somewhere that needs setting/resetting before the PIC will work normally.
    I go through every register setting them up until they are all in a known state.
    Sometimes lazy programmers dont do this and find the PIC doesnt work right.
    Weak pull ups on a port or having the a2d be on when you are trying to use the port for i/o logic.
     
  4. ErnieM

    AAC Fanatic!

    Apr 24, 2011
    7,394
    1,606
    Quite true. Newer devices try to compensate for this by giving you a list of ALL registers associated with a pin, so you may see A2D registers noted on the section for I/O ports. That is a big hint something may need to be changed to get the action you require.

    The reason A2D functions affect simple I/O is these pins need to default to analog when being used as analog, so the default to analog to make the power-up sequence safe.

    Of course, when starting out you are usually not doing anything analog so you don't think of this and get a seemingly good part and program to brick out (do nothing).

    Another reason to start out with a developer board with some tutorials that talk you thru this stage. Later when you get caught by this anyway you can say to yourself "they told me so."

    Personally, I haven't got caught by this since way back this past Saturday.
     
  5. THE_RB

    AAC Fanatic!

    Feb 11, 2008
    5,435
    1,305
    My answer used to be very much like ErnieM's answer in post #2.

    These day's I've been of the impression it's better for someone starting to go straight to PIC18F and start in C, and gloss over learning assembler at least for the moment. Microchip's 18F lineup is often cheaper than the 16F and the 18F have much better performance and features.

    I would also start with 3.3v devices or at least some of each (5v and 3.3v) and a dev board that lets you use 3.3v PICs. Again the PIC18 3.3v lineup is cheaper, faster and better than the older parts. And most of the newer cool gizmos to attach to your PIC are 3.3v.
     
  6. arlabstech

    New Member

    Sep 18, 2012
    1
    0
    Dear Vineeth,

    If you want to start off with PIC Microcontrollers, PIC16 is a great option to start off, it wont be difficult to learn, plus you wont have to buy any expensive burner in case you are programming using bootloader, so i'll highly recommend PIC16F877A to you.
    There are lots of good and detailed basic tutorials available online, i'll recommend this blog to you

    http://embeddedpro.wordpress.com/

    Here building basic embedded system is given in stepwise manner, plus there are snapshot based examples of everything.
     
  7. ErnieM

    AAC Fanatic!

    Apr 24, 2011
    7,394
    1,606
    Bootloaders are nice if you have one. They depend on having the bootloader code already inside the PIC you use, and the hardware to support however the code gets from your PC to the PIC, typically over RS-232 or USB.

    However, there are several drawbacks:

    1. You don't get in circuit debugging. It's awesomely helpful to watch your code inside your hardware working, or not working as it were. A bootloader doesn't have this function.

    2. You need to buy a PIC pre-programmed with the bootloader. And once you get this chip, if you actually build a project you have to order another pre-programmed chip to use your program that project.

    3. You are stuck with whatever hardware development platform comes with that bootloader: they are very hardware specific.


    There's no bootloader that comes with a factory PIC16F877A chip, it is a program added by a reseller. I'm sure it works, just subject to the above limitations.

    I've got 3 programmers, PICkit 2, 3, and an ICD 3. I use the PICkit 2 the most, and that's the least expensive one of the bunch.
     
  8. t06afre

    AAC Fanatic!

    May 11, 2009
    5,939
    1,222
    I would rather go for the 16f887. The 16f877 lack internal oscillator module. Since the 16f877 is somewhat old. It could be that is need a "debug header" in order to debug with with PICKIT2/3
     
Loading...