I am attempting a project that is a basic usb keyboard logger. I plan on using a PIC32 microcontroller that has built in USB host capabilities to interface to the keyboard.
My question is, can i hang off in parallel my MCU to read the data lines without affecting what is sent to the computer? See the below picture.
Is this acceptable practice, or does the data need to be fed in series from the input->mcu->output connector? Any issues with current draw?
Thanks!
Best Answer
No, this will not work. You will need either a µC with two USB ports (one host, one device mode) or two controllers.
USB works with exactly one host on a bus, and when you want multiple devices you have to use a hub. Note that a PC is always in host mode.