Quiz 2 Topics Flashcards
Cooperative Multitasking
the threads/tasks decide which tasks to do and for how long (this means potentially one task could run forever and prevent others from ever running)
Preemptive Multitasking
the OS decides which tasks to do and for how long. Run by the scheduler, based on time and priority
Scheduler Issues (timing of tasks and switching between them)
must consider the time it takes to switch between tasks.
if time to run tasks is small - waste time switching too often
if time to run tasks is large - slow response
Threads
a function that runs inside of a program/process that shares memory with that process
every process has at least one thread but it can have multiple threads of different priorities
Real Time OS
special operating system designed to give reliable timing.
minimizes task switching time
Semaphore vs Queue
semaphore - thread safe, signals between tasks
queue - thread safe, passes data between tasks
using vTaskDelay (or similar) vs dummy loops to burn time
vTaskDelay type functions allow the OS to use the ‘dead time’ to do something else, where as dummy loops just waste it.
D/A converter
how to calculate its resolution
summing op amp
resolution =voltage range/[ (2^number of bits)-1]
A/D converter - Single Slope
uses an integrator (to integrate reference voltage function), compares the measured value to the integrator output - records the time when those values are equal
very accurate, not as fast
used in multimeters
A/D converter - Flash
uses big voltage dividers, compares measured value with each node in the voltage divider
very fast, limited resolution
A/D converter - Successive Approximations
uses output from D/A converter (makes a guess) and compares to measured value. keeps “guessing” until it gets close enough to the input.
Digital Input
discrete values, typically uses a voltage level of 0 to 5V
Digital Input
discrete values
source - output a voltage, processor supplies power
sink - ground when switch is closed, requires external power
Analog Input
unipolar and bipolar
continuous range of values
unipolar = 0 to +V bipolar = -V to +V
use an opamp to amplify a small signal
use a voltage divider to decrease a large signal
Analog Output
continuous range of values
also output using pulse width modulation
amplify using a power transistor