Search Your Query

Custom Search

Saturday 17 September 2011

IR transmitter using AT89C2051

Hello dear friends
If you are trying to design an IR transmitter very similar to your TV remote control. I can help you in achieving this task. Here is program and circuit diagram. it use pin 3.3 (pin 7) of micro controller. Use the given simple program and check it from oscilloscope that it will transmit modulated 38KHz signal.
Circuit diagram is given below

Here is program you can run it using software for assembly language and then create file. After that burn hex file in your microcontroller.


;IR Transmitter using 89c2051

Program

ORG 0000H


Start:
IR EQU P3.3          ;IR trx CONNECTED TO THIS PIN

 
MOV TMOD,#00010001B ; TIMER-0, MODE 1 TIMER-1, MODE 1

sjmp MAIN





;--------------------------;-------------------------------------
;--------------------------;-------------------------------------


ONE:
MOV    TL1,#0CAH ;LOWER BYTE 1.728 MSEC
MOV    TH1,#0F9H ;UPPER BYTE
SETB  TR1
HERE:
MOV    TL0,#0F4H ;LOWER BYTE 38 KHZ
MOV    TH0,#0FFH ;UPPER BYTE
SETB  TR0
CPL   IR
JNB  TF0,$
CLR   TF0
JNB   TF1,HERE
CLR   TF1
Clr IR
RET
;--------------------------;-------------------------------------
;--------------------------;-------------------------------------




;--------------------------;-------------------------------------
;--------------------------;-------------------------------------
ZERO:
MOV    TL1,#0CAH ;LOWER BYTE 1.7728 MSEC
MOV    TH1,#0F9H ;UPPER BYTE
SETB  TR1
SetB  IR
JNB   TF1,$
CLR   TF1
Clr IR
RET
;--------------------------;-------------------------------------
;--------------------------;-------------------------------------






;--------------------------;-------------------------------------
;--------------------------;-------------------------------------
MAIN:
Acall ONE
Acall ZERO
Sjmp MAIN


;--------------------------;-------------------------------------
;--------------------------;-------------------------------------

END



3 comments:

  1. hey..what is value of crystal u have used..?
    and y u have generated 1.7msec delay..!

    ReplyDelete
  2. This Circuit use 16MHz crystal.. and reason of 1.7msec is to keep pulse high (generate duty cycle).

    ReplyDelete
  3. Great tutorial Javed bhai ...
    I need your help, I have constructed the whole circuit, I just have transfer .hex file to AT89c2051 controller, but I don't know how to do this please I need your help

    ReplyDelete

Related Posts Plugin for WordPress, Blogger...