Need help to start with Microcontrollers

Discussion in 'Embedded Systems and Microcontrollers' started by mbsid786, Jan 25, 2013.

  1. mbsid786

    Thread Starter New Member

    Jan 25, 2013
    2
    0
    What's the best book to start with micro-controllers as there're already many types of microcontrollers available out there like AVR, PIC, Arduino etc. I know nothing about them, my friend just recommended me to start with PIC microcontrollers by Mazidi. Suggestions pls ??
     
  2. MrChips

    Moderator

    Oct 2, 2009
    12,440
    3,361
    absf and Metalmann like this.
  3. ErnieM

    AAC Fanatic!

    Apr 24, 2011
    7,388
    1,605
    It's going to depend on what you want the micro to do for you. ANY of these micros are very good.

    I use PICs. Without any other information I would suggest you start with a PICkit3 Debug Express kit.

    You get a board with a micro, some buttons leds and pots to experiment with, and most importantly, a programmed and debugger that works with every part Microchip makes.
     
  4. tshuck

    Well-Known Member

    Oct 18, 2012
    3,531
    675
    That is how I started. That book is a decent reference to get your feet wet while teaching basic microcontroller theory....
     
  5. Potato Pudding

    Well-Known Member

    Jun 11, 2010
    684
    92
    Good luck finding M68s these days but otherwise it is dandy for learning.

    I feel sort of the same about the INTEL 8048, and wouldn't recommend them either. If you can find one outside of salvage from obsolete equipment it will probably cost you $20 for the chip alone, plus it needs too much support circuitry.

    Motorola's manual does have great examples of the same type of Flowchart first programming training that I learned.

    That manual you posted is worth reading and review just for that process flowchart programming method.
     
  6. Potato Pudding

    Well-Known Member

    Jun 11, 2010
    684
    92
    Or for a book, first just download PICKIT 3 DEBUG Lessons.

    Download that for free and you will see some basic lessons on using the PICKIT 3 and programming a MicroController, specifically the PIC18F45K20.
     
  7. mcgyvr

    AAC Fanatic!

    Oct 15, 2009
    4,770
    970
    I think its the "easiest" way to get into micros is the Arduino. No programmer needed. TONS of examples.. TONS of help about them on the forums.
    More advanced/old school programmers like to bash it.. but I think they are just jealous that something wasn't around like that when they were learning. :p
    Its not a "professional" device but heck I didn't learn to drive in a Ferrari either did you.
     
  8. tshuck

    Well-Known Member

    Oct 18, 2012
    3,531
    675
    The Arduino isn't a microcontroller. The AVR on the board is the microcontroller. The Arduino is an abstraction so that people who don't know about how it works can still use it. That's great unless you actually want to know how to use a microcontroller. Yes, the Arduino makes things easier, and I think it's a good starting point in electronics, but should not be mistaken for what a microcontroller is.
    ...hmmm... it's more like knowing how to use the gas and brakes, and nothing about why or how it works...but you can still look cool to people that walk...
     
  9. Potato Pudding

    Well-Known Member

    Jun 11, 2010
    684
    92
    Boy. I resisted the urge to respond to the slam against the Arduino.

    Arduino's are not very challenging because they simplify a ton of the tedious detail work of microcontroller development.

    That is not a bad thing.

    If I have an IDE for any microcontroller that let's me get development of projects done with less hassles, that is a good thing.

    The ATMEL chips are very capable microcontrollers. The Arduino bootloader and software is equivalent to PICAXE, BasicStamp, Propellers, etc. They are a wheelchair ramp on the learning curve - an easy way to work with the microcontroller.

    Are any of those the best to use for optimal code creation? Rarely if ever; but that is if you only measure by hard performance. The ugly truth about performance is that most people need a Hyundai, not a Ferrari. The best performance measures are:

    1: Does it work?
    2: Was it created quickly and efficiently?
    3: Will it cost a fortune and be impossible to find people that can do the work if I ever need to make any changes?

    Arduino's are fine starting out. As the chips get more and more powerful, the performance hit will matter less and less, unless you need code to brute force something nasty like an RF signal abstraction.
     
  10. Metalmann

    Active Member

    Dec 8, 2012
    700
    223
    I've been studying Arduinos for a while now, and they look mighty challenging to me.;):D


    No, really.:(
     
  11. thatoneguy

    AAC Fanatic!

    Feb 19, 2009
    6,357
    718
    From a user point of view, I'd class the Arduino vs C on a uC as Apple vs. PC.

    You pay more for the Arduino, but it's easy to use, you also need to pay a lot more to add what are otherwise simple peripherals, but there's a $10-$30 plug and play "shield sur-charge" because it IS plug and play that comes with code and a ready made library so the user doesn't need to know how it works at all to use it.

    While PC isn't as easy to use, they are less expensive, more expandable, and the user has more control over the system.

    Both are useful platforms, for the right type of users. The Arduino users even have the same prejudice against C programmers, the way Apple users tend to berate PC users (and vice versa). As long as one stays within the limits of the Arduino system, it IS easy to use. If you want more speed, control and a lower cost, then it isn't what you are looking for.

    The problem with this setup is when Arduino users decide to add hardware that hasn't been made into a shield, or add some other circuitry. Then the forum has very interesting threads trying to explain to the user that things such as current and voltage matter a great deal, and parts just can't be snapped on top of each other and magically work.

    I am NOT anti-Arduino, they are great for introducing people to how many cool things are within reach when a microcontroller is involved. The PICAXE is an even simpler, single IC, BASIC interpreter that is incredibly easy to use. The "downside" of the PICAXE is that it doesn't have standardized hardware and users need to know basic electronics to make useful circuits. I see that "downside" as a bonus. However, if something more capable than a PICAXE is required for a beginner, Arduino is the next step. Too many people stop there, rather than progressing to C on bare microcontrollers, which is where the Apple analogy fits again: "If there isn't a shield for it, it can't be done".

    ETA:
    The only thing I have against Arduino is that users tend to thing that only ATmel controllers are "good", even though PIC have many more features, sooner to market, and often at an equal or lower cost. The Arduino environment is so abstracted through libraries that it works with PIC Microcontrollers (PICDuino), or even the ARM32 (Arduino DUE). When a system gets to a point where the actual controller (or sizeof(int)) doesn't even matter, one who uses that system cannot rightly claim that they are an "Embedded Microcontroller Programmer".
     
    Last edited: Feb 1, 2013
    tshuck likes this.
  12. tshuck

    Well-Known Member

    Oct 18, 2012
    3,531
    675
    Sometimes... This is not always true. It can, and in many cases, is bad to oversimplify things, however, for beginners, as I said, can be good, but it is important not to leave that as your only tool if any serious digital design work is done.
    I agree, but that is neither here, nor there. An IDE, with a compiled language, is used to write the code that will be compiled down to whatever interpretation the end game is.
    Propeller? It is nothing like Propeller! PICAXE and BASICStamp, I'll give you, except that the BASIC running is interpreted, further slowing the processor, but the Parallax Propeller is an eight-core, 32-bit processor, blowing any, and I mean ANY, Arduino out of the water!

    There are MANY more considerations than the three you've listed...
     
  13. tshuck

    Well-Known Member

    Oct 18, 2012
    3,531
    675
    Here, here!
     
  14. Potato Pudding

    Well-Known Member

    Jun 11, 2010
    684
    92
    Yes I know there are more considerations. :)

    I said those were the best performance measures - but they are Model T type performance - not Ferrari. If you are disputing that the Model T was more successful than any Ferrari. You are partly right. I wouldn't race a model T against any Ferrari's... unless the track was mostly cow pastures, and Class D roads. How does the Ferrari compares on sales? Oh and both cars are going to get broken. You have one screwdriver, a crowbar, and a hammer for tools; and your parts budget is $5. Fix them.

    The objections to the cost of the Arduino and the need for shields are fairly well founded, except...

    What ever you can plug into a breadboard with your other Micros you can probably plug into a breadboard and wire to an arduino. Shields and their libraries are convenient but not required.

    If people lose interest in doing things with the arduino, once it requires breadboard circuitry and developing their own circuit specific code, then they were probably never going to do anything with any other micro-controllers, is all that I would assume.

    I think the arduino scares some people. There are a lot of kids out there just doing cool stuff. Most of those kids have never felt the burn of scanning hex code looking for bugs, or wondered if they should leave a few more NOPs, just in case! Life just ain't fair.
     
  15. tshuck

    Well-Known Member

    Oct 18, 2012
    3,531
    675
    What about upfront cost?
    What if a company can get another microcontroller for $0.25 each?
    Is the company selling the product likely to be around next time this device needs revamping? What are the chances that the silicon has bugs?
    What are the manufacturing/shipping costs that it would take to get these devices to assembly?
    I have mentioned neither the Ferrari, nor the Model T. You did.
    Are you insinuating that Arduino outsells PIC? or AVR? Or TIs microcontrollers!? Atmel barely even cares about Arduino. They use their microcontrollers, but the profit from the Arduino crowd is a drop in the bucket compared to Atmel's other sectors.
    So, I have $5 and all parts for the Arduino are ~$30, where any generic module/component can be had for less than 1/5 of that... sounds like an open-and-shut case...

    This is my point...the parts are interchangeable, so why pay more?

    And the Arduino is fine for them...

    So, we are going to EPROMs with glue logic? Sounds fun!:p
     
  16. Potato Pudding

    Well-Known Member

    Jun 11, 2010
    684
    92
    Arduino is not a bad way to introduce people to microcontrollers.

    Why slam their use for people that want to get a first look?

    Last thing that I have to say about this will give you an example of the experience I am coming from.

    Working with students that were doing a project. Got them to request some sample Atmel chips. Put an Arduino bootloader on their chips. They had a prototype board with 2 Arduino project chips on it running an interface between LinuxCNC and a small 3 Axis mill when they were done.
     
  17. tshuck

    Well-Known Member

    Oct 18, 2012
    3,531
    675
    See post number... every one I've made!

    I said they are fine starting out with, but do not grant user the experience of using microcontrollers, just what you might be able to do with them. The user has no knowledge of underlying mechanisms and doesn't understand why readAnalog(Pin1) takes so much longer than digitalWrite(). It's a narrow path to walk, once someone starts with Arduino; their first instinct is to design with Arduino in mind. It's like crack for hobbyneers....
     
  18. raychar

    Member

    Nov 8, 2011
    82
    0
    Hello,

    May i ask a question that it may not well related to the topic:

    >i am a PIC fans, that is, i use it right from the beginning of my learning of MCU.

    >i am now designing a industrial device with 18F452/16F877A IC.

    >i may need to adjust the program codes after the device reached the hand of customer because some of the industrial parameters are different
    for some customers.

    >is there a chance for me to do it on-line? i don't want to ship back the product to make modification of software codes. Are there other PIC MCUs that i can change that it can do that..,

    >i have limited knowledge of Arduino, is it capable to do it?

    Thanks in advance,
     
  19. tshuck

    Well-Known Member

    Oct 18, 2012
    3,531
    675
    First, start a new thread to ask your question since it doesn't pertain to this thread.

    Second, using a bootloader allows you to connect to a uC and, if the device allows it, it will let your rewrite the program memory, essentially changing the program stored in the device. You could make a bootloader that connects to a computer and some stand alone software that could communicate with the device to tell it to reprogram itself. This is what the Arduino does to reprogram with only UART communication.

    Third, why are you trying to use a 16F877A in a consumer product?:confused: There are many better devices out there... PIC or otherwise....
     
  20. the_mole_763682

    New Member

    Sep 27, 2009
    3
    0
    Why not have a "dongle" device that has parameters loaded onto it, and when plugged into a socket on the customer device and the device is rebooted, it has the parameters loaded into the device.

    For example - the main customer unit when started up will look for a specific pin on the connector being pulled low (0).
    if it is low, then it knows that the "dongle", which in our case is an I2c eeprom with parameters on, is plugged in, and so it reads the new params from the i2c.
    then all you need to do is make an i2c device with a plug on it that you send pre-programmed to the customer.
     
Loading...