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.

How to interface microcontroller to PC using serial port?

Status
Not open for further replies.

glenndr_15

Member level 1
Member level 1
Joined
Mar 27, 2009
Messages
34
Helped
3
Reputation
6
Reaction score
2
Trophy points
1,288
Activity points
1,455
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
 

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
 
  • Like
Reactions: gauree

    gauree

    Points: 2
    Helpful Answer Positive Rating
rs232e cable

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

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
 
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
 
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 :)
 

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! :D

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

pc interfacing for serial communications using vb

aanand_44 said:
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
 

microcontroller and pc

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

**broken link removed**

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

**broken link removed**
 

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
 
interface microcontroller with pc

jeswanthmg said:
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?
 

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.
 
how to interface micro controller with ma computer.am working on linux platform. can you help me with tc shell scripts..please reply asap.
 

Re: microcontroller to pc software

jeswanthmg said:
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

dude you program was based on **broken link removed** right? hehe
 

for the VB side, use the serialport component from the toolbox, set the baud rate, port name, write timeout, and read timeout. It is not so difficult..
 
  • Like
Reactions: shands

    shands

    Points: 2
    Helpful Answer Positive Rating
Re: flowcode usart

elrayes said:
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 :)



Hi ,Now I am doing a project. Part of them is about communicating data betwwen PC and microcontroller:
I want to give two number ,for example ,A=0x001122, B=0x223333 to microcontroller.In microcontroller ,I have already write the algorithm "multiplication",Now I want to send A and B to SRAM (memory of Microcontroller),from PC and store it in SRAM ,then LD A and B to register using the algorithm to compute the result of A*B,. After that I store the result to SRAM,
and From SRAM ,give PC the result of multiplication of A and B.

That mean I should write a communicating programe betwwen SRAM and PC, maybe I should use the serial communicating port but I haven't find any example about that kind programe,Can you help me ?IF anyone who have some exprience with this ,can you attache your souce code ?Thanks so much !! and if someone know some website about that ,please tell me ,thanks !

I use avr mega8515 and AVRstdio

can you give me some example (better in c Language and assembley language)or advice?
my e-mail is sduliuzhe@gmail.com
 

hello friends
use this link for **broken link removed**
enjoy

---------- Post added at 11:07 ---------- Previous post was at 11:00 ----------

hi friends
**broken link removed**

---------- Post added at 11:10 ---------- Previous post was at 11:07 ----------

here is the nice tutorial on
**broken link removed**
 
Dear All My friends
Very good VB interfacing and micro controller programmer book

Best Regards

MedTronic
 

Attachments

  • electronics - Visual Basic for electronics engineering applications.pdf
    2.6 MB · Views: 189

Status
Not open for further replies.

Similar threads

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top