473,396 Members | 1,875 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

how to receive data from visual basic 6 to pic microcontroller using serial port

][/code]

I am using visual basic 6. There was no data come to my textbox even it was connected on my device. I have a settings of com3, 9600, 8, n, 1.
Feb 8 '14 #1
3 2312
1. Do you have a Com3?
2. How are you updating the Textbox?
Apr 7 '14 #2
On second thought, that doesn't sound too friendly, and that was not my intent.

First, have you ever established communications with any device using Com3? Back before USB ports, computers usually had two com ports, but they were Com1 and Com2. The newer computers don't have any real DB-9 or DB-25 com ports at all. One of the reasons I'm confused is that most of the PICs I have seen have either a DB-9 or DB-25 connector.

When you start talking about Com3 it makes me think of the virtual Com ports that modern OSes provide where communications are actually done with a USB cable.

That's the reason why I ask if you have ever been successful using that port before. If you have, we still aren't completely out of the woods. Suppose that the PIC is bad, for instance?

I've used VB to talk through Com ports a number of times, and one of the first things I learned was not to assume that the problem is in the program. Fortunately, at the time I was doing this USB ports were not yet in use, which actually made troubleshooting much easier.

Here's a link for a make-it-yourself DB-9 loopback tester.
http://www.ehow.com/how_7285961_test...ial-ports.html

This only tests half of the possible problems, though. What you really want is a breakout box with LED indicators so you can actually watch what's happening on the RX/TX lines, as well as CTS, etc.

But that is only for real Com ports. For USB ports/cables, the decent testers seem to be a lot more expensive if you want to test anything other than output voltage. But still, if I was doing a lot of work with PICs via USB, I would want a breakout box.

I say that now after wasting a good amount of time trying to talk to an Arduino Mini. If I had a USB breakout box then I could have saved myself about a week of time.

One good thing about this, though, is that once you get this to work, you will never need to worry about the code again, as long as you are careful to make modular and re-usable.

Another possible issue is the Baud rate. You are using 9600 bps and some modern UARTs aren't comfortable at that speed. They are supposed to auto-negotiate, but some don't.
Apr 7 '14 #3
What I suggest you do depends on whether you have ever been able to communicate with anything using Com3 on your computer before.

Anyway, take a break from programming for a while and do some manly hardware stuff.

Whatever kind of cable you are using, see if you can find, or make at least a loopback tester. (On Arduinos all you have to do is jumper two pins to go into loopback mode.) Just remember that this doesn't really test anything except the computer.

In loopback mode, anything you send out should pop right up in your textbox. If it does there are still some possible problems on the computer end. Like the 'modem' initialization string. Are you sure that the PIC is looking for 8,N,1? Changing the Baud rate is as easy as adding some option buttons to your form.

But I have to warn you that the real problem I had with that Arduino was caused by faulty driver software that was provided with the Arduino. Are you using a driver, or can the PIC accept plain ASCII?

I used to enjoy working on communications problems like this because there are so many things that can possibly be wrong. I think that, about the time that I turned 60, that stopped.
Apr 7 '14 #4

Sign in to post your reply or Sign up for a free account.

Similar topics

2
by: Elizabeth | last post by:
In a visual basic.net 1.1 windows application, I need to pass required and optional values from a sql server 2000 table for a windows application to process. Each of the 250 columns in the sql...
1
by: Jan | last post by:
Hello, is there someone who know's how to read and write data to a serial port using visualbasic 8 thanx in advance
0
by: pandi | last post by:
Hi, I am using a check scanner.It has functions which gives output like image ,checknumber. i am using serial port to get this output in my coding. My problem is i am not able to read the display...
1
by: Jan | last post by:
Hello, I want to send some simple strings to com1 using vb2005. I want to read it in Hyperterminal. I succeeded to send some data en read it in Hyperterminal, only the data I received is not...
1
by: Beginner KS | last post by:
Hi, I want to design a form in the VB2005(visual studio 2005) to receive data(temperature measurement result) from microcontroller(which is CPLD coolrunner II) after received the data then it will be...
0
by: ghjk | last post by:
I want to read sms from GSM modem using C# in serial communication. I wrote the code. But i want to do it automatically. I put my code here and please tell me how can i do it automatically. ...
0
by: =?Utf-8?B?Q2hhcmxpZQ==?= | last post by:
Hi, This apparently is a common problem and I've yet to read a solution that actually works for my specific situation. I have a Zebra RW220 printer that I connect to via Bluetooth connection...
6
by: Bassem | last post by:
Hello everyone, What I'm trying to do is a basic messenger (char receiver/ transmitter) via serial port in a console application. in main function i call setup_configuration function ---- no...
1
by: lutherchp | last post by:
A baffling end to my week! I open my serial port on my Debian PC (Debian version 5.0.1) I have a decent Null Modem lead going to another PC (I'll call it PC#2), with its port open with the same...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.