; square wave generation
; standard 8051, 12MHz XTAL
; 1KHz square wave on P1.0
; Timer 0, 16-bit mode
ORG 0H
PORT EQU P1
PIN EQU P1.0
START: MOV PORT,#00000000B
MOV TMOD,#00000001B
MAIN:
LCALL SQUAREWAVE
SJMP MAIN
SQUAREWAVE:
SETB PIN
ACALL DELAY
CLR PIN
ACALL DELAY
RET
DELAY:
MOV TH0,#0FEH
MOV TL0,#00CH
SETB TR0
here: JNB TF0,here
CLR TR0
CLR TF0
RET
END
Related topics:
8051 Program - 2khz square wave | 8051 Program - 10khz square wave | 8051 Program - pwm | 8051 Program - sine wave | 8051 Program - triangular wave | 8051 Program - sawtooth wave | 8051 Program - stair wave | 8051 Program - memory subroutines | 8051 Program - math subroutines | 8051 Program - conversion subroutines
List of topics: 8051
No comments:
Post a Comment