• Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

TSOP 1738 Code Help

Suraj143

Active Member
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.

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:

Nigel Goodwin

Super Moderator
Most Helpful Member
Check my IR PIC tutorial - as you're already doing, you don't need PWM, it's much easier and more accurate to do it in software. However, you're probably going to struggle receiving at the same time as transmitting.
 

Suraj143

Active Member
Check my IR PIC tutorial - as you're already doing, you don't need PWM, it's much easier and more accurate to do it in software. However, you're probably going to struggle receiving at the same time as transmitting.
Yes, I got the techniqure from your tutorials.Thanks.

The transmitting pulses ok its working.But the recieving data is not coming.I'm checking where the error is.
Datasheet says you need minimum 10cycles (270uS) burst to note the reciever unit.

Just guesing do I need to wait 270uS time to read a data after sending my pulses?
 

Nigel Goodwin

Super Moderator
Most Helpful Member
Yes, I got the techniqure from your tutorials.Thanks.

The transmitting pulses ok its working.But the recieving data is not coming.I'm checking where the error is.
Datasheet says you need minimum 10cycles (270uS) burst to note the reciever unit.

Just guesing do I need to wait 270uS time to read a data after sending my pulses?
What exactly are you trying to do?, what's sending data back?, and how quickly is it sending it?.
 

Latest threads

EE World Online Articles

Loading

 
Top