Microcontroller concepts Flashcards
What is the hosting application/hardware setup of a MCU?
- Power Supply
- Oscillator
- Programmer (+debugger)
- Most applications also need peripherals
Datapath
Datapath is a collection of registers (fast memory) and a set of microoperations on the data
Control
Directs the ordered execution of the microoperations, to get the desired transformation
How many buses do normal systems have?
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
What are the steps comprised in an instruction cycle?
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)
What is RAM and what are some of its features?
Random Access Memory
- Normal RAM is volatile and loses information without power.
- Often used for changing data (e.g. variables)
- Fast
What is ROM and what are some of its features?
Read Only Memory
- Non-volatile memory
- Used for code
- Limited number of write cycles
- Typically slower than RAM
What is the goal of a program? What are some metrics for memory?
Execute as quickly as possible
Metrics:
- Access time
- Storage capacity
What is the benefit of having multiple buses that access the same memory?
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)
What is the benefit of using STM32Cube?
STM32Cube generates all initialization code automatically
How does RAM differ from a register file (RF)?
RAM is typically larger (storage size)
RAM stores data using a bit storage approach
What are the differences between Register files (RFs), SRAM and DRAM?
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
What size items should be used for RFs, SRAM and DRAM?
RFs - small items
SRAM - Large items
DRAM - Huge items (DRAM’s big capacitor requires special chip design process)
What is cache?
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
Explain Cache hit & Cache miss?
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