1
\$\begingroup\$

On the arduino homepage it says about Communication using the ArduinoMega256

The Arduino Mega2560 has a number of facilities for communicating with a computer, another Arduino, or other microcontrollers. The ATmega2560 provides four hardware UARTs for TTL (5V) serial communication. An ATmega16U2 (ATmega 8U2 on the revision 1 and revision 2 boards) on the board channels one of these over USB and provides a virtual com port to software on the computer (Windows machines will need a .inf file, but OSX and Linux machines will recognize the board as a COM port automatically. The Arduino software includes a serial monitor which allows simple textual data to be sent to and from the board. The RX and TX LEDs on the board will flash when data is being transmitted via the ATmega8U2/ATmega16U2 chip and USB connection to the computer (but not for serial communication on pins 0 and 1). A SoftwareSerial library allows for serial communication on any of the Mega2560's digital pins. The ATmega2560 also supports TWI and SPI communication. The Arduino software includes a Wire library to simplify use of the TWI bus; see the documentation for details. For SPI communication, use the SPI library.

So there is a second chip ATmega16U2 on the board which channels RX0/TX0 to a COM port via usb to my computer. So one wire is for receiving and one for sending to the COM port. So any software I write or which as been written for the Arduino talks over this COM port at a certain Baud rate and this is the only way Arduino and a computer can interact via usb. Is this correct?

Consequently, if I want to connect my arduino to a certain software with a known interface I must program a connecting puzzle piece between the COM port and said interface?

\$\endgroup\$
  • \$\begingroup\$ If you just need to send text io from unixy environs the command is called "screen" \$\endgroup\$ – Grady Player Feb 25 '13 at 14:27
1
\$\begingroup\$

Actually, you have two general options:

1) As I think you are suggesting, you can write some sort of intermediate software on the host system side which translates from the interface the existing software requires to the one the Arduino actually supports. In theory this should be a great solution; in practice some operating systems may make it difficult to install.

2) The ATMega16U2 USB interface microcontroller is reprogrammable, and the source code for the currently virtual com port firmware is available. Further, there are already source code examples out there for implementing different USB interface schemes in that chip (most may be aimed more at the Uno, but porting should be trivial)

\$\endgroup\$
  • \$\begingroup\$ Could you show me an example (link) implementing a USB interface or maybe tell me where I'm most likely to find them (git repos, arduino.cc ..?). \$\endgroup\$ – Flying Swissman Feb 25 '13 at 16:53
  • \$\begingroup\$ Sorry, I've tended to use other usb interface micros personally, so you'll have to search for the Arduino USB firmware projects yourself. \$\endgroup\$ – Chris Stratton Feb 25 '13 at 17:38
  • \$\begingroup\$ For future readers, I've found an example page: hunt.net.nz/users/darran \$\endgroup\$ – Flying Swissman Feb 26 '13 at 12:19

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.