Teensy 3.6 USB communications with Host PC (no console)

Status
Not open for further replies.

cinemaphobic

New member
Hello all,

Apologies if this is a naïve question.

I wish to communicate back and forth to and from an embedded Teensy 3.6 module and a Windows 10 PC using the USB ports on each. I wish to do so within the confines of an executable that is preferably written in C, though C# would be usable as well. I wish for this executable to be 'hands-free', in that once run, the executable will be able to send, receive, and log any data without a user interacting with a console.

So far, I'm planning on using the 'Serial' library provided with the Teensyduino package. On the host PC side, I am supposing that I will have to try sending a 'magic' sync word to each COM port and waiting for a response to establish a connection. Now, as I am unfamiliar with USB HID, I am only assuming that I will need some sort of API or driver in order to actually get my data abiding by the USB protocol and across the USB line. I've heard talk around the 'net of 'hidapi' and 'libhid'. Am I on the right track?

Thank you.
 
Communicating with a PC via Usb Serial is quite simple. You don't need any HID stuff or low level USB communication. Just open the virtual serial port and write / read from it. How to open a serial port obviously depends on the language you want to use on the PC. In the Teensy user WIKI you find some example code showing how to do this with c# https://github.com/TeensyUser/doc/wiki/Serial
 
Thank you for your help! I'll give it a look. This sounds great.

As a side note, are you the luni64 who I see on the TeensySharp GitHub page? :)
 
... As a side note, are you the luni64 who I see on the TeensySharp GitHub page? :)

Yes, I did TeensySharp some years ago when I was tired of looking in the device manager at which port my various teensies are connected today... It also contains an uploader class which comes in handy if you want to provide uploading from within your windows application.
 
Status
Not open for further replies.
Back
Top