โ Microprocessors & Microcontrollers learning pathMicroprocessors & Microcontrollers ยท Module 9 of 10
Timers, serial and peripherals
Generating delays, counting and communicating.
๐ Key ideas
- Timers count clock pulses to create delays, measure time or generate PWM.
- PWM (pulse width modulation) controls motor speed and LED brightness by varying duty cycle.
- Serial protocols: UART (2 wires, asynchronous), I2C (2 wires, addressed devices), SPI (4 wires, fast).
- ADCs read analog sensors; resolution is set by bits, for example 10-bit gives 1024 levels.
- Watchdog timers reset the chip if the program hangs.
๐ก Real-life example: PWM is like flicking a light switch very fast: the longer it stays on in each cycle, the brighter the room seems.
PWMVarying duty cycle to control average power
I2CTwo-wire bus for addressed devices
SPIFast four-wire serial bus
Watchdog timerResets the chip if software hangs