8051 ASSEMBLY LEVEL CODE TO GENERATE SQUARE WAVE OF FREQUENCY 1kHz


//ASSUME DUTY CYCLE 50%
//ASSUME 12MHZ CLOCK IS CONNECTED TO 
//MICRO-CONTROLLER
//USE TIMERS 
//CHECK OUT PUT IN P3.2
CODE:


ORG 0000H
MOV TMOD,#01H
UP:SETB P3.2
LCALL DELAY
CLR P3.2
LCALL DELAY
SJMP UP
DELAY:
MOV TH0,#0FEH
MOV TL0,#0CH
CLR TF0
SETB TR0
HERE:JNB TF0,HERE
RET
END


OUTPUT:

CHECK OUTPUT IN TRAINER KIT!!

Comments

Post a Comment