KVM with arduino

My project requires me to send keyboard/mouse events from an enterprise grade machine to another controlled machine. I'm looking to add Arduino to support keyboard/mouse. So, the controlled machine is connected to Arduino which in turn is connected to enterprise cpu using USB. This means there are two usb device interfaces in use on Arduino - one for hid emulation and other to receive keyboard/mouse events from enterprise cpu all on USB.
I'm new to arduino. Read that arduino due has two USB ports, can i put both the ports in device mode and connect one to enterprise machine and another to controlled machine ?

Thanks

One of the USB ports is connected to a 16U2 microprocessor; intended to be used as a USB to serial programming port.

It may be possible to reprogram or otherwise use the 16U2 for the project. For example with the latter approach, you could send/receive serial data to/from the Due via the programming port.

Thank you. So, I can use the programming port for data transfer and use the native Port to emulate hid. Is that right?
Also, there's a way to share data between the two controllers - 16U2 and the one emulating HID ?

The 16U2 is connected via UART to the SAM3X8 processor.

Thank you so much

Hi,
I'm able to emulate keyboard and mouse in different sketches. But i want to combine them. This needs me to send keyboard and mouse HID reports on programming port. As i understand software serial is not enabled on DUE. Is there a way i can emulate two serial ports on the programming port ?

Thanks
Srinivas

Have you tried alternating as needed?
Keyboard.begin()
. . .
Keyboard.end()

Mouse.begin()
. . .
Mouse.end()

Hi, Thank you. This alternating approach needs me to implement serial protocol to separate out keyboard and mouse reports on the serail port. Hence was wondering if it's possible to get the data on two different ports.

Alternating won't make a big difference.

void Keyboard_::begin(const uint8_t *layout)
{
        _asciimap = layout;
}

void Keyboard_::end(void)
{
}
void Mouse_::begin(void)
{
}

void Mouse_::end(void)
{
}

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.