Continue to Site

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.

  • 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.

problem with serial port interfacing

Status
Not open for further replies.

froten

New Member
Hello,

Im tring to write a program for AT89C51 that can send a stream of one character (which is 5) to the computer, I wrote this program but it doesn't work because I didn't see any signal going out from the Tx pin using the osciloscope. the program is as follows:

mov TMOD,#20
mov TH1,#-3
mov SCON,#50
SETB TR1
AGAIN:
mov a,"5"
acall TRANS
sjmp AGAIN
TRANS:
mov SBUF,a
HERE:
jnb TI,HERE
CLR TI
ret
end

the buad rate should be 9600 bps. I didn't actually connect the circuit to the computer because when I use the osciloscope I don't see any signal on the Tx pin. I have attached both the asm and hex files for more information.

Please any help on this issue is appreciated as it is very important for me to get it working.
 

Attachments

  • Serial.zip
    404 bytes · Views: 101
all i can give you right now is this file,

it helped me a lot when i was trying to setup the UART in my AT89C52..

**broken link removed**
 
Status
Not open for further replies.

Latest threads

New Articles From Microcontroller Tips

Back
Top