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

Back to Subject List

Thread Closed: Off-topic

???
09/14/04 11:06
Read: times


 
Msg Score: -2
 -2 Didn't Search First
#77370 - Counting the pulses
Hello,
i m making a program which is counting the pulses on the p1.0 for six seconds and then multiply it by ten to get the pulses that will occour in a minute.
The problem i m facing here is that it counts for only first 6 seconds but don't continue after it.
how could i solve the problem.
please also tell me what is the incorrect thing i m doing here.

The program is below
ORG 000H
JMP MAIN
ORG 00BH
JMP TA
ORG 030H
MAIN: MOV TMOD,#01H
MOV TH0,#HIGH(5536)
MOV TL0,#LOW(5536)
SETB EA
SETB ET0
MOV B,#1010B
MOV R3,#100
SETB TR0


ALI: JNB P1.0,$
INC DPTR
JB P1.0,$
JMP ALI

TA: MOV TH0,#HIGH(5536)
MOV TL0,#LOW(5536)
DJNZ R3,SKIP
MOV A,DPL
MUL AB
MOV P2,A
CLR P0.1
SETB P0.0
MOV R0,B
MOV B,#1010B
MOV A,DPH
MUL AB
MOV B,R0
ADD A,B
CLR P0.0
SETB P0.1
MOV P2,A
MOV R3,#100
MOV DPTR,#0000H
MOV TH0,#HIGH(5536)
MOV TL0,#LOW(5536)
TURAB: JNB P1.0,$
INC DPTR
JB P1.0,$
JMP TURAB
SKIP: RETI




END

Thanks

List of 4 messages in thread
TopicAuthorDate
Counting the pulses            01/01/70 00:00      
   RE: Counting the pulses            01/01/70 00:00      
      RE: Counting the pulses            01/01/70 00:00      
   RE: Counting the pulses            01/01/70 00:00      

Back to Subject List