Basic question about micro controllers - Page 1
Forum section: electronics / beginners

author: karotto
author_rank: Newbie
timestamp: September 08, 2013, 05:09:34 pm
content: I am not a newbie although I am self-taught so I have some knowledge gaps in even the most basic areas. Microcontrollers, for instance. I almost get the concept but I need a few more questions answered. Is the following true?:Microcontrollers are programmable chips. The early chips, like the 555 (not sure even if this is considered a micro controller) could be programmed with external components like resistors and capacitors. As technology advanced micro controllers are now programmed by being inserted in a socket and connected to a computer which downloads software onto the chip. So far so good. But what confuses me is the following:There are literally hundreds of manufacturers of micro controllers. Insanely, they all seem to have different software applications to interface with their chips. So does an electronic engineer have to own dozens and dozens of different computer programs and hardware interface pieces in order to work with today's microchips? Even if you stay with one or two manufacturer, a third or fourth, or 50th company could have a chip that has functionality which you want. Additionally, do electronics engineers have to be full-fledged computer programmers? I know that many of the programming requires the language C. So does an electronics engineers have to have two career paths these days, electronics and computer programming? insane enough, it seems like that even the programming languages used are slightly different with different chip manufacturers.Am I missing something here? I just cannot believe that this is the way things are and I would appreciate some feedback about this. Partially I'm also asking these questions because I want to go into using microchips but I don't want to buy one company's hardware and software just to figure out that I need to use another company's chips for certain project. Is there perhaps one piece of software and hardware that works on all microchips from all manufacturers? Thank you very much.

author: Bored@Work
author_rank: Super Contributor
timestamp: September 08, 2013, 05:20:44 pm
content: As an engineer you should be able to start with a new MCU within a week or two. The proliferation of MCUs is not a real problem. Just like with other components there are hard and soft requirements that makes you (or your boss, or someone else) select an MCU or an MCU family. Development environments are just part of the selection process.While it would be great if electronic engineers would be full-fledged computer programmers, too, the reality is most are lousy programmers. Although many think as an EE they are god's gift to programming. Good companies therefore hire programmers to do the software. Bad companies let the EE do some rubbish code.

author: Thor-Arne
author_rank: Unknown
timestamp: September 08, 2013, 05:29:32 pm
content: Try reading thewiki page on microcontrollers.The most used ones is (AFAIK) AVR (Atmel) and PIC (Microchip), both have free development software.And the 555 is a timer IC, not a microcontroller.

author: miceuz
author_rank: Frequent Contributor
timestamp: September 08, 2013, 06:40:25 pm
content: Programming is just programming. Once you learn how to program, language or microcontroller does not matter anymore. Sure, different microcontrollers provide different resources that have to be configured and used differently, but that's just nuisanse that can be covered in a couple weeks.I'm a programmer by education and by experience and when I see code written by ee's -- well, it's just sad. And your average programmer will not give a second thought about ground bounce or capacitive coupling from one trace to other.So, to be a true ninja, you have to be good at digital design, programming and analog side of things.Regarding micros - start from AVR or PIC -- those have tons of resources all over the internet. AVR - based Arduino devboard migth be a good start as it simplifies both hardware and programming.555 is not a microcontroller and it is not programmed in a everyday sense of programming - it's configured to work in some manner by using external components. When microcontrollers are fully fledged computers -- with processor, ram and a "hard drive" and a load of cool bells and whistles that might be thought as internal 555s that are configured by code and work in parallel with the main processor.

author: IanB
author_rank: Super Contributor
timestamp: September 08, 2013, 06:43:15 pm
content: Quote from: karotto on September 08, 2013, 05:09:34 pmMicrocontrollers are computers, just like the one sitting on your desk.The main difference is that the computer on your desk is designed to run any number of different programs and switch between them, while the computer in a microcontroller is usually designed to run one single program all the time for a dedicated purpose.In the industrial world, a microcontroller may be designed into a product that will be produced in huge volume (millions of units perhaps). Therefore the cost of the software and hardware development tools is insignificant. Also, it is not a big deal for engineers to learn how to work with different microcontrollers when they need to choose the best one for a product.As a hobby user, where you use microcontrollers in a more experimental fashion, you will pick just one or two of the more accessible ones like PIC or AVR and get the tools you need just for those.

author: Kappes Buur
author_rank: Regular Contributor
timestamp: September 09, 2013, 08:00:33 am
content: Quote from: karotto on September 08, 2013, 05:09:34 pmRegardless if you are just a hobbyist or a professional, you will eventually settle on one or two platforms for which to design a project. True, there are quite a number of microchip manufacturers out there, but to get started choose just one, lest you get all turned around and bog down. Start with something for which there are a lot of development boards and I/O boards available. You do not want to spend a fortune to design your own platform, although that would be a good learning process.Maybe it's Atmel, Microchip, Texas Instruments, STMicroelectronics, Freescale, Relysis or whatever. Research which company offers free software and inexpensive hardware, but pick just one.Once you are familiar with one platform then try another. Thats the way to gain understanding.Does one have to wear several hats at the same time, that depends.If you work by yourself, most certainly. But making money that way is very difficult, unless you find a very specific niche.If you are working for some outfit with more than 5 people, then chances are that the employer will have had the wisdom to hire people who are specific for each task, eg: programmers to program, engineers to design, layout people to make the printed circuit boards, etc.So, it is a continual learning path. Todays hot chip is tomorrows old hat. However, what has been learned previously can, in most cases, be applied to newer products. Yet, that does not mean that an engineer cannot be a competent programmer, or vice versa. One just has to find where one's talents lead to.

author: amyk
author_rank: Super Contributor
timestamp: September 09, 2013, 08:08:29 am
content: Quote from: Thor-Arne on September 08, 2013, 05:29:32 pmIn terms of volume, 8051 probably still dominates... and at the higher end, ARMs. I've not seen much AVRs in commercial products, they tend to be "hobbyist" (Arduino etc.), PICs are a lot more common though.

author: BravoV
author_rank: Super Contributor
timestamp: September 09, 2013, 08:44:10 am
content: Quote from: amyk on September 09, 2013, 08:08:29 amAn insight on the shipment trends among microcontrollers.Source ->http://www.icinsights.com/news/bulletins/MCU-Market-On-Migration-Path-To-32bit-And-ARMbased-Devices/If you're planning to start totally fresh from the beginning "AND" have passion to enhance it further, not just blinking some leds or displaying temperature at LCD, and then stop and feeling satisfied, suggesting to aim higher for ARM 32bit platform. Price wise, arm 32 bit mcu nowdays are cheap too.Although the route is "a bit"tougher compared to 8 or 16 bit mcu, imho its worth the investment.My 2 carbon resistors worth of advice.

author: Kremmen
author_rank: Super Contributor
timestamp: September 09, 2013, 09:31:21 am
content: Agree with all of the above.My 2c worth would be a totally personal totally biased recommendation: If you plan to jump in, do it this way:Get an Arduino and play with it. The Arduino toolchain (what we call all the different pieces of software to create a program, transfer it to the target system and maybe debug it as well) is dead easy - it is all integrated, all thought out for you. You'll be programming 1 minute after installation completes. No extra hardware needed to transfer the program to the device (well, a USB cable). This will get you started and whatever people say, some serious shit can be implemented using a lowly Arduino. It will be good to learn all the basics of programming in C / C++.Load the free Atmel Studio fromwww.atmel.comand install it. The latest version has tons of free and paid plugins or add-ins available, and a way to load those from inside the Studio IDE (integrated development environment). One of those plugins is the Visual Micro Arduino plugin. Load&install that and presto - you can program your Arduino using the Atmel Studio instead of the Arduino IDE. This is a 1000 foot jump upwards. Now you are using a "real" development tool. The Visual Micro plugin even comes with simple debugging capability that is very much missing from Arduino IDE.You now have the tool to develop software for practically any Atmel made chip. This will take you a long way as there are loads of boards and designs available for all kinds of Atmel chips. Somewhere along the line you may want to upgrade your hardware to make use of this.Atmel provides device programming tools such as the AVRISP, programming and debugging tools such as the JTAG-ICE II and 3, and there are any number of clones and cheapo tools doing same or at least most of it.The Atmel Studio will compile code for Atmel ARM processors so escalating your hardware to something like say the J-Link (EDU) from Segger will give you the ability to debug that architecture as well. Once you get this far you are no n00b any more and can make your own decisions.But then of course there are other roads to travel. ST makes some robust ARMs as well, and their Discovery dev boards are well worth a look. ST has a debug tool called ST-Link (v2) that lets you debug ST's chips. The Discovery board comes with one laid out already on the board. But be aware that for a free toolchain, you will not find a similar no-brainer that Atmel provides. In this respect Atmel has done good.Microchip of course has their stuff for PICs. Must be similar to Atmel's but that is for others to say. Life is short and Atmel and ST have provided all i need so far.

author: karotto
author_rank: Newbie
timestamp: September 10, 2013, 01:58:23 am
content: Wow! thank you! I made my decision. I am going the Atmel/Arduino route. I was planning to go Microchip/Pickit2 because of the good things Dave said about it but Arduino is the way to go for me - so Atmel. Although I dread the enormous task of having to learn a programming language C++I have one last question though: If Microcontrollers are computers and if they are pretty much used in almost all electronics these days, why do most devices still have 100s if not 1000s of components in them? Couldn't the MCU replace those (unless for high power)?thanks again!

author: IanB
author_rank: Super Contributor
timestamp: September 10, 2013, 03:25:53 am
content: Most devices generally don't have 100s or 1000s of components in them. They mostly have only a few major ones these days.But also a computer can't do everything. Mainly all it can do is compute, and relatively slowly at that. There are lots of functions involving analog processing or high speed digital processing that an ordinary micro is not fast enough to perform. For specialized functions dedicated chips work much better.

author: Kappes Buur
author_rank: Regular Contributor
timestamp: September 10, 2013, 03:51:08 am
content: Quote from: karotto on September 10, 2013, 01:58:23 amSince you decided on Atmel/Arduino you might want to check out some sites on Youtube. The one's I found most instructive were bymjlorton - he has a style all his own but very well made videosJeremy Blum - easy to understandPatrick Hood-Daniel - he explains how to set up Atmel StudioThe Ben Heck Show - it's worth checking outand some on InstructablesGood stuff is also found on the Arduino Homepage, Adafruit and Sparkfun.Quote from: karotto on September 10, 2013, 01:58:23 amOne could think so, but those little beasties are simply doing the controlling, not the interfacing and activating.With embedded systems more and more of the interfacing is crammed onto the same substrate, but even those need a few components to do what they are to do.

author: Kremmen
author_rank: Super Contributor
timestamp: September 10, 2013, 06:16:50 am
content: Quote from: karotto on September 10, 2013, 01:58:23 amYou are welcome. I don't wish to bash anyone else but i think you have made a choice that works.Learning chess has some analogy with learning how to program. It is necessary, but not sufficient to learn how the pieces move (the grammar and syntax of one or more programming languages). You then need to learn about playing strategies (program structure and control flow) and patterns of play created by past masters (algorithms and data structures). Without stretching the analogy further, learning to program is a lifelong task; one will never be "ready" (with the one possible exception of Donald Knuthhttp://en.wikipedia.org/wiki/Donald_Knuth). That of course is no reason not to start, just the opposite. Only don't expect to be a grand master after a week of cramming.QuoteAs already mentioned, there are whole problem areas where microcontrollers can help little or not at all.As you note yourself, the elements passing high power in power conversion and control circuits are in a domain of their own. Also the associated control circuitry such as the gate controller of a high power IGBT switch can be fearsome beasts not implementable by a "calculator".High speed signaling will become an issue after their frequencies pass beyond the capability of the MCU to process. There are well established information theoretical limits that tell you when this is happening and beyond that point other kinds of solution enter. While not really a microcontroller, the FPGA shares the feature of "programmability" although an FPGA program is not sequential in the sense a C/C++ program is, but rather a description of hardware configuration. Yet FPGAs and their cousins, the ASICs are a common solution for digital high speed signal processing.Then of course there is the whole realm of interfaces to the outside world. Philosophers argue whether reality "really" is analog, or if there is a finest level of structure below which everything is digitized into quanta of this or that or the other thing. For a micro the world nevertheless is analog, and you need all kinds of signal conditioning circuits and often also external converters from analog to digital and back.And let's not forget that often it is just plain easier to implement a simple function directly by a tried and true circuit, instead of making the effort to digitize a signal, convert it to a discrete time presentation, do the necessary manipulation, and convert back.Once you have the Arduino basics well in hand, do remember that there is also the forum site dedicated to all things AVR: AVR Freaks athttp://www.avrfreaks.net/. You can hardly come up with a question related to Atmel chips that someone over there cannot answer.

author: casinada
author_rank: Frequent Contributor
timestamp: September 10, 2013, 06:51:20 am
content: I think you can play with arduinos but to have a good foundation you have to learn a little bit of the basics first.Digital Logic: Just the basics, binary, octal, hexadecimal numbers, Boolean Algebra, logic symbols.A little bit of Microprocessor architecture (what are the parts inside a processor).A little bit of electronics: Ohms Law, Kirchhoff theorems, Thevenin and Norton, etc. Nothing crazy just understand the concepts and relationships between Voltage, current, and Resistance as as start. You only need basic math to learn these concepts.There are lots of free books, blogs, and videos on the internet about all this subjects. some of them recommended in this forum if you look around.You can buy evaluation kits for different microcontrollers for less than $20. All you need is a computer with a USB port. For most of them you'll need to learn how to program in C or Assembly language. The AVR (arduino) is very popular because you don't need to know how to program in C but if you want to program any processor you'll have to learn C or Assembly.The better informed you get on all these subjects the better quiestions you'll have for US.Good luck.