Write An 8051 Assembly Program To Generate A 2ms Waveform Wi
Write An 8051 Assembly Program To Generate A 2ms Waveform Wi
50% duty cycle (Square wave generator) on the port pin P1.5. Assume
the clock frequency of 8051 is 12 MHz and use the timer T1.
• Hardware Emphasis
• Less Registers
• Complexity in Compiler
• Software Emphasis
• Pipelining is Easy
Microprocessor vs Microcontroller
Microprocessor
• Just a processor.
becomes large.
Microcontroller
technique.
• On-chip ROM: Stores program code.On-chip RAM: Used for
interval.
• Entry-level processor
• 2-4 cores
• Lower clock speed
• Less cache memory
• Suitable for basic tasks like browsing, office work
Intel Core i5:
• Mid-range processor
• 4-6 cores
• Higher clock speed than i3
• More cache memory than i3
• Suitable for gaming, video editing, and heavy multitasking
Intel Core i7:
• High-end processor
• 6-8 cores
• Highest clock speed
• Most cache memory
• Suitable for demanding tasks like 3D modeling, video
production, and extreme gaming
Example 1: Toggling 55H and AAH on Port 0
BACK: MOV A, #55H ; Load A with 55H
MOV P0, A ; Send 55H to Port 0
ACALL DELAY ; Call delay subroutine
MOV A, #0AAH ; Load A with AAH
MOV P0, A ; Send AAH to Port 0
ACALL DELAY ; Call delay subroutine
SJMP BACK ; Jump back to repeat the process
ORG 0
BACK: MOV A, #55H ; Load A with 55H
MOV P0, A ; Send 55H to Port 0
MOV P1, A ; Send 55H to Port 1
MOV P2, A ; Send 55H to Port 2
ACALL DELAY ; Call delay subroutine
MOV A, #0AAH ; Load A with AAH
MOV P0, A ; Send AAH to Port 0
MOV P1, A ; Send AAH to Port 1
MOV P2, A ; Send AAH to Port 2
ACALL DELAY ; Call delay subroutine
SJMP BACK ; Repeat the process
Delay Subroutine