TECHNO TE(A)CH INTRODUCTION: Hello guys hope you understood the really ‘down to earth things in electronics’. Now, its time for us to step forward and explore the never ending world of Micro-Controllers. What? Can’t believe in you; well start believing because what you believe is that what you become! ”WHAT ARE THOSE THINGS”: They are very small ICs (like to that of decade counter, well not exactly) and they have a complete computer inside them. But the capacity of the computer is not equal to your desktop. But the basics of a computer are completely embedded in these things. So they are also called “single board computers”. They have memory (similar to that of your hard disk but not with capacity 80 GB), they have RAM (but not of 512 MB) and they have ports for interfacing external gadgets (similar to the ports in your computer that drives your keyboard, mouse, DVD reader, serial USB drive and other peripherals) etc. These micro-controllers are available very cheap with in Rs. 100 and can be easily utilized in any high density circuits. You can see these micro-controllers where automatic processes are going on. For example, the traffic signals in our city employ one of these micro-controllers to count down time and shifting signals according to the commands, robots which does line following, crane setup and many more. Thus these micro-controllers are automation tools that help achieve impossible things by normal logic chips and other components. “WHERE TO START”: “Right here and right now” I would say. In order to understand the complete working you can follow the step by step procedure given in this magazine. Initially to begin with I thought of introducing you to a micro-controller family called ATMEL 89C51\52. They are very easily available in the market. There are very minor differences between 89C51 and 89C52. We will use 89C51 because they have enough memory of 4KB (what thought they would have 40GB memory?) to test the initial programs. 4KB is just enough to control too many devices. “HARDWARE… SOFTWARE… EMBEDDED… WHAT ARE THESE”? Hardware is any thing that can be seen and touched. Software on the other hand cannot be seen and their consequences may be felt or seen. Embedding is a process of bringing or fusing together the hardware and software. Microcontrollers are perfect examples of embedded technology. They already have an
assembler (which is software) inside them and the software resides in hardware, I can’t see any other example that would best suit. “WHAT FIRST? HARDWARE OR SOFTWARE”: The software is the first and the foremost I would say (this is completely my own statement), because requirement is the first push and to satisfy that you need a methodology. Software is one such methodology. It identifies the problem(s), has a working pattern and clears the problem(s). The palace where the software works is the hardware. So they are equally important, but, software should be created first. So we’ll first see how to write a program, testing the program for compile time and run time errors, burn the program into the hardware chip (89C51) and apply it in real time situations. So throttle up! And here we go… THE PROGRAM: The major difference between your computer and micro-controllers are that your computer uses previous versions of these micro-controllers called microprocessors or just processors. These processors are very high speed and high address latching capabilities. So what processor you have? Obviously Pentium 4 or something greater (if you trust INTEL so much). But our micro-controllers are bit predefined i.e. you can’t add external memory just like that (4K + some memory). You need to dedicate some ports (pin connections) and other aspects such as speed, execution velocity etc. (more on this later). Before developing a program, you need to know where this program is going to run i.e. the hardware. So the characteristics of the micro-controller are to be studied. That can be done from its architecture. The architecture of the ATMEL 89C51 is available for free downloads in our blog spot. Study the architecture carefully because your program will use the architecture to accomplish its mission. Once the architecture is studied the memory details have to be furnished. This cannot be observed from the architecture. So I will help you through the memory side. The reason for teaching you the hardware first is that to improve better understanding. But once you ‘grow up’ you shall start with software on the first case. THE ARCHITECTURE: The architecture and necessary details may be studied in the given download file. Any questions and doubts are most encouraged. We shall do our testing and programming step by step and unit by unit. Each unit of the micro- controllers will be dealt in separate editions and challenges will also be given. So take a shortcut and visit the data sheets that will provide you details on pin configurations etc.
don’t boggle your minds with the chapters of lock bits, IC programming etc. that shall be dealt separately on the next issue. THE SOFTWARE: In order to test our codes we need an interface called integrated development environment (IDE). I have chosen a very basic IDE called PINNACLE. This will be the IDE I shall be using. If readers find any other IDE better than this try us to give the link. The screen shots of this software shall be used to explain the working of micro- controllers. A free download of this software is also available in our blog spot.
This is a sample screen shot of the IDE. The ports, registers, timers, flag status are clearly shown. A sample program (only the starting) is visible in the screen shot. This is my program to count up to desired count from 0-99 and displaying it with a 7 segment display (this program will be taught to you very soon).
The programming method is of two varieties. One is that we can write codes in assembly languages and second we can use embedded C. The assembly language varies for various micro- controllers. The syntax is varied but the operation may be the same. But in embedded C the source code is written in C (not regular C) and compiled using cross compilers for various micro- controllers. The C technique is very easy but we shall adapt the assembly language technique to start with. THE FIRST TASK: The first task in learning micro controllers is that you need to go through the architecture. This month there won’t be any work as such. It’s because I don’t want to teach the entire micro- controller operation and give software solutions we shall learn the process and implement the software then and there. So start with learning the basics. I thought of attaching one more file on basics of microcontrollers but why I need to upload when there is so much data available in the internet. So I thought of providing a very useful and authentic web site link. You can find that in our blog. Try giving it a reading (don’t care about how complex they are). And we shall see each and every parts of the architecture alone so that you can understand better. Why wait! Gear up and let’s have fun with these pesky little ICs. Catch you soon with programming techniques and more… … .