[TI-H] Re: PIC16F84 Interfacing
[Prev][Next][Index][Thread]
[TI-H] Re: PIC16F84 Interfacing
>on both signal lines. (RA0, and RA1 in your case)
>
>It pulls the line high when nothing keeps it low. Often needed in cases
>like this.
>I has to do with the port on the calc to be open collector, and the port on
>the pic not beeing this.
>It could get stuck low otherwise.
Thnxs.. it still works with VTI but no way with the calc... mabe it's
better this way, dunno.
When i connect everything, before executing the program, everything slows
down like if the pic was sending data.
I think this is an important factor to consider. I don't know what I am
doing wrong but I'm sure it's in the RecvByte routine, see below:
; ----------- RECV BYTE STARTS --------------
RecvByte:
movlw .9 ; a byte is made of 8 bits
movwf temp
DecrementarR:
decfsz temp,F
goto RecibirBit
return ; return from SendByte
RecibirBit:
call BothIn ; both inputs
call WaitRed1 ; wait for white and red (wait!)
call WaitWhite1
btfsc PORTA, RED
goto isR1
goto isR0
isR1:
bcf PORTA, RED
call WhiteIn
call WaitWhite1
bsf PORTA, RED
bsf adc, 7
rrf adc
goto DecrementarR
isR0:
bcf PORTA, WHITE
call RedIn
call WaitRed1
bsf PORTA, WHITE
bcf adc, 7
rrf adc
goto DecrementarR
; ----------- RECV BYTE ENDS --------------
Follow-Ups:
References: