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

Back to Subject List

Old thread has been locked -- no new posts accepted in this thread
???
01/18/00 21:11
Read: times


 
#1256 - RE: Light FX
Hi Bee,

Your program has a lot of mistakes. I show you only the half of them.
$INCLUDE(CONTROL) ;
$INCLUDE(AT891051.MAP)

1) Where is definitions of variables BYTA00..BYTA04?
COUNT1 EQU BYTA00 ;COUNTER FOR 25 mS TIMER
COUNT2 EQU BYTA01 ;COUNTER FOR 0.25 S TIMER
OUTPUT EQU BYTA02 ;MIRROR THE OUTPUT PORT
SAMPLE_NEW EQU BITA02 ;RECORD OF INPUT STATUS FOR CURRENT SWITCH
SAMPLE_OLD EQU BITA03 ;RECORD OF INPUT STATUS FOR PREVIOUS SWITCH
TD_FLAG EQU BITA04.0 ;TIMER EXPIRED - ACT ON IT

2) It is definition port 1 not bit P1.X
INPUT EQU P1
;RESET VECTOR
ORG 0000H
JMP SETUP

3) There are others interrupt vectors here
;TIMER O INTERRUPT VECTOR
ORG 000BH
JMP TIMER_0
ORG 00040H
TIMER_0:
;..........
END_INT: RETI

5) Delete
;ORG 0040H

6) Do you know that register R0 has address 00H? I didn’t here write so. You can just delete this fragment
SETUP: CLR A ;CLEAR ACC
MOV R0,#63 ;MOVE 63 INTO REGISTER
SETUP_00: MOV @R0,A ;
DJNZ R0,SETUP_00 ;CLEAR ALL RAM LOCATION

7) First install counter, then - run
MOV COUNT1,#TIME ;PRE-LOAD COUNTING BYTE
MOV COUNT2,#TIME2 ;PRE-LOAD
MOV TMOD,#02 ;TIMER 0 IN 8-BIT AUTO-RELOAD MODE
MOV TH0,#5 ;TIMER RELOAD VALUE FOR MAIN LOOP
SETB IE.1 ;ALLOW TIMER 0 TO OPERATE WHEN ON
SETB IE.7 ;ENABLE GLOBAL INTERRUPTS ---- in the end of all permitions

8) From what did you get the value in accumulator?
RR A
RR A
CPL A ;INVERT IT
INC A

9) In what point of your program did you have to return? Your stack will be overflow soon
JMP WR_TBL ;RELOOP -------------
;.........
WR_TBL:
MOV DPTR,#TABLE ;
MOV A,SAMPLE_OLD ;
MOVC A,@A+DPTR ;
RET ;--------------------------- where?
END

Good-dye,

George


List of 4 messages in thread
TopicAuthorDate
Light FX            01/01/70 00:00      
RE: Light FX            01/01/70 00:00      
RE: Light FX            01/01/70 00:00      
RE: Light FX            01/01/70 00:00      

Back to Subject List