I recently got an Arduino. I've been tinkering around much with it, and one thing really interested me.
Arduinos use little USB cables to connect to the computer, but when they get into the OS, they appear as COM ports.
So I must ask, is this on a hardware level or a software level?
Meaning, if I wanted to send raw data the same way I send over my normal COM port, do I have to use a USB driver or a COM driver?
Reason I'm asking this is because I'm testing my OS on real hardware and I need something to log the serial output. My idea is that I could send the data to the Arduino, and have it store the text in memory. Then I would reboot, open the serial monitor, and press a button and have the Arduino spit the stored data back out.
Thank you in advance.
To send data to a USB COM port do I need a USB driver?
To send data to a USB COM port do I need a USB driver?
Skylight: https://github.com/austanss/skylight
I make stupid mistakes and my vision is terrible. Not a good combination.
NOTE: Never respond to my posts with "it's too hard".
I make stupid mistakes and my vision is terrible. Not a good combination.
NOTE: Never respond to my posts with "it's too hard".
Re: To send data to a USB COM port do I need a USB driver?
My guess as to what is happening here is that the AVR processor's UART I/O is pushed through a USB serial chip, and the USB cable only connects that chip through to the PC. This means that what you want is not possible, because you would have to connect your COM port to the side of the USB serial chip that is not exposed externally. And whether or not TTL UART is capable of communicating with a COM port is up in the air, although I have been able to make it work in the past.
Anyway, what you want means you need a USB stack to talk to the USB serial chip. And that is significantly more work than the ISA serial port.
Anyway, what you want means you need a USB stack to talk to the USB serial chip. And that is significantly more work than the ISA serial port.
Carpe diem!
Re: To send data to a USB COM port do I need a USB driver?
Well that still leaves how to implement it. From what you are saying, it seems that no, the Arduino will not map to a COM port that I can simply outb to. So do I need a USB driver? How do I communicate with this serial chip?
Skylight: https://github.com/austanss/skylight
I make stupid mistakes and my vision is terrible. Not a good combination.
NOTE: Never respond to my posts with "it's too hard".
I make stupid mistakes and my vision is terrible. Not a good combination.
NOTE: Never respond to my posts with "it's too hard".
Re: To send data to a USB COM port do I need a USB driver?
You are certainly right that it won't map to an ISA COM port. Talking to a USB serial converter chip is complicated, since there is no standard. You would have torizxt wrote:Well that still leaves how to implement it. From what you are saying, it seems that no, the Arduino will not map to a COM port that I can simply outb to. So do I need a USB driver? How do I communicate with this serial chip?
- enumerate PCI to find the USB HCI(s) of your PC.
- initialize that HCI (the great thing about USB HCIs is that there are so many to choose from)
- enumerate USB to find the chip that you're interested in
- figure out what chip it is you are talking to
- talk to it in a way only the manufacturer knows, or maybe poach the driver from the Linux kernel
Carpe diem!
Re: To send data to a USB COM port do I need a USB driver?
Gonna go do that. Will keep you updated.
Skylight: https://github.com/austanss/skylight
I make stupid mistakes and my vision is terrible. Not a good combination.
NOTE: Never respond to my posts with "it's too hard".
I make stupid mistakes and my vision is terrible. Not a good combination.
NOTE: Never respond to my posts with "it's too hard".
-
- Member
- Posts: 148
- Joined: Sun Aug 23, 2020 4:35 pm
Re: To send data to a USB COM port do I need a USB driver?
In my experience, Arduinos register as a standard USB device, specifically a "Communications and CDC Control" device, or class 2.
I'm pretty sure the Arduino drivers (the ones you install when installing the IDE) are the ones that communicate with the device and make it appear as a "COM Device" in Windows.
I'm pretty sure the Arduino drivers (the ones you install when installing the IDE) are the ones that communicate with the device and make it appear as a "COM Device" in Windows.
My OS: TritiumOS
https://github.com/foliagecanine/tritium-os
void warranty(laptop_t laptop) { if (laptop.broken) return laptop; }
I don't get it: Why's the warranty void?
https://github.com/foliagecanine/tritium-os
void warranty(laptop_t laptop) { if (laptop.broken) return laptop; }
I don't get it: Why's the warranty void?
Re: To send data to a USB COM port do I need a USB driver?
Both. You'll need an USB driver to handle the USB bus in general, and a COM driver for the USB serial device.rizxt wrote:Meaning, if I wanted to send raw data the same way I send over my normal COM port, do I have to use a USB driver or a COM driver?
There's a loophole though if your PC is running in boot mode: BIOS int works for USB serial too, just as the UEFI SERIAL_IO_PROTOCOL service. In both case the firmware includes a complex USB driver, but provides the same interface as for the ISA UART chip. Similarly if you're using a mainstream OS (Win, Linux or MacOS) you have the same interface (SetCommState, termios etc.). But if you're about to use the USB serial from your OS, then you're on your own: you'll need a native driver just as @nullplan said.
Cheers,
bzt
Re: To send data to a USB COM port do I need a USB driver?
That's pretty epic. I'll have to put this project on hold, I just fried my Arduino. Accidentally put a 65w power supply in and it burnt the whole thing.
Skylight: https://github.com/austanss/skylight
I make stupid mistakes and my vision is terrible. Not a good combination.
NOTE: Never respond to my posts with "it's too hard".
I make stupid mistakes and my vision is terrible. Not a good combination.
NOTE: Never respond to my posts with "it's too hard".