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

Back to Subject List

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


 
#58973 - RE: Thank you
Responding to: ???'s previous message
Hi,
ooops, you said:
I have a pin P2.0 that is set as a carrier detect input. When the pin goes low this starts my timing routine which monitors the incoming data on P2.1.
...and then:
CARDET set P2.0 ;Detect incoming carrier
[snip]
K0: JNB CARDET,$

Is this just a typpo?
1) you have indicated that the start condition is the low pin level so you need wait till P2.0 goes low:
K0:  JB CARDET,$

... what is opposite for JNB CARDET,$
2) you should insert a space dimension = 1/2 of bitrate before read the first bit; and even better, make "major OR 2-from-3" (sorry, I do not know the english name of this function exactly) when read each bit as well.
3) just a little modification which allows you to compare all the 9 bits:
START:
       JNB CARDET,$       ; ignore already started bit stream
       MOV R1,#9          ; 9 bits! 
K0:
       JB CARDET,$        ; wait for start condition
       MOV R0,#(BITTIM/2)
K1:
       DJNZ R0,$          ; 1/2 dimension
       MOV C,RXBIT        ; read bit
       RLC A
       MOV R0,#(BITTIM)
       DJNZ R1,K1         ; read 9 bits
       JNC START          ; compare 9th bit: should be 1
       CJNE A,#0x58,START
Here in example, the first goes to Carry flag due 9th iteration.
Good days!




List of 12 messages in thread
TopicAuthorDate
Bit Bang Question            01/01/70 00:00      
   Algorithm...            01/01/70 00:00      
   RE: >8 bits            01/01/70 00:00      
      9 bits            01/01/70 00:00      
   RE: Bit Bang Question            01/01/70 00:00      
   RE: Thank you            01/01/70 00:00      
      RE: Thank you            01/01/70 00:00      
         RE: Thank you            01/01/70 00:00      
            RE: Thank you            01/01/70 00:00      
               RE: Thank you            01/01/70 00:00      
                  RE: Thank you            01/01/70 00:00      
                  RE: Thank you            01/01/70 00:00      

Back to Subject List