2. Intro to Microcontrollers Flashcards
What inputs does the microcontroller need to handle in a washing machine?
- buttons on control panel (on/off - digital)
- water level (digital?)
- water temp (continuous - analog)
What outputs does the microcontroller need to handle in a washing machine?
- display on control panel
- heater, water valves (on/off - digital)
- motor (may appear analog but usually digital using pulse width modulation)
What else does the microcontroller need to handle in a washing machine?
- timer to control washing programme
- memory for program and variables, clock generator, logic to start machine up correctly.
What are digital inputs/outputs?
Either 0 or 1 , i.e. on or off.
What are analog inputs/outputs?
Continuous.
What is cheaper digital or analog?
Digital
What do we need inside a microcontroller?
- Arithmetic logic unit (ALU) - performs arithmetic and other manipulations on data.
- Memory for program - must be non volatile (retain program even when power is switched off). - read-only memory (ROM).
- Memory for data - may be volatile - random access memory (RAM)
- Communication with outside world - input and output ports - may need to handle digital and analog signals.
- Clock - to keep all parts synchronized.
- Instruction decoder
Can you draw the diagram connecting all parts of a microcontroller together?
YES OR NO
Name some examples of peripherals that may be used in a microcontroller?
- timers
- watchdog timer (WDT)
- Interrupts
- analog/digital converter
- control of reset & start up
- interfaces (serial, USB)
- Data EEPROM (electrical eraseable programmable memory)
How is memory in a computer just like a tall stack of pigeonholes?
There may be several stacks of different types of memory. Each pigeonhole is identified by its ADDRESS which is a serial no. starting from 0.
What does the address point to?
A memory location (register)
When we communicate with memory what do we need to handle?
Both the data and the address
How is data transferred between memory and the rest of the system?
Using BUSES - shared sets of wires that join the components, something like a multi-lane highway.
What are the different types of buses and their responsibilities?
ADDRESS BUS - carries address (serial number) of pigeon hole
DATA BUS - carries byte either from the memory (READ OPERATION) or to the memory (WRITE OPERATION)
CONTROL LINES - are also needed to synchronize timing, select READ/WRITE, ensure only one device tries to use the bus at once.. IGNORE!
Can you draw the diagram relating the buses to memory, cpu and other devices for a PC?
YES OR NO
Whats the difference between a PC and mC?
In a PC the memory and devices are EXTERNAL (on the motherboard) so the buses come outside the processor. In a mC everything is usually within a single integrated circuit.
What are the two types of memory?
Volatile and non volatile
What is volatile memory?
The contents are lost when power is removed, commonly known as RAM -> random access memory. Used for variables (not many).
What is non volatile memory?
Contents retained even when power is removed. ROM - read only memory. Used for program.
Why are RAM and ROM names obsolete and misleading?
- Access to both RAM and ROM is equally random.
- Most modern ROM is a type called FLASH, which can be written and erased (although the process is much slower than with RAM).
What is good about flash memory (or EEPROM)
It can be written and erased electrically which is much more convenient and enables updates to be distributed to the end user.
What type of memory is in a PC?
Almost all memory in a PC is RAM. Each program must be read into RAM from non-volatile memory (usually disk) whenever it is needed. Similarly the operating system must be loaded into RAM whenever the system boots.
What type of memory is in microcontrollers?
Microcontrollers execute only one program which can therefore be stored in ROM and it available instantly.
What is harvard architecture?
Volatile and non-volatile memory are treated as two separate memory systems. Each has its own data and address bus. This is the architecture most common in microcontrollers.