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.

RS 232 Serial Communication

Status
Not open for further replies.

cwt

Member level 5
Joined
May 26, 2004
Messages
80
Helped
2
Reputation
4
Reaction score
2
Trophy points
1,288
Activity points
918
Hi..i currently working on a final semester project known as Programmable LED Dot Matrix Display System. I am going to use serial communication to interface with my circuitry. My choice is to use RS 232.

How am i going to communicate with the serial port behind my computer??i prefer to use 9-pin serial port.

Please help... :(
 

Mr_Programmer

Full Member level 3
Joined
Feb 21, 2002
Messages
153
Helped
9
Reputation
18
Reaction score
5
Trophy points
1,298
Activity points
1,424
The windows API have all the functions you need to control the serial port. It will be helpfull to tell us which kind of programming language you use. Because it exist a lot of components, to access the serial port more easily.
But the first step will be the windows API!
 

cwt

Member level 5
Joined
May 26, 2004
Messages
80
Helped
2
Reputation
4
Reaction score
2
Trophy points
1,288
Activity points
918
Window API? How to find that? I am sorry. This is the first time i do the interfacing stuffs. :lol:

I would like to use visual basic 6.0 to communicate with the port. So is there any better programming language to be suggested?
 

hoangthanhtung

Full Member level 3
Joined
Apr 23, 2004
Messages
151
Helped
5
Reputation
10
Reaction score
4
Trophy points
1,298
Activity points
1,362
I think you can use activeX object: MSCOMM to tranceiver with RS232
 

duncan94022

Member level 1
Joined
May 8, 2004
Messages
41
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,286
Activity points
522
I have found that the easiest way to debug a serial port application is to use HyperTerminal. You can check out the basic communication with your microcontroller before moving on to higher level sw like visual basic. HyperTerminal comes for free with every wondows computer 8O
 

dani

Full Member level 4
Joined
Mar 8, 2004
Messages
233
Helped
6
Reputation
12
Reaction score
4
Trophy points
1,298
Location
UK
Activity points
2,229
Hi,

The best source for those who want to learn RS232 communication and serial port interfacing is beyondlogic.org.

www.beyondlogic.org/serial/serial.htm

you can find solution of your problem there.
 

cwt

Member level 5
Joined
May 26, 2004
Messages
80
Helped
2
Reputation
4
Reaction score
2
Trophy points
1,288
Activity points
918
Wow..so many sources of information!Thanks guyz!

Any of you have a sample program that test the 9pin serial port?

By the way, how you know whether the serial port sent out the correct bits? How can i troubleshoot that issue?
 

Antharax

Full Member level 4
Joined
Dec 31, 1999
Messages
208
Helped
14
Reputation
28
Reaction score
1
Trophy points
1,298
Activity points
2,865
For a simple gui program, with not to much data throughput and processing or critical timing Visual Basic is fine! For a beginner it's easier to work with!

Antharax
 

cwt

Member level 5
Joined
May 26, 2004
Messages
80
Helped
2
Reputation
4
Reaction score
2
Trophy points
1,288
Activity points
918
Thanks Antharax for the advice...
Now i feel so motivated to do the project..
Thanks alot!!!
 

Antharax

Full Member level 4
Joined
Dec 31, 1999
Messages
208
Helped
14
Reputation
28
Reaction score
1
Trophy points
1,298
Activity points
2,865
If you search for Serial Port Visual Basic on the internet, you can find allot of examples

eg: https://www.ontrak.net/visual.htm

And use duncan94022 's advice about using hyperterminal for debugging!

Antharax
 

senthilkumar

Advanced Member level 1
Joined
Nov 24, 2001
Messages
401
Helped
27
Reputation
54
Reaction score
19
Trophy points
1,298
Location
india
Activity points
3,965
Hai,

u can use mscomm in vb r VC++

in msdn cd u got the example file.

its very easy.
 

alphi

Advanced Member level 1
Joined
Dec 23, 2001
Messages
414
Helped
11
Reputation
24
Reaction score
10
Trophy points
1,298
Activity points
3,211
Pls ref this book "serial port complete",you also download this book from edonkey.
 

cwt

Member level 5
Joined
May 26, 2004
Messages
80
Helped
2
Reputation
4
Reaction score
2
Trophy points
1,288
Activity points
918
About mscomm...i did heard before of that.
Actually what is it?Is it part of the VB?So...if i use VB to program my serial port..will i be using mscomm??
Oh my goodness..i need to complete the interfacing stuff on next week..hope i can get more help from here...
Thankx you all!!
 

mfilippa

Junior Member level 1
Joined
May 24, 2004
Messages
17
Helped
1
Reputation
2
Reaction score
0
Trophy points
1,281
Location
Boston, MA
Activity points
304
Just browsing this forum, I found this topic on RS232 and Visual Basic.

Here goes a small software I did to interfase a DSP through the serial port. Check the subroutines and you will find how to communicate, send and receive characters.

You can try this easily: Get a computer with two serial ports (almost all new computers have two). Use a crossed serial cable (Rxd and Txd pins crossed) or just use wire wrap and connect the pins manually. Use your VB interfase connected to one port, and Hyperterminal connected to the second. Whatever you send in both, you should receive in the other one.

Hope it helps,
Mariano
 

cwt

Member level 5
Joined
May 26, 2004
Messages
80
Helped
2
Reputation
4
Reaction score
2
Trophy points
1,288
Activity points
918
Erm...erm...erm...
You mean...i'll transmit data out and receive data in from the same port? This is to check whether am i sending the correct bits, right?
What is hyperterminal?
Thanks you all!!
 

C8H10N4O2

Newbie level 6
Joined
May 13, 2004
Messages
13
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,281
Activity points
116
Serial ports come in two flavors DTE and DCE which stand for Data Terminal Equipment and Data Communications Equipmen. To connect a DTE to a DCE you need a normal cable. To connect a DTE to a DTE you need a crossover cable. A PC is a DTE so in order to connect it to another PC (or another port on the same PC) you need to make a special cable as described above.

Hyperterminal is just a 'terminal' program which lets you transmit characters from and to the serial port on the PC.
 

AndaMan

Junior Member level 3
Joined
Apr 12, 2004
Messages
31
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,286
Activity points
235
I use this one to peek what PC and target device talking, very useful tool.

h**p://www.hhdsoftware.com/sermon.html
 

cwt

Member level 5
Joined
May 26, 2004
Messages
80
Helped
2
Reputation
4
Reaction score
2
Trophy points
1,288
Activity points
918
If i purchase a normal cable and i interconnect the TxD and RxD pin to test the sending and receiving of bits, will this work even it is not between two comps?
 

Status
Not open for further replies.

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Top