Microcontrollers & Microprocessors: Architecture, Memory, and Communication Protocols

0.0(0)
studied byStudied by 0 people
0.0(0)
full-widthCall Kai
learnLearn
examPractice Test
spaced repetitionSpaced Repetition
heart puzzleMatch
flashcardsFlashcards
GameKnowt Play
Card Sorting

1/31

encourage image

There's no tags or description

Looks like no tags are added yet.

Study Analytics
Name
Mastery
Learn
Test
Matching
Spaced

No study sessions yet.

32 Terms

1
New cards

What are 2 similarities between Microcontrollers and Microprocessors?

Both have a CPU and act as the brain of electronic devices

2
New cards

What are 2 differences between Microcontrollers and Microprocessors?

Microcontroller has CPU, RAM, ROM/Flash memory, timers and I/O ports on a single chip, while microprocessors only contain CPU.

3
New cards

Why are microcontrollers well-suited for embedded applications compared to microprocessors?

They already have memory, I/O, and peripherals internally so they require fewer external components which results in smaller size, lower cost, lower power consumption

4
New cards

Which architecture does the ATmega328P use ?

Harvard, because it's faster, predictable, reliable, and efficient

5
New cards

What is volatile Memory?

Memory that loses its data when power is removed, SRAM, DRAM, CPU registers and cache memory

6
New cards

What is Non-Volatile Memory

Memory that retains data even when power is turned off, Flash Memory, EEPROM, ROM, Hard drives, SSDs, SD cards

7
New cards

What is the purpose of the program counter?

To hold the memory address of the next instruction to be executed

8
New cards

What is the purpose of DDRx (Data Direction Register)

Controls whether each pin on port x is an input or output

9
New cards

What is the purpose of PORTx

It drives the Output HIGH or LOW, and is the Pull-up control for Input

10
New cards

What is the purpose of PINx

Used to read the value on each pin of port x

11
New cards

What is an Interrupt?

An interrupt is a signal that temporarily stops the normal execution of a program so the CPU can quickly respond to an important event.

12
New cards

What role does the interrupt flag play?

The interrupt flag is a bit (usually inside an interrupt-related register) that indicates an interrupt event has occurred and is waiting to be serviced.

13
New cards

Why must variables shared with ISRs be declared volatile

An ISR can change them behind the compiler's back, and volatile ensures the main program always sees the correct value

14
New cards

When would I choose an external interrupt instead of a pin change interrupt?

Use an external interrupt when you need precise, fast, edge-controlled triggering on a specific pin.

15
New cards

What are 3 timer modes supported by ATmega328P

Normal Mode, Clear Timer on Compare Match, and Fast PWM Mode

16
New cards

When would you use CTC mode instead of Fast PWM mode?

Use CTC mode when you want accurate timer-based interrupts or timing control.

17
New cards

What timer mode and ISR would you use if you wanted to make a system with a counter incrementing every 1ms.

CTC Mode

18
New cards

Why should ISRs be kept short

ISRs should be short to prevent blocking the main program, avoid missing interrupts, reduce latency, conserve stack space, and keep the system predictable.

19
New cards

In Fast Mode 3: What determines duty cycle and frequency of a PWM signal?

Frequency = CPU clock/(prescaler *(255+1)

Duty Cycle = (OCRnX+1)/(256)

20
New cards

In Fast Mode 7: What determines duty cycle and frequency of a PWM signal?

Frequency = CPU clock/(prescaler*(OCR0A + 1)

Duty Cycle = (OCRnX +1) / (OCR0A +1)

21
New cards

What are the steps of a single ADC conversion on ATmega328P

Set MUX bits, Set REFS0/REFS1, set ADPPS2:0 in ADCSRA, Set ADEN, set ADSC

22
New cards

What does the ADC prescaler control

The ADC prescaler divides the system clock (16 MHz on ATmega328P) down to create the ADC clock.

23
New cards

Why is it beneficial to trigger ADC using interrupts?

Avoids blocking, ensures consistent sampling, makes data handling cleaner.

24
New cards

How many lines does SPI use?

MOSI, Sends data from master to slave

MISO, Sends data from slave to master

SCK, Clock generated by master

SS, Selects which slave is active

25
New cards

Why does SPI tend to be faster than I2C?

SPI is faster than I²C because it uses full-duplex communication, avoids addressing/start-stop overhead, allows higher clock speeds, and has a simpler hardware protocol.

26
New cards

Baud Rate Definition

The number of signal changes (symbols) transmitted per second over a communication line. 1 baud = 1 bit per second

27
New cards

Why does mismatched baud rate cause errors?

Causes timing errors → bits misread → frame errors → corrupted data

28
New cards

What are start and stop bits

Start bit: Signals receiver to begin sampling.

Stop bit: Ensures receiver can detect the end of a byte and prepare for the next.

29
New cards

How many wires are required for UART?

2, TX (Transmit) and RX (Receive)

30
New cards

What is the purpose of bit-shifting when working with communication protocols

Bit-shifting is essential in communication protocols for:

1. Packing/unpacking multiple values into bytes

2. Extracting or masking specific bits

3. Serial bit-by-bit communication

4. Manipulating control or status registers

It allows precise control over data at the bit level, which is the foundation of all digital communication.

31
New cards

Name three factors influence microcontroller selection for a project?

Processing Power/Performance, Memory and Storage Requirements, Peripherals and I/O Needs

32
New cards

Examples where ATmega328P is Not a good choice

High Performance image processing or real-time video