Intro to Microcontrollers
--- MCU ---
H
istorically control and automation were performed mostly by mechanical means and timing was accomplished by using very primitive methods as compared to today's technological means. For example among some of methods used to time an event were the ice melting, burning a piece of wood or other object, water evaporation, sand fall, and so on. Decision making machines were so bulky that not every one could afford to have or build one. Among the decision making machines were the water floating device, fabricated water and sand channels, weight feedback, mechanical properties of material such as flexibility and elasticity, patterns made on cards or objects having special shape or weight, switches, relays and so on.The only unaccomplished dream mankind still have is the creation of the perpetual motion machines. It is basically due to the fact that in order to have energy output you just got to provide an input energy. Since the law of energy conservation provides that energy input equals energy output then the idea of perpetual motion machine would never happen and thus remains a dream. Beside it is the blessings of nature that will not allow that. Well I know one of the old neighbors who could actually defeat the energy conservation law! he could run his floor appliances without paying any money on electricity by stealing electricity from the basement of the house. Friction and energy loss are not a bad thing rather than it is the mean to accomplish a vital task in life and that is to counteract the sources of undesired energy flow at different scales, levels, and times.
Today's technology makes it very affordable and easy to automate any action you can ever dream of. If you look around you will find out that there are so many life necessity items utilizing the Microcontroller. Examples are your wristwatch, calculator, car and airplane control system, many medical equipment, microwave oven, TV and Radio, security systems and so on. The list is endless.
Here is what you need to get started:
Some software packages include both the Editor and Compiler or enable easy handling of both of them. This combination is sometimes called the Integrated Development Environment (IDE). Some companies or third parties sell you the IDE with all the hardware needed to start programming and running your application right off the box. Here is the summary of what we just discussed:
Now that you transferred the Hex File or code to your Microcontroller Unit (or programmed your MCU) you need to run your code. You need Target Board to demonstrate that you are getting from your program (the Hex Code inside the MCU) what you intended to.
The Target Board (Hardware) is basically a Printed Circuit Board (PCB). It accepts your programmed MCU and performs certain tasks as per your program (instructions) such as starting and stopping the motor, turning ON and OFF lights, opening doors, dialing a phone, commanding your spark plugs to ignite gas inside the engine, and so on.
Sometimes the Target Board and the Programmer are sold as one piece and is called Evaluation Board or Development Board and both are Hardware. The same IDE software, Editor, or Compiler may be used with the Development Board depending on the manufacturer or the third party providing the package. Development Board enables you to transfer the Hex Code (Program the MCU) from your computer to the MCU, via your Programming Cable. At the same time you can demonstrate the Program instructions inside the MCU in the Development Board, without having to move the MCU chip back and forth between the Programmer and the Target Board.
If you have the right Development Board you will save lots of development time by simply writing your source code, compile it and transfer it to the Development Board followed by actuating your motors, lights and so on.
Fact:
Many Compilers or Programmers come with lots of sample Source Codes that can be copied and pasted into your program to add value to your program. Once you learn the basics of programming you can then easily understand all Sample Codes included in your Development Package. Development Packages are fully integrated Packages containing every thing you need to start developing and programming including the power supply. This integrated Package makes Development very easy and shortens the Product Time to Market. You can start using these Packages for Product Development right off the box. Many third parties provide and support their own IDE and all associated hardware and software including their sample codes. It is important to understand how different IDEs and packages can serve your design and what features you are intending to utilize. You may need to learn more about available software packages and communicate with technical and sales representatives of different manufacturers to find the best fit for your application. Some manufacturers or distributors will give you free samples, if you qualify, to evaluate in your product or application. Not all IDEs and Development Boards are same as they can be used to serve different technologies and Application areas.Fact:
The Development Package may also include all the schematics, Bill Of Material (BOM), tips, algorithms, sample circuits, and instructions to help you speed up developing your product. Embedded System Design and Development is becoming the trend of this century and is growing at an exponential rate to an extent even the ones with little knowledge or background in electronics can become an expert of Embedded System Developer when enough time is dedicated to it.Fact: Many IDEs include visual or graphical tools to help make programming easier than ever before. With a click and move of a mouse you can design a complete system and program of your own at almost no time and present to the market the most advanced machines and devices of your dream and Electronics of the consumer dream.
Application areas where MCU is used include, but not limited to:
In the next session we will learn how to select the right MCU and start using it with some examples.
By Engineer: Firas Faham