electronics forum

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

How to interface microcontroller to PC using serial port?


Post new topic  Reply to topic    EDAboard.com Forum Index -> Microcontrollers -> How to interface microcontroller to PC using serial port?
Author Message
glenndr_15



Joined: 27 Mar 2009
Posts: 28
Helped: 1


Post01 Jun 2009 16:44   

serial port microcontroller


Greetings how can I interface a microcontroller (for example PIC16F877A) using serial communication? and how to make a VB can someone share?

best regards,
glenndr_15
Back to top
sau_sol



Joined: 27 Feb 2008
Posts: 249
Helped: 27
Location: India


Post02 Jun 2009 6:31   

how to interface microcontroller with pc


for a serial communication you have to use UART and a voltage converter IC like MAX232 for converting 5 - 0V to +-15V compatible to Serial communication in Computer

And VB directly has an interfacing command with the COM Port But I Dont know much about VB
Back to top
glenndr_15



Joined: 27 Mar 2009
Posts: 28
Helped: 1


Post03 Jun 2009 14:48   

rs232e cable


I see but are you putting some program in the microcontroller say a code to communicate to computer?
Back to top
sau_sol



Joined: 27 Feb 2008
Posts: 249
Helped: 27
Location: India


Post04 Jun 2009 6:19   

interfacing microcontroller to pc


yes this is what the micro controller is.

We write our program according to the hardware and our application and then we put that program in to the controller
and then the controller function according to the code burned into its memory
Back to top
aanand_44



Joined: 25 Jul 2007
Posts: 24
Helped: 2
Location: India


Post09 Jun 2009 12:35   

win32 api using serial port vb6


hi,
first which compiler you have to use to develop uart program. please tell me detail i will give you solution for that. in VB it is not much difficult. also i will give you that too.

Regards,
Anand.A
Back to top
Google
AdSense
Google Adsense




Post09 Jun 2009 12:35   

Ads




Back to top
elrayes



Joined: 03 Jun 2008
Posts: 164
Helped: 8
Location: Egypt


Post09 Jun 2009 13:26   

flowcode usart


if you are using C16 or C18 compiler you will find in the libraries guide API's and instructions used to interface microcontroller UART/USART module and example code on it, also you will find functions and example code if you are using MikroC IDE in MikroC manual.

Good luck

Added after 4 minutes:

Forget the PC side programming
you can use Win32 API "CreateFile" to communicate with serial port using MS visual C++ (use header file windows.h) or in visual BASIC, through one of them you will interface your COM port.

Good luck Smile
Back to top
craftythejoe



Joined: 10 Jun 2009
Posts: 2
Location: UK


Post12 Jun 2009 1:21   

microcontroller to pc


Hi,

If you are wanting to interface your micro with a P.C, i'm working on a project at the moment similar to your topic. I'm using a matrixmultimedia PIC16F877A with a corresponding RS 232 e-block. The P.C software i used is labVIEW for delivering data to the PIC via COM port, RS 232 cable, RS 232 e-block, PIC. I use flowcode to initialise the 232 board and process the received data from the P.C.
RS 232 is a serial data bus protocol.

Labview is a fairly complex software to use however. Also, there can be issues with timing of flowcode sampling rates to labVIEW transmission rates, you just have to play arond with time delays a bit.

If you are wanting to interface with another microcontroller, maybe try using CAN protocol. Fairly easy to program, fast results in little time.

I don't know if this is helpful to you but good luck anyway! Very Happy

P.S i had quite alot of drama creating a clear interface between my PIC and P.C.
Back to top
glenndr_15



Joined: 27 Mar 2009
Posts: 28
Helped: 1


Post12 Jun 2009 2:06   

pc interfacing for serial communications using vb


aanand_44 wrote:
hi,
first which compiler you have to use to develop uart program. please tell me detail i will give you solution for that. in VB it is not much difficult. also i will give you that too.

Regards,
Anand.A


For example I'm going to use AT89C4051, from PC I want to control a DC motor that rotates clockwise and counter clockwise. From PC if I press letter "A" the letter "A" will be displayed in the dot matrix or LCD or 7 segment display

Best regards,
glenndr_15
Back to top
madicalphy



Joined: 22 Jul 2007
Posts: 68
Helped: 3


Post12 Jun 2009 6:49   

microcontroller and pc


Serial Interface of computer with microcontroller 8051 and PIC is expalaned here on following links.

http://microcontroller51.blogspot.com/2009/02/temperature-measurment-data-acquisituon.html

Serail interface by using PIC16f877a microcntroller with computer (PC) see here

http://picinf.blogspot.com/2009_02_01_archive.html
Back to top
jeswanthmg



Joined: 06 Jun 2009
Posts: 15
Location: Bangalore


Post13 Jun 2009 13:39   

microcontroller to pc software


Dude its easy try this files.

I have made it work well but vb source code is basic and simple i made it my self



Sorry, but you need login in to view this attachment

Back to top
glenndr_15



Joined: 27 Mar 2009
Posts: 28
Helped: 1


Post13 Jun 2009 13:55   

interface microcontroller with pc


jeswanthmg wrote:
Dude its easy try this files.

I have made it work well but vb source code is basic and simple i made it my self


Ok I will try it. but can you tell me some detail about the program? I mean is the microcontroller vb project and the computer vb project work simultaneously? or I need to run them both? did you try to test it already in the microcontroller?
Back to top
jeswanthmg



Joined: 06 Jun 2009
Posts: 15
Location: Bangalore


Post14 Jun 2009 8:02   

interface microcontroller


Dude i tested and made many projects on 8051 PIC with serial interfacing.
The source codes which i gave you is different the PIC software does not work in sequence with VB source code just modify the software in PIC controller. see this file too which is of 8051. i gave all the files which made me understand and connect any controller to serial port good luck.
IF even now you cant get it working may be i can give you the complete PIC and VB source code which work in sequence after 4 days cause i am a bit busy now.



Sorry, but you need login in to view this attachment

Back to top
medorpg



Joined: 04 Nov 2009
Posts: 2


Post04 Nov 2009 19:17   

How to interface microcontroller to PC using serial port?


that was amazing
Back to top
Arabic versionBulgarian versionCatalan versionCzech versionDanish versionGerman versionGreek versionEnglish versionSpanish versionFinnish versionFrench versionHindi versionCroatian versionIndonesian versionItalian versionHebrew versionJapanese versionKorean versionLithuanian versionLatvian versionDutch versionNorwegian versionPolish versionPortuguese versionRomanian versionRussian versionSlovak versionSlovenian versionSerbian versionSwedish versionTagalog versionUkrainian versionVietnamese versionChinese version
Post new topic  Reply to topic    EDAboard.com Forum Index -> Microcontrollers -> How to interface microcontroller to PC using serial port?
Page 1 of 1 All times are GMT + 1 Hour
Similar topics:
interface microcontroller to serial port using VB (3)
using serial port how can i interface printer (2)
Interface thermal printer to 89s51 using serial port (2)
How to interface 8051 with Serial port (6)
how to interface 74HC595 directly from PC Serial Port (2)
how to interface 2 Devices to microcontroller via serial por (6)
A dll file for interface Serial port and parallel port (1)
How to communicate serial port using c#.net (5)
How to implement a RS-232 serial interface using GPIO? (6)
how to configure serial port DB-9 by using Visual Basic 6.0 (1)


Abuse || Administrator || Moderators || Support us || sitemap
topic RSS