Pages: [1] 2   Go Down
Author Topic: how to use 2 usb serial port at the same time on computer  (Read 3661 times)
0 Members and 1 Guest are viewing this topic.
Offline Offline
Newbie
*
Karma: 0
Posts: 49
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

I am wondering, is it possible to use 2 usb port at the same time?

Example i am using 1 UART usb serial port to send data to computer. Then, arduino receive the data through USB and the shows the data on serial monitor.

How do i write the code and what library should be using??please give any help. Any replied is highly appreciate. thanks
Logged

Seattle, WA USA
Online Online
Brattain Member
*****
Karma: 613
Posts: 49255
Seattle, WA USA
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Quote
I am wondering, is it possible to use 2 usb port at the same time?
On the PC? Yes.

On the Arduino? How? Most only have one. If yours has more than one, please post a link to it.
Logged

The Netherlands
Offline Offline
Sr. Member
****
Karma: 4
Posts: 331
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

I think the OP is refering to can I use two arduinos at one PC by USB connection.
So each arduino will have a comport number occupied and how to send data.

Paco
Logged

Never to old to learn and I learn every day

Seattle, WA USA
Online Online
Brattain Member
*****
Karma: 613
Posts: 49255
Seattle, WA USA
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Quote
I think the OP is refering to can I use two arduinos at one PC by USB connection.
That is certainly possible.

Quote
So each arduino will have a comport number occupied and how to send data.
Each connection by an Arduino will create a new com port. The communication between the Arduino and the PC is exactly the same if there is one Arduino connected to one com port on the PC as if there are 12 Arduinos connected to 12 com ports on the PC.
Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 49
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

I think the OP is refering to can I use two arduinos at one PC by USB connection.
So each arduino will have a comport number occupied and how to send data.

Paco


ya that is what i mean.
Example, an UART usb serial port (eg sensor) send the data through USB (com port) to PC. And then these data is needed to transfer to Arduino board (another com port) by USB. Is it possible? and how to write the code? As i am beginner in arduino, I do not know which library should be use. Please guide me. Thanks.
Logged

The Netherlands
Offline Offline
Sr. Member
****
Karma: 4
Posts: 331
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

I think you better try to explain what you like to accomplish with your project.
You want to read data with one UNO and sensor to the PC and then work this data in the pc and send it back to an other UNO.
Is there a real need to have 2 UNO's?
One UNO can read and send sensor data that is worked over in the PC.

Paco
Logged

Never to old to learn and I learn every day

Offline Offline
Newbie
*
Karma: 0
Posts: 49
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

I think you better try to explain what you like to accomplish with your project.
You want to read data with one UNO and sensor to the PC and then work this data in the pc and send it back to an other UNO.
Is there a real need to have 2 UNO's?
One UNO can read and send sensor data that is worked over in the PC.

Paco

Thanks for your replied. now i own an ADXL345 Eval board with usb port built in.
http://www.sparkfun.com/products/9814

Then i wish to use it to connect to my pc. and then i will connect arduino Uno to my pc at the same time also. Then i wish that arduino Uno can get the data from adxl eval board. This is the flow that i think:
ADXL345 eval board -> pc (USB serial port eg com port 21). Then pc -> arduino (USB serial port eg com port 22 ). Then how do i write in arduino code to include com port 21 for adxl eval board?
Logged

Gosport, UK
Offline Offline
Faraday Member
**
Karma: 21
Posts: 3113
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Each Arduino will read and write from it's own Serial port, and you'll need a small program running on the PC to transfer the data between the two.
Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 49
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Each Arduino will read and write from it's own Serial port, and you'll need a small program running on the PC to transfer the data between the two.

this is the 1 i am looking for. can u guide me how??really appreciate that^^
Logged

Gosport, UK
Offline Offline
Faraday Member
**
Karma: 21
Posts: 3113
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

There's not much to it. When a byte comes in on serial port a, write it to serial port b, and when a byte comes in on port b, write it to port a. The exact implementation would depend on what language you were using on the PC.
Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 49
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

There's not much to it. When a byte comes in on serial port a, write it to serial port b, and when a byte comes in on port b, write it to port a. The exact implementation would depend on what language you were using on the PC.

can i do like that??i have the concept like this also...because it is simplest way to do it. I am using windows, using arduino GUI. It is using C language right. any special library need to included? is it same as normal code to use void setup() and then void loop()?
Logged

Seattle, WA USA
Online Online
Brattain Member
*****
Karma: 613
Posts: 49255
Seattle, WA USA
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Quote
can i do like that??i have the concept like this also...because it is simplest way to do it. I am using windows, using arduino GUI. It is using C language right. any special library need to included? is it same as normal code to use void setup() and then void loop()?
You can't write a PC application using the Arduino IDE.
Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 49
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Quote
can i do like that??i have the concept like this also...because it is simplest way to do it. I am using windows, using arduino GUI. It is using C language right. any special library need to included? is it same as normal code to use void setup() and then void loop()?
You can't write a PC application using the Arduino IDE.

then any others IDE that you can intro to me??
Logged

Gosport, UK
Offline Offline
Faraday Member
**
Karma: 21
Posts: 3113
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

There are many to choose from. Processing is free, and has a very similar IDE. If you are a Windows user, then Visual C# express and Visual Basic express are also free. If you don't need a fancy gui, and it isn't necessary for this application, then the tiny c compiler would probably do.
Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 49
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

There are many to choose from. Processing is free, and has a very similar IDE. If you are a Windows user, then Visual C# express and Visual Basic express are also free. If you don't need a fancy gui, and it isn't necessary for this application, then the tiny c compiler would probably do.

Ok now i have netbean because i did JAVA project previously. So can i use netbean? and any example guide that you can show me so that i can refer to?regarding on how to communicate with multiple com port...i need some guide on the library and the C# code
Logged

Pages: [1] 2   Go Up
Jump to: