The microcontroller, or MCU, is simply put a very small computer crammed into a single chip. Unlike personal computers, MCUs have typically a rather humble amount of computing power but they are low cost and don't require much electricity. Therefore they are perfect to solve relatively simple tasks in embedded systems. If a desktop computer is a car and the Pi is a motorcycle, then the microcontroller would be a lawnmower: not very fast but good for its intended purpose.
Basic building blocks of a microcontroller. |
In addition to the CPU, a microcontroller contains memory, input and output peripherals and quite often an internal clock. Memory comes in two flavours: volatile and non-volatile memories. Here volatile memory is synonymous with random access memory (RAM) which is fast but requires power hold information. RAM is therefore used for run-time storage of data, such as the position of the player or the number of lives left.
Non-volatile memory on the other hand retains its data even without power. However, depending on the type of the memory it is either non-writeable or slow. Non-volatile memory is thus most suitable for storing the program itself or data that needs to be preserved even when the system is down, like save states.
Input and output peripherals connect the chip to the surrounding world. Input can be, for example, signals from a controller to move the player around. Output signals can control the graphics on the screen or play funky music out of the speaker.
The last but not the least is the clock, an oscillator that produces a periodic signal that rapidly switches between ON and OFF states. The clock makes the microcontroller tick controlling the pace at which the instructions are executed.
Schema of a clock signal |
Well, that was a good bunch of theory. In the next post I'll make it more concrete through an example chip that I'll be using in applications once I get there. Until then, stay tuned.
References:
James J. Brophy, Basic Electronics For Scientists, 1983, McGraw-Hill International Book Company
https://en.wikipedia.org/wiki/Microcontroller
No comments:
Post a Comment