March Test Flashcards
What did Arm design the Cortex-M series to be?
Whats the M stand for?
Low-cost and energy efficient
Microcontroller
What are the M4 and M0 designed for?
Whats special about the M0+?
M4: high performance, general use
M0: low-cost, simplicity
M0+: most energy efficient
Whats the F in M4F stand for?
Whats it good at doing? Two things
Built-in floating-point unit (FPU)
Designed to do well with floating-point numbers
Does them in one clock cycle
Has a DSP so good at digital signal processing
Why is power loss small in CMOS?
There isn’t a static current path from Vdd to Vss so static power consumption is low
What can cause power loss in CMOS?
Three things
When output switches, it will either charge or discharge the gate capacitence
During output transition a short circuit can occur between Vdd and Vss
Leakage current while transistor is off
4 ways to reduce power consumption in a CMOS circuit
Lower frequency-however this is a a trade-off between power and performance
Lower amount of gates
Lower activity-i.e. when circuit not used it is powered down
Lower supply voltage. K46F can work down to 1.7V
What is a task?
Two types of tasks
An activity that is required to be performed-read a sensor, update a display etc
Event-triggered tasks: i.e. light an LED when a button is pressed
Time-triggered tasks: i.e. reading a sensor every 1 second
Responding to event triggers: polling
Edge-triggered interrupts
What to remember about the ISR
Repeatedly checking the status of an input
When voltage change on input is detected, the program goes from sleep to execute a interrupt service routine (ISR) then back to sleep
Keep code inside the ISR as short as possible
Hybrid approach to event triggers
Why do this?
Set a global flag variable in the ISR. When the program comes out of sleep it check the flag and then does the code
ISR can still be short
Time-triggered task: two ways to do it
Sleep modes: two types
Periodically: ticker
One-off event: timeout
Sleep: clock stopped until reset or interrupt occurs. Can be woken by internal or external interrupt
Deepsleep: can only wake up with external interrupt
5 things that make up a finite state machine
States that the system can exist in Finite set of inputs Finite set of outputs State transitions (what happens when we are in a state and get a certain input) How outputs are determined
How to define a state? (what to write inside the circle)
Name (often a number)
Output state
Wait time for how long it will be in state
Using transition tables and structs with FSM’s
Revise
I^2C: whats it stand for
How’s it work
Two types of wires, what is required with them
Inter-integrated circuit
MCU is master, sensors are slaves
Multiple slaves can be connected to same bus
Data (SDA), clock (SCL)
Lines are open-collector meaning that pull-up resistors are needed
I^2C: how many pull-up resistors are needed?
How many slaves can be on the same bus in theory?
And in practise
One for each line
Each slave has a 7-bit address so 127 slaves (address 0 is a general call address to all slaves)
In practise numbe of devices are limited by capacitive loading of lines