Microcontrollers (Week 1 -2) Flashcards
What is a microcontroller?
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.
What features can a microcontroller have?
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
Central Processing Unit (CPU), and what does it consist of?
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
What is an embedded controller? And what are its major functions? *hint: there are 4 major functions
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.)
Register
A digital location for holding temporary data,
instructions or addresses
Memory
used to hold instructions and data
Line I/O
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
What is a timer
A digital memory location that gets updated or counted at predetermined times
System clock
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.
Control unit
determines the timing and sequence of
operations
Arithmetic and logic unit
the ALU is basically a Boolean math engine that performs math functions on binary numbers
What is a bus
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)
What is a data bus
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.
What is an adress bus
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
Control bus
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.
Question: What would an 8–bit word size(data bus), and a 10 bit-adress bus look like?
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
What happens if you want to store a number that has more bits the microcontroller can handle at a time?
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.
Memory
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 to know the size of the memory?
The width of the address bus determines how many unique locations the CPU can access.
Memory Type: ROM (Read only memory)
- 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
What is a memory cell
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).
Memory Type: PROM (Programmable ROM)
- 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.
Memory type: EPROM - Erasable and programmable ROM
-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.
Memory Type: EEPROM - Electrically Erasable PROM
- can write data onto iy
- can ersae it by applying a high voltage