HOME
BLOG
ABOUT
FREEBIE
SHOP
CONTACT

At89c2051 Projects -

void init_uart() = 0x20; TH1 = 0xFD; // 9600 @11.0592 MHz TR1 = 1;

Since the AT89C2051 lacks hardware PWM, we generate it using Timer0 interrupt. unsigned int duty = 1500; // 1.5ms center void timer0_isr() interrupt 1 static bit state = 0; if(state == 0) P1_0 = 1; TH0 = 0xFC; // 1ms? Actually calculate for 1.5ms TL0 = 0x18; state = 1; else P1_0 = 0; TH0 = 0xFE; // 20ms - duty TL0 = 0x??; state = 0; at89c2051 projects

Add a push button to increment the count manually. Project 3: Digital Dice with 7 LEDs Difficulty: Intermediate Components: 7 LEDs (arranged like a dice face), 7x 220Ω resistors, 1 push button void init_uart() = 0x20; TH1 = 0xFD; // 9600 @11

Timer interrupts, random number generation, button debouncing. Project 4: Frequency Counter (0-50 kHz) Difficulty: Advanced Components: External TTL signal source, LCD 16x2 (optional via 4-bit mode) Project 3: Digital Dice with 7 LEDs Difficulty:

Read a potentiometer using the on-chip comparator (P3.6 and P1.1) to adjust duty cycle.