USB to USB communication

General discussion on mikroC.
Post Reply
Author
Message
saharul
Posts: 489
Joined: 08 Jul 2010 08:11

USB to USB communication

#1 Post by saharul » 28 Jun 2019 09:01

Hi,

I need to send data from my PIC micro controller through USB terminal to a device. The communication protocol as per image attached.


The device only receive data/instruction from my controller (through USB). So i need to have USB to USB communication. I intend to use PIC18F4550.

1.Can anybody share idea and do i have to use USB with HID or USB CDC
2.Is there any code example that has almost close similarity that was successfully done that i can make reference.

Tq.
Attachments
usb_hasomed.jpg
usb_hasomed.jpg (96.86 KiB) Viewed 3735 times

hexreader
Posts: 1784
Joined: 27 Jun 2010 12:07
Location: England

Re: USB to USB communication

#2 Post by hexreader » 28 Jun 2019 12:43

What you describe is impossible.

USB communication requires a host at one end and a device at the other.

PIC18F4550 can only operate as a device, never a host.

You do not say what FTDI device you are using, but I bet it also can only ever be a device.

A USB device can not talk to a USB device.
Start every day with a smile...... (get it over with) :)

saharul
Posts: 489
Joined: 08 Jul 2010 08:11

Re: USB to USB communication

#3 Post by saharul » 29 Jun 2019 09:16

Thanks hexreader,

How i do solve the problem? What device that can work as host.

Many thanks.

hexreader
Posts: 1784
Joined: 27 Jun 2010 12:07
Location: England

Re: USB to USB communication

#4 Post by hexreader » 29 Jun 2019 10:17

Many ARM, PIC24 and PIC32 MCU have USB host capability, but problems will still remain:

1) You would need to buy a new compiler
2) You would need the correct driver program for the chosen MCU - I do not know of any, or whether such a thing even exists. You would have to pay someone a huge amount of money to write a driver from scratch.

I suggest that you forget the whole idea.
Start every day with a smile...... (get it over with) :)

saharul
Posts: 489
Joined: 08 Jul 2010 08:11

Re: USB to USB communication

#5 Post by saharul » 30 Jun 2019 02:47

Thanks hexreader,

Do you think raspberry pi can do that?

Many thanks,

hexreader
Posts: 1784
Joined: 27 Jun 2010 12:07
Location: England

Re: USB to USB communication

#6 Post by hexreader » 30 Jun 2019 11:04

saharul wrote: Do you think raspberry pi can do that?
I do not know, but my guess is that it probably could.
You would have to do some research on Linux drivers for your exact device.
Start every day with a smile...... (get it over with) :)

saharul
Posts: 489
Joined: 08 Jul 2010 08:11

Re: USB to USB communication

#7 Post by saharul » 01 Jul 2019 23:59

Thanks hexreader,

Is there anyway that i can convert the signal back to serial.?..
or by hardwire changes such as do some bypass
with jumper wire or anything.

Many thanks.

hexreader
Posts: 1784
Joined: 27 Jun 2010 12:07
Location: England

Re: USB to USB communication

#8 Post by hexreader » 02 Jul 2019 09:29

Maybe.....

But without knowing anything about your "device" it is hard to guess.
Start every day with a smile...... (get it over with) :)

hexreader
Posts: 1784
Joined: 27 Jun 2010 12:07
Location: England

Re: USB to USB communication

#9 Post by hexreader » 04 Jul 2019 23:58

Just spotted this device:

http://www.hobbytronics.co.uk/usb-host-serial

Maybe - just maybe - it would do what you want. You would need to do your own research to determine if it is suitable.

.... but the hardware is currently out of stock :(
Start every day with a smile...... (get it over with) :)

saharul
Posts: 489
Joined: 08 Jul 2010 08:11

Re: USB to USB communication

#10 Post by saharul » 05 Jul 2019 11:58

Thanks hexreader.

I will try.

Many thanks

Post Reply

Return to “mikroC General”