8051 Microcontroller Basics, STM32CubeIDE, and Use
8051 Microcontroller Basics, STM32CubeIDE, and Use
CPU
P0 P1 P2 P3 TxD RxD
Address/ Data
Registers used in Timers/counters
▪Two 16-bit Timer Registers: TMOD Register :
▪ Timer 0 & Timer 1. ▪Same TMOD Register for Timer 0 & Timer 1
▪Each 16-bit Timer is divided into two 8-bit ▪It is not Bit Addressible
registers: ▪8 Bit Register :
▪ Timer 0 → TH0 (High Byte) & TL0 (Low ▪ Lower 4-Bits -> Timer 0
Byte) ▪ Upper 4-Bits -> Timer 1
▪ Timer 1 → TH1 (High Byte) & TL1 (Low
Byte) TCON Register :
▪ 8-bit, bit-addressable.
▪TMOD (Timer Mode Register): ▪ Timer & Interrupt Control.
▪ 8-bit register → Selects timer mode. ▪ Main Bits :
▪ TF1, TF0 → Overflow flags.
▪TCON (Timer Control Register): ▪ TR1, TR0 → Timer start/stop.
▪ 8-bit register → Controls timer operations ▪ IE1, IE0 → Interrupt flags.
(e.g., start, stop, overflow). ▪ IT1, IT0 → Interrupt trigger type.
Applications & Uses of 8051
Microcontroller
USART / UART Serial communication pins (TX for transmit, RX for receive).
I2C Data (SDA) and Clock (SCL) lines for I2C communication.
PWM Pulse Width Modulation output pins (for motors, LEDs, etc.).
O/P
Code O/P
4 - led blinking
using stm 32
Code
4 - led blinking
with button using
stm 32
O/P