Rules | Recent posts | topic RSS | Search | Register  | Log in

serial port connection failure

 
Post new topic  Reply to topic    EDAboard.com Forum Index -> PC Programming and Interfacing
Author Message
mohannad100



Joined: 16 Jan 2008
Posts: 65
Location: iraq


Post21 Jun 2008 17:14   serial port connection failure

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.
Back to top
medra



Joined: 15 Oct 2006
Posts: 99
Helped: 21


Post21 Jun 2008 20:22   Re: serial port connection failure

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.



Sorry, but you need login in to view this attachment

Back to top
mezo



Joined: 16 Jul 2007
Posts: 60
Helped: 2
Location: Egypt


Post18 Aug 2008 15:23   Re: serial port connection failure



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 .



Last edited by mezo on 25 Aug 2008 9:45; edited 1 time in total
Back to top
amol_shah



Joined: 21 Apr 2008
Posts: 97
Helped: 12
Location: Nasik, Mumbai


Post19 Aug 2008 7:36   Re: serial port connection failure

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
http://www.dnatechindia.com/index.php/Tutorials/8051-Tutorial/Serial-Communication.html
http://www.dnatechindia.com/index.php/Code-Library/8051_ASSEMBLY/Serial-Communication.html

Are you using hyper terminal? for hyper terminal setting:
http://www.dnatechindia.com/index.php/Tutorials/8051-Tutorial/HYPERTERMINAL.html
Back to top
Post new topic  Reply to topic    EDAboard.com Forum Index -> PC Programming and Interfacing
Page 1 of 1 All times are GMT + 1 Hour


Abuse
Administrator
Moderators
topic RSS 
sitemap