Microcontrollers exam Flashcards

(89 cards)

1
Q

Characteristics of a PC computer

A

Fixed location
Linked to mains power
Extendable buses
Add memory
Add devices

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

Examples of distributed control systems

A

Protection systems
Data housing
R&D
Education

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

What is telemetry

A

Taking data from a distance and feeding it into a computer system

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

Components in a microprocessor

A

CPU - brains of the operation, will be executing the code you have loaded on to it
ALU - optimised to carry out AND/OR/NOT operations
FPCP - optimised to carry out mathematical operations
ROM
RAM
BIOS - low level code (firmware)
ADC
DAC

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

What is RISC and CISC

A

Reduced instruction set computer (microprocessor uses this) - 50/60 instructions
Complex instruction set computer - 500+ instructions

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

Characteristics of microcontroller

A

Small, mobile, standalone, battery powered, fixed, can be embedded

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

Differences between Harvard and Von Neumann

A

VN: Uses one memory unit for both instructions and data
H: Has separate memory units for instructions and data

VN: Uses one set of buses for both instructions and data
H: Has separate buses for instructions and data

VN: Commonly used in general purpose computers
H: Commonly used in embedded systems (e.g. digital signal processing)

VN: Enables a more flexible use of main memory, enabling the processor to run a variety of programs that aren’t necessarily known in advance
H: For systems with a predetermined use, instruction memory can be implemented as ROM which protects the programs from hacking

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

4 advantages of Harvard

A

⏰️ Instruction and data can be accessed simultaneously
📝 Instruction and data memory can have different word lengths
🤖 Different technologies can be used to implement instruction and data memory
🧑‍💻️ For systems with a predetermined use, instruction memory can be implemented as ROM which protects the programs from hacking

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

Name some microcontrollers

A

Arduino
Raspberry Pi

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

Where is power indicator (1)

A

(2)

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

Where is USB in (1)

A

(3)

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

Board rate =

A

Bits per second

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

Where is DC power in (power supply) (1)

A

(4)

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

draw the diode bridge

A

(5)

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

voltage drop of a diode

A

0.7V

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

(6)

A

Time period = 0.1s
so t = 0.1
r*C = 0.01
7.6e^0.01/0.1

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

Where does the battery go (Vin) (1)

A

(9)

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

draw a zener diode

A

(10) doesn’t have line through the middle

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

draw a circuit for a regulated voltage supply to a microcontroller

A

(12)

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

Draw IV for zener diode

A

(11)

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

(13)

A

Vr = Vin - Vz
Vr = 7-5.1 = 1.9
I = 1.9/100 = 19mA

Power in r = Iz^2 * r
=0.019^2 * 100 = 0.0361W

Pz = Vz * Ir
= 5.1 * 0.019 = 0.0969W

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

identify which is harvard and which is von neumann

A

insert pic

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

Draw SBD for the schematic

A

(13)

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

What is pin 1 used for

A

It is a serial pin for if you did not want to use a USB cable

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
25
(14) write psuedo code using an active low
logic is reversed, 0 means LED on and 1 means lED off
26
draw arduino circuit with a tilt switch
(15)
27
draw LED symbol
(16)
28
what is the forward voltage of bright red and what current does it need to work (17)
2-2.5 20mA
29
Draw an arduino schematic with a mechanical push switch and a capacitor in parallel with the 10k resistor. Calculate the size of the capacitor
(19) C = 0*10^-6
30
Draw schematic with BCD chip integrating a 7 seg display
(22)
31
# 3 write code to read a byte from digital input 0 and then output 0x79 to channel 0
diginByte0 = digitalRead(DI0) digoutByte0 = 0x79 digitalWrite(0, digoutByte0)
32
convert 0x79 to 7 seg display
letter E convert to binary and then apply to 7 seg display
33
what is a masking operation
bitwise AND the byte with a 1 where you are looking at and if the answer is the masking operation = true
34
how do you set a bit in a byte to 1
OR it with a 1 where the bit is and the rest of the byte is 0s
35
how to set a bit in a byte to 0
AND the byte with another byte which has all 1's except a 0 for the bit you want to change to 0 (its complement)
36
draw arduino schematic with a default on three leds with switch
(23)
37
code for a debouncing a push button
digin2 = read_digin(2) If digin2 ! = to old_digin2 then Wait 50 //wait 50 ms for signal to settle to avoid multiple triggers End if old_digin2 = digin2
38
draw a schematic using a relay output
(24)
39
draw a schematic with a 7 seg display
(25) with a matched resistor (need to calculate) and ground it
40
draw a schematic with a 7 seg display and a bcd
(21)
41
if ABCD on the BCD chip is allocated pins 2,3,4,5 then write the code to display the number 2 on the 7 seg display
digitalWrite(2,Low) digitalWrite(3,High) digitalWrite(4,Low) digitalWrite(5,Low) as a byte: Digout && 11110010
42
what does this mean (26)
there are 4 wires in this cable
43
(27)
(28) Pseudocode: (29)
44
If something is called a swittch it is
digital
45
sensors and transducer's are
analogue
46
what is a transducer
takes one signal and converts it into another e.g. converts 0-100 degrees to 0-5V
47
draw an arduino schematic with an analogue input (potentiometer)
(30)
48
current vs voltage signals sensors
current signals: wires can be as long as possible much more expensive
49
draw a variable resistor draw a light dependent resistor
(31)
50
pseudocode for reading analogue signal
int sensorVal = analogRead(A0)
51
write pseudocode if you have a temperature sensor which is 0-5 V = 0 - 100 °C,
rawTemp = readAnin(0) // reads in a bit value from the analogue input A0 realTemp = rawTemp * (100/255) // scale the bit value to a temperature in deg C
52
resolution for analogue to digital scaling =
range/255
53
write pseudocode using a deadband for a window opener
If realTemp > 24 then // if its too hot open a window openWindow Else if realTemp < 22 then // put a 2 deg C deadband around the switching closeWindow End if
54
analogue vs digital
analogue represents the real world better digital will always suffer from sample and hold quantisation errors
55
why are there no analogue outputs on an arduino
driving AO takes a lot of power It makes the board more expensive and complicated
56
scaling from digital to analogue if drive = 20%
*Reverse calc for inputs *If the drive to a motor is 0-5V for 0-100% drive *If the DAC is an 8 bit device *Then if the code wants to output 20% (=1V) *SpeedOut = 20 *AnalogOut = (20/100)* (2^8 -1) = 51
57
symbol for a motor
(32)
58
(33)
5V = 255 bits 3V = 253 * 0.5 = 153 bits motorspeed = 0 void loop() { delay(1000) /1s motorspeed = motorspeed + 1 anoutWrite(0) = (motorSpeed/100)*153
59
What is pulse width modulation
Modulating the width of a pulse to give quasi analogue control
60
what is a pulse
when something goes high low high low...
61
what happens when you increase the width of the pulse. include diagram
letting the motor see a higher analogue input because it is integrating between the pulses as the speed of the pulses is faster than the reaction time of the motor (33)
62
PWM has a
fixed frequency
63
speed when mark:space ratio is 100:0
100%
64
speed when mark:space ratio is 30:70
30%
65
what % duty cycle is analogWrite(255) on an arduino
100%
66
what % duty cycle is analogWrite(127) on an arduino
50%
67
what % duty cycle is analogWrite(0) on an arduino
0%
68
duty cycle =
mark:space ratio
69
duty cycle is 70% =
70:30 M:S
70
resolution of a shaft encoder
360 / 2^(number of layers)
71
write gray code for 3 bits
000 001 011 010 110 111
72
draw a 3 bit grey code shaft encoder
(34)
73
draw a H-bridge circuit
(35)
74
draw a control system diagram for a heater (negative feedback)
(36)
75
what is hunting
when there is a time delay, it can cause the system to be constantly turning on and off
76
define hysteresis
the dependence of the state of a system on its history. For example, a magnet may have more than one possible magnetic moment in a given magnetic field
77
draw the mechanical hysteresis graph
(37)
78
how to fix hunting
using a deadband
79
what is an open loop
does not have any feedback and therefore cannot correct any changes (unplugging a heater, turning off a tap)
80
what is a closed loop
does have any feedback and therefore can correct any changes
81
(38)
(39)
82
Yorkshire water scenario: explain d1,d2,d3
A radar sensor, set at a fixed height measures the reservoir water level, this is then converted to water depth by knowing the distance to the reservoir bottom
83
draw harvard and von neumann
last photo
84
always on - resitor is ... the switch always off - resitor is ... the switch
up down
85
why would you use a pull up or a pull down resistor
A pull up resistor is used to hold the signal high (+5V) as its default state, a pull down resistor holds the signal low (0V) as its default state
86
What is debounce and why does it happen?
Debounce happens as mechanical switches are imperfect, the ability of the contact to make a perfect connection instantly and hold that connection is not possible due to the surface finish and internal reactive spring mechanism
87
Draw a debounce circuit, including component values for a 100ms time constant
2nd last photo
88
Draw a circuit for a simple analogue input such as a temperature sensor
last photo
89
Suitable resistor values for Switch PTC (thermistor) Led
10k ohms 5k ohms 220 ohms