Friday, October 10, 2014

Lab1 Material : Microcontroller Basics

Microcontroller Block Diagram by Ralf Fickert
Microcontroller Block Diagram by Ralf Fickert


The high level Microcontroller Block Diagram above hopefully makes it easy for the children to understand the basic components common to any Microcontroller.
 
It is suggested to have a poster of this Microcontroller Block Diagram on a wall in the Lab always visible for the children as well as to give them a copy of it. In case that you are executing the Lab in another Language than English I would highly recommend to keep the diagram in English and translate it during talking to the children into their language when you are executing the Lab. This will help the children to learn the English terminologies as a side effect of the Lab. By doing so the children will start to understand how important the English language is in order to have the broadest access to information and as well to worldwide resources/communities. Having the capability to collaborate world wide will enable them to participate, learn, share with project teams which are not necessarily in the same country in which the children live – that will not only  help the children to bring their dreams into the real world but also to give them early access to new technologies and knowledge. Being able to collaborate world wide ensures also a great world wide network for the children’s future.  

Working with the Microcontroller is fun – the Microcontroller is the Portal to the real world.
A lot of Toys and equipment’s are using Microcontrollers such as Robosapien, Battleships, SmartPhones, Oven, TV Remote Control, Security systems etc.  SmartHomes are impossible without using Microcontrollers – so for the children it is important to learn how Microcontroller work and to be able to invent their own Microcontroller based SmartHomes equipments or at least to be able to modify them to ensure the SmartHomes is not going to be an external controlled prison at the end.

Major manufacturers of microcontrollers are Atmel Corp.  , Microchip Technology Inc. and Texas Instruments Inc.

We will use the Atmel Microcontroller AVR Mega:  ATMEGA168-20PU, DIP-28 for our Lab.

Central Processing Unit (CPU)
The Central Processing Unit (red box) short CPU is the brain of the Microcontroller. And the same as our Brain does the CPU of the Microcontroller interpret, process, act and create new information on the information it receives. In order to act with the real world the CPU needs sensors to understand the environment such as temperature, humidity, speed, light conditions, heart beats, sugar level , if a door is open or closed etc. and the CPU needs actuators such as motors, valves, sounds etc. to impact the real world.

Memory
Random Access Memory (RAM)
The RAM (right light blue box) can be compared to our short term memory. The RAM is used to keep the current important information in focus such as our brain does. The information stored in the RAM is lost after a power cut, reset or restart of the Microcontroller. So information stored in the RAM is volatile.

Flash Memory
The Flash (right light blue box) is the memory where the compiled program code is stored. The Flash is non-volatile and will not be lost after a power cut, reset or restart of the Microcontroller.

Electrically Erasable Programmable Read-Only Memory (EEPROM)
The EEPROM (right light blue box) provides a non-volatile memory for storing data.


Clocks/Counters/Timers
The Clocks/Counters/Timers (top dark blue box) are important as they provide the Microcontroller with a sense of time. The AVR has multiple Clocks/Counters/Timers which are based on the same common time base ensuring everything is running nicely synchronized together. Clocks/Counters/Timers are used by RAM, Flash, EEPROM, Input and output peripherals.

Oscillator
The Oscillator (bottom dark blue box) sets the chips internal rate and controls how much work can be done in a given time. The oscillators speed is like the heartbeat of the chip.  

Interrupt Request (IRQ)
The Interrupt Request (bottom black box) sends an interrupt request to the CPU to stop whatever it is doing at the moment to be able to react on a specific event which just occurred.

Peripherals Input/Output
The Peripherals Input/Output (top black box) provide the Microcontroller with the capability to interact and communicate with the Real World via sensors or actuators.

Sensors will provide the Microcontroller with information of the current state of the environment such as current temperature, speed, humidity, blood pressure, GPS position, power is on, window is open etc.
Human’s sensors would be eyes, ears, nose, tongue, skin, etc.

Actuators enable the Microcontroller to physically act in the Real World based on the information received by the sensors or instructions of the program.
Actuators could for example close an open window automatically when we leave the house, or turn down the heating if the temperature reached a threshold, execute an alarm in the case movements are recognized within a monitored room, stop a robot when an obstacle is detected etc.
Human’s actuators would be hand, fingers, knees, elbows, mouth etc. 


Data Bus
The Data Bus transports the information from one component to the desired other component. For example the CPU could request data from the Memory – the data from the memory would be put onto the data bus and received by the CPU – the CPU then processes this information and could then base on the result of the information analysis send the request via the data bus to an actuator like a motor to turn until a window is closed.

The data bus is the communication vehicle between all components connected to the bus and via the peripherals even the real world is part of the communication.
 

I hope this document is useful for you,
Ralf

No comments:

Post a Comment