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 can connect serial port usb adapter with PC using C

Status
Not open for further replies.

lingaraj

Newbie level 1
Joined
Aug 9, 2010
Messages
1
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,281
Location
chennai
Activity points
1,292
Hello friends....
I have to connect 89c52 micro controller with PC using serial port to usb adapter. Now i can saw the received data in hyper terminal mode but How can i store received data in PC as a file anybody can help me?
i want program in C language... Anybody have source code means please send me.
 

fernando_castro

Newbie level 4
Joined
Mar 10, 2011
Messages
5
Helped
1
Reputation
2
Reaction score
1
Trophy points
1,283
Location
Campo Grande, Mato Grosso do Sul, Brasil
Activity points
1,316
Hi lingaraj,

Are you familiar to C? Windows or Linux?
There are few ways of doing it. In one of them, your C program will have to handle the entire communication with your device, replacing the Hyper Terminal. In other words, your C program will do what hyper terminal does. Then you'll be able to store whatever your device send to PC.
The website link eXnol post is a good start. First, answer the questions so I can found out how to help you.

Regards
 

nandhu015

Advanced Member level 5
Joined
Feb 11, 2006
Messages
1,965
Helped
300
Reputation
600
Reaction score
224
Trophy points
1,353
Location
India
Activity points
9,856
For storing data in computer you need to write a small application.

You can write that application with VB, VC or any other language.
I would suggest delphi.
 

horace1

Advanced Member level 5
Joined
Nov 18, 2008
Messages
2,123
Helped
596
Reputation
1,188
Reaction score
573
Trophy points
1,393
Location
Norwich, UK
Activity points
13,069
if you are planning to use Visual Studio or one of the free Visual Express editions such as Visual Express C++, C# or VB they come with a SerialPort component. Open the Toolbox and look under Components. SerialPort allows you to send and receive characters via a serial COM port (including USB to serial converters)
 

milind.a.kulkarni

Advanced Member level 3
Joined
Oct 6, 2011
Messages
923
Helped
214
Reputation
428
Reaction score
208
Trophy points
1,333
Location
Bangalore
Activity points
7,438
On the hyper terminal it self have one option to capture log....that also you can use to store the data that you read.....it is there on the top tab.... Similary hyper teminal there is freeware called as teraterm which is also good and come with same facility

Good Luck
 

eziggurat

Full Member level 6
Joined
Feb 15, 2002
Messages
324
Helped
30
Reputation
62
Reaction score
19
Trophy points
1,298
Activity points
2,929
look at this post for C# solution. https://www.edaboard.com/threads/235185/ Much quicker to write an application in C# compare to C or C++ in my opinion.

To write into a file use TextWriter or StreamWriter. There are plenty of examples in the internet. If you come into problems with cross-thread, invoke is the solution just in case you stumble into this problem with C# and if decided to use C#.
 
Last edited:

Status
Not open for further replies.

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Top