2. Intro to Microcontrollers Flashcards

1
Q

What inputs does the microcontroller need to handle in a washing machine?

A
  • buttons on control panel (on/off - digital)
  • water level (digital?)
  • water temp (continuous - analog)
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

What outputs does the microcontroller need to handle in a washing machine?

A
  • display on control panel
  • heater, water valves (on/off - digital)
  • motor (may appear analog but usually digital using pulse width modulation)
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

What else does the microcontroller need to handle in a washing machine?

A
  • timer to control washing programme

- memory for program and variables, clock generator, logic to start machine up correctly.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

What are digital inputs/outputs?

A

Either 0 or 1 , i.e. on or off.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

What are analog inputs/outputs?

A

Continuous.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

What is cheaper digital or analog?

A

Digital

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

What do we need inside a microcontroller?

A
  1. Arithmetic logic unit (ALU) - performs arithmetic and other manipulations on data.
  2. Memory for program - must be non volatile (retain program even when power is switched off). - read-only memory (ROM).
  3. Memory for data - may be volatile - random access memory (RAM)
  4. Communication with outside world - input and output ports - may need to handle digital and analog signals.
  5. Clock - to keep all parts synchronized.
  6. Instruction decoder
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

Can you draw the diagram connecting all parts of a microcontroller together?

A

YES OR NO

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

Name some examples of peripherals that may be used in a microcontroller?

A
  • timers
  • watchdog timer (WDT)
  • Interrupts
  • analog/digital converter
  • control of reset & start up
  • interfaces (serial, USB)
  • Data EEPROM (electrical eraseable programmable memory)
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

How is memory in a computer just like a tall stack of pigeonholes?

A

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.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

What does the address point to?

A

A memory location (register)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

When we communicate with memory what do we need to handle?

A

Both the data and the address

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

How is data transferred between memory and the rest of the system?

A

Using BUSES - shared sets of wires that join the components, something like a multi-lane highway.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

What are the different types of buses and their responsibilities?

A

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!

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

Can you draw the diagram relating the buses to memory, cpu and other devices for a PC?

A

YES OR NO

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
16
Q

Whats the difference between a PC and mC?

A

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.

17
Q

What are the two types of memory?

A

Volatile and non volatile

18
Q

What is volatile memory?

A

The contents are lost when power is removed, commonly known as RAM -> random access memory. Used for variables (not many).

19
Q

What is non volatile memory?

A

Contents retained even when power is removed. ROM - read only memory. Used for program.

20
Q

Why are RAM and ROM names obsolete and misleading?

A
  • 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).
21
Q

What is good about flash memory (or EEPROM)

A

It can be written and erased electrically which is much more convenient and enables updates to be distributed to the end user.

22
Q

What type of memory is in a PC?

A

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.

23
Q

What type of memory is in microcontrollers?

A

Microcontrollers execute only one program which can therefore be stored in ROM and it available instantly.

24
Q

What is harvard architecture?

A

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.

25
Q

What is princeton architecture?

A

A single memory system where RAM and ROM are mixed. Architecture almost universal in general-purpose computers, but employed in some microcontrollers.

26
Q

Can you draw a diagram of harvard architecture?

A

YES OR NO

27
Q

Can you draw a diagram of princeton architecture?

A

YES OR NO

28
Q

Why is harvard a more efficient use of memory?

A

Program and data can be accessed simultaneously. Width of address and data buses can be optimised for each memory.

29
Q

What is good/ bad about princeton architecture?

A
  • More versatile, almost universal in general purpose computers.
  • Several bus cycles are needed to get a complete instruction, including the data needed, so intrinsically slower.
  • Like a stack of different coloured pigeon holes - some are RAM and ROM .. needs care! Study the memory map carefully.
30
Q

What was the original purpose of an operating system?

A

To keep track of files on disks (DOS = disk operating system)

31
Q

What to modern operating systems do?

A

Provide a vast range of services to the applications that run on them.

32
Q

Is the key ‘a’ was pressed on a keyboard what would happen (in brief)?

A
  • the operating system reads a byte from the keyboard
  • it informs the application that an ‘a’ has been pressed
  • the application requests that an ‘a’ be drawn on the screen in a particular font at a given location
  • the operating system retrieves the pattern of dots (PIXELS) needed and draws them on the screen to form the character
33
Q

What kind of operating system does a microcontroller have?

A

Usually NO OPERATING SYSTEM at all.

34
Q

What are examples of things you have to do for a microcontroller?

A
  • configure the microcontroller when it starts up
  • make sure your program starts at the right place
  • keep track of your variables and ensure you dont run out of space
  • react to inputs when they occur
  • keep track of different tasks if you have more than one running