Hi
My target is to recieve IR Data while transmitting the same PIC.
I use PIC12F675 & it doesn't have PWM.IR transmit LED connect to this PIC & TSOP1738 also connected to the same PIC.I want to make a burst of 38Khz for a 600uS time. So I have to decode while transmitting.I wrote a code see if its ok?
In below code if no error flag sets then it got a valid 600uS burst.
My target is to recieve IR Data while transmitting the same PIC.
I use PIC12F675 & it doesn't have PWM.IR transmit LED connect to this PIC & TSOP1738 also connected to the same PIC.I want to make a burst of 38Khz for a 600uS time. So I have to decode while transmitting.I wrote a code see if its ok?
In below code if no error flag sets then it got a valid 600uS burst.
Code:
;GP0 = IR TX LED
;GP2 = TSOP RX
600uS_Burst movlw .22
movwf Counter ;27uS X 22 = ~600uS
bcf Flags,Error
Make_Low bcf GPIO,GP0 ;TX OFF ;1
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop ;13uS
Make_HIgh bsf GPIO,GP0 ;TX ON ;1
decfsz Counter,F ;2
goto $+2 ;4
return
btfsc GPIO,GP2 ;TSOP LOW ? ;5
bsf Flags,Error ;6
nop ;7
nop ;8
nop ;9
nop ;10
nop ;11
goto Make_Low ;13uS
Last edited: