Email: Password: Remember Me | Create Account (Free)

Back to Subject List

Old thread has been locked -- no new posts accepted in this thread
???
03/13/01 16:28
Read: times


 
#9967 - RE: ADuC Debugger+Simulator
$MOD52

CLOCK EQU P3.0
ENABLE EQU P3.1
CLEAR EQU P3.6
;____________________________________

CSEG
ORG 0000H

MOV SP,#2Fh
SETB CLEAR
CLR CLEAR


MOV R0,#080h ;represents 10000000
MOV R1,#040h ;represents 01000000
MOV R2,#020h ;represents 00100000
MOV R3,#010h ;represents 00010000
MOV R4,#08h ;represents 00001000
MOV R5,#04h ;represents 00000100
MOV R6,#02h ;represents 00000010
MOV R7,#01h ;represents 00000001

SETB ENABLE
CLR CLOCK


MOV A,R0

CALL LOAD

CLR ENABLE

CALL BEAMDELAY

SETB ENABLE
CLR CLOCK

MOV A,R1

CALL LOAD

CLR ENABLE

CALL BEAMDELAY

SETB ENABLE
CLR CLOCK

MOV A,R2

CALL LOAD

CLR ENABLE

CALL BEAMDELAY

SETB ENABLE
CLR CLOCK

MOV A,R3

CALL LOAD

CLR ENABLE

CALL BEAMDELAY

SETB ENABLE
CLR CLOCK

MOV A,R4

CALL LOAD

CLR ENABLE

CALL BEAMDELAY

SETB ENABLE
CLR CLOCK

MOV A,R5

CALL LOAD

CLR ENABLE

CALL BEAMDELAY

SETB ENABLE
CLR CLOCK

MOV A,R6

CALL LOAD

CALL BEAMDELAY

CLR ENABLE

SETB ENABLE
CLR CLOCK

MOV A,R7

CALL LOAD

JMP $
;_______________________________________
LOAD:

PUSH ACC

MOV P2,A

CALL DELAY

SETB CLOCK

CALL DELAY

RL A

CLR CLOCK

MOV P2,A

CALL DELAY

SETB CLOCK

CALL DELAY

RL A

CLR CLOCK

MOV P2,A

CALL DELAY ;three

SETB CLOCK

CALL DELAY

RL A

CLR CLOCK

MOV P2,A

CALL DELAY ;four

SETB CLOCK

CALL DELAY

RL A

CLR CLOCK

MOV P2,A

CALL DELAY ;five
SETB CLOCK

CALL DELAY

RL A

CLR CLOCK

MOV P2,A

CALL DELAY ;6

SETB CLOCK

CALL DELAY

RL A

CLR CLOCK

MOV P2,A

CALL DELAY ;7

SETB CLOCK

CALL DELAY

RL A

CLR CLOCK

MOV P2,A

CALL DELAY ;8

SETB CLOCK

CALL DELAY

POP ACC
RET
;_______________________________________




BEAMDELAY:

PUSH ACC
MOV 08h,#01 DLYBEAM:
MOV 09h,#23
DJNZ 09h,$ DJNZ 08h,DLYBEAM ; repeat 1 times

POP ACC
RET

;________________________________________________________________________
DELAY: ;want this delay to be as small as possible (trial and error)
; delay 50us

PUSH ACC
MOV 0Ah,#01 ;
DLY1: MOV 0Bh,#23 ; 23 * 2.17us = 50us
DJNZ 0Bh,$ ; sit here for 50us
DJNZ 0Ah,DLY1 ; repeat 1 times

POP ACC
RET

;_______________________________________END


List of 8 messages in thread
TopicAuthorDate
ADuC Debugger+Simulator            01/01/70 00:00      
RE: ADuC Debugger+Simulator            01/01/70 00:00      
RE: ADuC Debugger+Simulator            01/01/70 00:00      
RE: ADuC Debugger+Simulator            01/01/70 00:00      
RE: ADuC Debugger+Simulator            01/01/70 00:00      
RE: ADuC Debugger+Simulator            01/01/70 00:00      
RE: ADuC Debugger+Simulator            01/01/70 00:00      
RE: ADuC Debugger+Simulator            01/01/70 00:00      

Back to Subject List