Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Arduino: Application communication over built in USB?

The Arduino Nano (and other models) has a USB Connector on the pcb.

Can a Arduino Application (Code inside the loop() Function) communicate to a PC/Mac over the built in USB Channel?

like image 612
Thomas Avatar asked Oct 07 '22 22:10

Thomas


1 Answers

The board at the link you posted uses an FTDI USB to UART chip; the ATMega168 itself has no USB controller. The UART side of the FTDI chip is attached to the ATMega168's RXD/TXD UART pins. So from the point of view of the Arduino code, you are just communicating with a UART driven serial port.

From the PC end, the FTDI chip uses the USBSER.SYS driver to emulate a legacy UART serial port (A Virtual COM Port or VCP). You will be able to see this and which COM port it has been assigned to in Device Manager.

So in essence all you need to know is how to do serial port programming on both the PC and the Arduino and you are good to go.

like image 190
Clifford Avatar answered Oct 10 '22 03:10

Clifford