Microcontroller concepts Flashcards

1
Q

What is the hosting application/hardware setup of a MCU?

A
  1. Power Supply
  2. Oscillator
  3. Programmer (+debugger)
  4. Most applications also need peripherals
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

Datapath

A

Datapath is a collection of registers (fast memory) and a set of microoperations on the data

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

Control

A

Directs the ordered execution of the microoperations, to get the desired transformation

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

How many buses do normal systems have?

A

3 Buses:
- Data holds the data itself
- Address indicates where to store (or read) the data
- Control specifies how the data is transported

Width of the buses specifies the amount of data that can be transferred in 1 clock cycle

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

What are the steps comprised in an instruction cycle?

A

Fetch: retrieve instructions from memory and save to IR (Instruction Register)

Decode: Extract the operation code from the instruction and decode it

Execute: Perform the sequence of steps necessary to execute the instruction

Next: Adjust value of PC (program counter)

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

What is RAM and what are some of its features?

A

Random Access Memory

  • Normal RAM is volatile and loses information without power.
  • Often used for changing data (e.g. variables)
  • Fast
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

What is ROM and what are some of its features?

A

Read Only Memory

  • Non-volatile memory
  • Used for code
  • Limited number of write cycles
  • Typically slower than RAM
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

What is the goal of a program? What are some metrics for memory?

A

Execute as quickly as possible

Metrics:
- Access time
- Storage capacity

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

What is the benefit of having multiple buses that access the same memory?

A

It means that the memory point can be accessed simultaneously and you don’t have to wait for the bus to become available (this reduces latency)

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

What is the benefit of using STM32Cube?

A

STM32Cube generates all initialization code automatically

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

How does RAM differ from a register file (RF)?

A

RAM is typically larger (storage size)
RAM stores data using a bit storage approach

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

What are the differences between Register files (RFs), SRAM and DRAM?

A

RF:
- Fastest
- Biggest Size

SRAM:
- Fast
- More compact than RFs

DRAM:
- Slowest (& refreshing takes time) Refreshing is the regular reading of something then writing it back to avoid dissipation
- Very compact

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

What size items should be used for RFs, SRAM and DRAM?

A

RFs - small items

SRAM - Large items

DRAM - Huge items (DRAM’s big capacitor requires special chip design process)

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

What is cache?

A

Small fast memory, that temporarily holds copies of block data

~10x faster than main memory

if instructions are present in cache, they can be executed much faster

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

Explain Cache hit & Cache miss?

A

When a piece of data is required, the cache is checked first. If:
- The item is found, there is a cache hit & the data is retrieved.
-The data is not found, there is a cache miss and the item must be obtained form the main memory. The complete block containing the word is then brought into the cache to avoid a miss next time

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

How can you limit the CPU workload of controlling I/Os?

A

Use peripheral processor to offload some of the tasks

17
Q

What does the data exchange of peripheral processors look like?

A
  1. Periph <-> CPU:
    CPU reads/writes all data to peripheral processor, which handles the I/Os
  2. Periph <-> Memory
    Peripheral processor may directly access memory and load/store data directly
  3. Periph <-> Periph
    Peripheral processor may directly communicate with other peripherals over the system bus
18
Q

Computation of timer prescalers?

A
  1. Determine input clock frequency that is fed into the timer
  2. Define the desired frequency
  3. Calculate prescaler value: input clock frequency/desired frequency
  4. Choose closest available prescaler setting e.g. 1,2,4,8,32,54,256 etc. basically the number of bits)
19
Q

What is polling? Drawback?

A

Constant checking for the occurrence of an event

Time-consuming and requires change in focus from the foreground task

20
Q

What are interrupts used for?

A

Interrupts handle asynchronous events (e.g. timer ticking, keyboard/button press)

They are triggered by hardware or by specific software conditions

20
Q

What is an interrupt and how does it differ from polling?

A

Using interrupts means you do not repeatedly check for the occurrence of an event.

Instead, when the event happens, we allow it to disrupt the program and force something to happen.

Analogy: Phone call. You are forced to decide to ignore it, answer it, or decline

21
Q

What happens after an interrupt is triggered?

A

The CPU stops executing the current code and jumps to an ‘Interrupt Service Routine’ (ISR)

Interrupts do not return anything and variables can’t be passed to them

22
Q

What does an interrupt consist of?

A
  1. Interrupt event and source
  2. The interrupt handler
  3. The interrupt service routine (ISR) is called by the interrupt handler

Once ISR is executed, MCU jumps back into the code

23
Q

What is masking in the context of interrupts?

A

If you have multiple interrupt lines grouped together, you can specify which ones can generate an interrupt

24
Q

What are the options when you have multiple interrupts?

A

2 ideas:

  • Interrupt nesting: Interrupt the first interrupt to execute the second one
  • Tail-chaining: Finish processing the first interrupt before beginning on the second one
25
Q

What are the benefits of low power modes?

A

Increased battery life (mobile applications)

lowered power consumption (stationary applications)

26
Q

Compare power optimization and clock frequency?

A

In low power mode:
- Very slow clock frequency (100kHz)
- Very energy efficient

Normal running mode:
- Full speed (80MHz)
- Not very energy efficient

27
Q

Name some low power modes?

A
  • Shut down
  • Stop
  • Standby
  • Sleep
  • Low power sleep
28
Q

Features of sleep & low power sleep modes?

A
  • CPU is stopped
  • Peripherals and DMA can still work
  • Can wake up CPU with an interrupt
29
Q

Until what stop mode can GPIOs be used?

A

Until stop 2 mode

30
Q

4 components of the task interaction model

A
  • The information (data or signals being moved)
  • The place (from which the info is moved from and to)
  • Control and synchronization
  • Transport mechanism (physical means by which it is moved)
31
Q

3 types of direction of flow

A
  • Simplex: information being sent in one direction only
  • Half Duplex: Information being sent in both directions but only one at a time
  • Duplex: Information can be sent in both directions simultaneously
32
Q

4 ways to relay a message

A
  • Unicast (point-to-point)
  • Broadcast (message sends same info to all components e.g. ‘Reset’)
  • Multicast (Single sender transmits to reduced subset of receivers)
  • Anycast (Message to one recipient from a group of messengers)
33
Q

Types of transport mechanisms

A
  • Ring
  • Star
  • Bus
  • Line
34
Q

Interconnect architecture of a Star

A
  • Master-slave arrangement
  • Slave-to-slave communication must go through the master (middle node)
  • Master initiates and directs everything in the system
  • Master is single point of failure (communication continues if slave fails, but not master)
  • Example: USB (Star-bus)
35
Q

Interconnect Architecture: Ring (Daisy Chain)

A
  • No bus master (all considered equal)
  • Each device has unique address
  • Message arrives, if addressed to me I read it. If not, I pass it on to the next device
  • In theory only needs 1 receiver, and 1 transmitter
36
Q

Interconnect Architecture: Parallel Bus

A
  • Each device connected on a single cable (line)
  • May or may not be a bus master
  • All have unique addresses
37
Q

Which architecture has the highest bandwidth?

A

Star