Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

Square Wave Generation (38Khz) using 89c2051

Status
Not open for further replies.

kisstronics

Newbie level 3
Newbie level 3
Joined
Aug 6, 2012
Messages
3
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,281
Activity points
1,303
Please help me
I need to generate 38khz square wave for IR transmission so I decided to use the 89c2051 I wrote the following ASM program for that but It is not working in real time. The Wave should be generate when P3.1 is High only. The code is as fallows

ORG 00H
GO:
tx EQU P3.3
MOV TMOD,#00010001B
SJMP MAIN
HIGH:
MOV TL1,#0CAH
MOV TH1,#0F9H
SETB TR1
HERE:
MOV TL0,#0F4H
MOV TH0,#0FFH
SETB TR0
CPL IR
JNB TF0,$
CLR TF0
JNB TF1,HERE
CLR TF1
CLR IR
RET
LOW:
MOV TL1,#0CAH
MOV TH1,#0F9H
SETB TR1
SETB IR
JNB TF1,$
CLR TF1
CLR IR
RET
MAIN:
CLR P3.1
CLR P3.3
HI:
JNB P3.1, HI
ACALL HIGH
ACALL LOW
SJMP HI
END
 

Status
Not open for further replies.

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top