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.

serial port connection failure

Status
Not open for further replies.

mohannad100

Member level 3
Joined
Jan 16, 2008
Messages
63
Helped
2
Reputation
4
Reaction score
1
Trophy points
1,288
Location
iraq
Activity points
1,700
hi every body
im working on microcontroller projects using AT89C52 and the interfacing with pc is done through serial port ,im using a 12Mhz crystal ,baud rate 9600
the problem is the connection doesnot exist and the serial port doesnot read any thing from my microcontroller program
i need every possible help please.
thanks alot.
 

dear mohannad, el salamo 3likom
I have attached a working hex file and the asm file for serial interfacing for AT89S52 it accepts a letter and sends the following letter, try it

if the problem still exists , you must check the conections.
 



you can use the functions :inp, outp . knowing the port number .

Here is the code :

#include<stdio.h>
#include<conio.h>

int main(void) {
unsigned port = 0x378 // first pin in parallel port 0x378-0x37f
int value ;
value = outp(port,'c') // c is the number you'll send to LPT
printf("value %c sent to port %d\n", value, port);
return 0 }


send me if you need anything .

 

first of all you cannot get exact 9600 bps when you use 12Mhz crystal, for generating exact 9600bps you require to use 11.0592Mhz crystal.
Maybe there is a problem in you code, post your code so that we can help, or check this link for working code fore serial communication
https://www.dnatechindia.com/index.php/Tutorials/8051-Tutorial/Serial-Communication.html
https://www.dnatechindia.com/index.php/Code-Library/8051_ASSEMBLY/Serial-Communication.html

Are you using hyper terminal? for hyper terminal setting:
https://www.dnatechindia.com/index.php/Tutorials/8051-Tutorial/HYPERTERMINAL.html
 

Status
Not open for further replies.

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top