Microcontrollers (Week 1 -2) Flashcards

1
Q

What is a microcontroller?

A

A microcontroller is like a tiny computer on a single chip.

It combines:
A microprocessor (CPU)
Memory (RAM and ROM)
Input/Output (I/O) ports
Other components (like timers and A/D converters)

So instead of having these parts separately, a microcontroller packs them into one chip.

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

What features can a microcontroller have?

A

It has input and output (I/O), its how it communicates with the outside world.
- Serial/parrallel ports to talk to other devices
- timers
- A/D converters (analog to digital) to read signals like light and temperature

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

Central Processing Unit (CPU), and what does it consist of?

A

A multifunction math
engine that takes commands stored in memory and uses them as an instruction list to accomplish tasks.

it consists of a control unit, an arithmetic and logic unit (ALU), and registers.

  • A group of registers is used by the CPU to hold internal
    data temporarily, while instructions are being executed
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

What is an embedded controller? And what are its major functions? *hint: there are 4 major functions

A

small computer (usually a microcontroller) that runs a specific task inside a device.
- detect or plan an event (It can sense things happening like a button being pressed or temperature rising. Or it can set something to be done at a particular time)
-Decide how to respond. (like after detecting an event it can choose an action to take)
-Report and control (It might display info (like a number on a screen), or send a signal to another part of the system (like turning on a motor).)
-Keeps accurate time (It needs to measure time precisely — to trigger events, run timers, or delay actions.)

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

Register

A

A digital location for holding temporary data,
instructions or addresses

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

Memory

A

used to hold instructions and data

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

Line I/O

A

Input and output functions. It allows data to be transferred to and from the microcontroller.

A physical wire or connection point on a microcontroller
Each I/O line/pin can act as:
Input: to read data (e.g., from a button)
Output: to send data (e.g., to turn on an LED

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

What is a timer

A

A digital memory location that gets updated or counted at predetermined times

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

System clock

A

It sends out a steady pulse (or beat) that tells the system when to perform the next operation.Every instruction the microcontroller runs is synchronized to this clock.

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

Control unit

A

determines the timing and sequence of
operations

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

Arithmetic and logic unit

A

the ALU is basically a Boolean math engine that performs math functions on binary numbers

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

What is a bus

A

Its a shared set of communication lines that all the major components of the microcontroller use to send a receive information. (Basically connects everything together)

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

What is a data bus

A

Carries the actual data (words) betwwen compents. CPU<–> memory, CPU<–> I/O devices. ( To and from data register, which means your wither giving the CPU data to use - loading it into the the resiger so the CPU can analyze it- or your takibf the data that was stored in the register.)

these words can be different sizes (4,8,16,32,64 bits).
*each bit needs its own wire so a 16 bit data bus will have 16 wires.

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

What is an adress bus

A

This selects which device or memory location to talk to. Only one address may be accessed at a time. (Specifies the location)

**its usually wider than the data bus so the system can access more memory (addresses). Its ually twice the width of the data bus.

Example: 15 bit address bus can access 2^16 = # locations. (The bus can point to any of these locations but it must be one at a time). these are all memory locations

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

Control bus

A

Tells when/how to act. It carries control signals like read or write, clock signals, interrupt signals, and these signals tell the system what to do with the data.

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

Question: What would an 8–bit word size(data bus), and a 10 bit-adress bus look like?

A

Adress bus = 2^10 locations EX (0000000000)
-Limits the amount of memory locations you can access

Data bus=Each data value is 8 bits long EX (01001001)
- limits the amount of data you can transfer at a tiem

At each address you can store 8 bits of data

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

What happens if you want to store a number that has more bits the microcontroller can handle at a time?

A

Exampple: If you have an 8 bit microcontroller and want to store 16 bits you can break it up into two 8 bit pieces.

break into:
High-order byte: The big part of the number (like if 409 was the number, four would be the big part)
Low order byte: The small part of the number (the 9 part).

These are stored In two seperare Memory addresses back to back.

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

Memory

A

Memory is where the system stores binary data — this can be:
-Program instructions (the code you wrote)
-Numbers or sensor values used by your program

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

How to know the size of the memory?

A

The width of the address bus determines how many unique locations the CPU can access.

16
Q

Memory Type: ROM (Read only memory)

A
  • Perminate storage
  • Can only be read
    -They keep their memory when power is removed
  • The program (or instructions) stored in ROM is permanent and doesn’t change
16
Q

What is a memory cell

A

Memory cells are essentially large numbers of storage cells with each cell capable of storing either a 0 or 1 bit

Multiple bits are grouped into a “word” — the size of the word depends on the data bus (e.g., 8-bit word).

17
Q

Memory Type: PROM (Programmable ROM)

A
  • Rom chip that can be programmed by user(It comes blank)
    -Once it is written it becomes permanent like a regular from
    -Each memory cell has a tiny fuse that initially keeps it at 0. To change it to 1, you “burn” the fuse with an electric current. Once a fuse is burned, it can’t be undone, meaning you can’t reprogram it later.
18
Q

Memory type: EPROM - Erasable and programmable ROM

A

-You can write data onto it
- you can erase this data and reprogram it
-Each cell can hold a charge (representing a 1) or no charge (a 0). To delete the data, you shine ultraviolet light through a quartz window on top of the chip. This resets all memory cells back to 0.

18
Q

Memory Type: EEPROM - Electrically Erasable PROM

A
  • can write data onto iy
  • can ersae it by applying a high voltage
18
Memory Type: FLASH
- can write data onto iy - can ersae it by applying a high voltage - Addressed by blocks (not individual words): Data is read/written in chunks or blocks, not one word at a time. This makes operations faster and more efficient, especially when writing or erasing lots of data. -Lower power consumption + more write cycles: More energy-efficient than earlier ROM types. Can be written and erased many more times than EEPROM, making it great for long-term use.
19
Memory Type: RAM: Random Access Memory
- Can be read or written to -Holds data temporarily -Once power is removed, the data in the memory is lost
20
Firmware
Programs stored in ROM
21
Software
Programs stored in the RAM. software (program) is originally stored somewhere else (like a hard drive, SSD, or Flash memory), and it has to be copied into RAM (working memory) before the CPU can run it.
22
What are peripheral Devices?
Devices connected to the system that send input (Like a keyboard) or receive output (Liike a display or motor) They connect to the I/O ports on a microcontroller
22
Input/output operations (I/O)
Transfer of data between the CPU and the outside world. (for example sensors, buttons, displays, etc)
22
What is an interface cirucit
It manages the communication between the CPU and peripheral devices. This is important because devices may operate at different speeds than the CPU. On input, data from the peripheral is stored in a temporary location (Buffer) then the CPU reads it. On output the CPU sends data to the buffer and the peripheral reads it from there
22
Digital I/O
Digital I/O ports are connected to internal registers in microcontrollers. They recognize two states: High(bit =1), Low(bit=0). ANd do what its meant to do at that state if you need more ports you can add a multiplexer
22
Multiplexers (MUX)
You can add to get more I/O lines. It can take many inputs but only one Is read by the microcontroller at a time. Potential Errors Crosstalk: One signal bleeds into another Voltage error: The output signal may not perfectly match the input signal
23
GPIO Pins
pins on a microcontroller that can act as either input or output. When it acts as input: Microcontroller reads theater the pin is High (1) or low (0)' When used as output the microcontroller sets the pin to High or Low
23
Pull up/ Pull down Resistors
If the GPIO pin is an input it could randomly pick up on noise and accidentally switch between High and Low, which we obviously don't want, when nothing is connected to it. To stop this we use: Pull Up resistor- A pull-up resistor is used to keep a GPIO input pin at a default HIGH voltage (like 3.3V) when nothing is connected, preventing it from randomly floating. When a button or signal connects the pin to GND, it overrides the resistor and pulls the pin LOW. Pull down reistor- connects the pin weakly to ground. So it stays low unless something pulls it high.
24
Serial I/O
it sends data one bit at a time between devices. It uses at least two I/O pins (transmit and receive, TX and Rx)
25
Analog to digital converter (ADC)
Analog to digital converter (ADC). Take an analog input voltage signal (between 0 and vcc) and converts it into a digital number (like 8 bits). Most microcontrollers have a few of these converters Analog means voltage range btw Digital side specified in terms of the number of bits of its register An M-bit ADC means the digital output will be M bits log THE ADC can produce 2^M different values EX: An 8-bit ADC can represent 2⁸ = 256 levels. These levels define how precisely it can measure the voltage—it breaks the voltage range into 256 small steps.
26
Quantization
Quantization is the process of dividing the full analog voltage range into a set number of fixed levels so that the continuous signal can be represented by discrete digital values, with each level corresponding to a specific output from the ADC. Each level gets a digital number. Whatever level the input voltage fits into is the number the ADC outputs. Okay so bascially there is a voltage range. There is an 8 bit ADC so 256 levels so the voltage range gets split into those levels. Each level is assigned binary digits. Whiever level the voltage is it will get assigned those binary gits and that will be the output. Sorry I got confused so I explained it alot
27
Resolution
Smallest voltage change the ADC can detect More levels mean the voltage is divided into smaller steps so the AC can detect smaller changes in voltage -- so it has more resloution
28
Quantization error
This error is presnted because of limited resolution. The actual input may fall between two levels and the ADC has to pick the closet level so which introduces small differences between the analog to digital representation
29
Saturation Error
ADC can only handle voltages within a specific range and if it goes above or below this range the ADC cant measure it correctly. Instead it just outputs highest or lowest possible level -- called saturation.
30
Conversion Error
Settling time, signal noise, temperature effects, power fluctuations; basically machine factors and external conditions.
31
ADC type: Successive Approximation ADC
Uses trial and error for estimating the input voltage. It guesses different binary values for the voltage. Each guess is 1. stored in an M-bit register 2. Turned into analog signal 3. compared with the real input voltage Real steps 1. Start with the most significant bit. Set the first bit to 1 and the rest to 0. COnvert that to voltage. Compare that with with actual input. if too high -> reset the bit to 0, if its below keep the bit at 1. 2. move to the next bit. try setting at one and do the same thing 3. do this till the least significant bit Facts: More bits = better accuracy but slower Electrcial noise can mess up the accuracy input voltage must be constant because if it changes mid process the result will be inaccurate so they use SHC (sample and hold circuit) to hold input stead during the conversion process. ESP 32 uses this one
32
ADC Type: Ramp converters
This is another type of ADC. It works by slowly increasing a voltage signal. It then compares the rising voltage to the input analog voltage until they are equal. Refrence signal starts at zero and is increased at set time steps. At each time step the ramp is compared with the input voltage. The number of steps it rook Is the digital representation
33
ADC type: Dual Ramp Converters
USes a charge and discharge cycle. The time required to return back to zero is measured. - Most accurate: accuracy depends on how stable the reference voltage and counter are. - Its a slow converter
34
ADC type- Parrallel or flash converters
Fastest ADC type An M-bit parrallel converter uses 2^(M+1) separate voltage comparators to compare a reference voltage to the applied input voltage
35
Pulse Width Modulation (PWM)
Analog output is approximated using PWM. PWM rapidy cycles a digital output on and off very fast, so its never fully on or off. The average voltage over time can act like an analog voltage signal. PWM is determined based on how long the output is high (on) for during one period. Varying the duty cycle changes the voltage