; triangular wave generation
; standard 8051
; 8-bt DAC interfaced on P1
ORG 0H
PORT EQU P1
START: MOV PORT,#0
MAIN:
LCALL TRIANGULARWAVE
SJMP MAIN
TRIANGULARWAVE:
MOV R7,#00H
up:
MOV P1,R7
INC R7
CJNE R7,#0FFH,up
MOV R7,#0FFH
down:
MOV P1,R7
DJNZ R7,down
RET
END
Related topics:
8051 Program - 1khz square wave | 8051 Program - 2khz square wave | 8051 Program - 10khz square wave | 8051 Program - pwm | 8051 Program - sine 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