Arduino Leonardo serial communication - serial-port

The USB port on my Arduino Leonardo broke off and I don't have a USB-to-serial adapter. Is it possible to wire a USB cable to the TX, RX, Vin, and GND pins so that I can use serial communication between it and my computer?
(It already has my sketch on it.)

Yes, you can solder a USB cable (just cut the type B end off of a standard A-B cable) onto the exposed pads where the port used to be.
Unlike other Arduinos, the Leonardo does not have a built-in USB-to-serial converter the drives the USB port. The microcontroller firmware provides USB device-mode support directly. It also has serial I/O pins.

Related

On Arduino Micro, is there a way to use the "Serial" port from pin connections?

Micro and Leonardo have two serial ports, denoted by "Serial" and "Serial1."
I can use Serial1 through the RX and TX pins for my sensor, a TF Mini, and still get output to the Arduino IDE through the Serial connection via USB.
I would like to, instead send that output via Bluetooth, which also requires a serial connection. I have attempted Software Serialization solutions for the sensor, without success.
Is it possible to access both Serial and Serial1 connections through the pins?
The Serial port in the Arduino Leonardo is virtual, so there is no physical way to interact with it, you'll need to do bit banging in other GPIO pins to simulate this connection. By doing this, it will slow down your sketch if you are doing more complicate stuff. And if you add an extra connection via Serial1 port, will be worse.

Future Technology Devices International communication

Will FTDI always converts the data into serial or any other types of transfers?
Will FTDI always converts the data into serial or any other types of
transfers?
Answer to your question in short. FTDI chips implements USB protocol stack that is serial.
The FTDI cable is a USB to Serial (TTL level) converter which allows for a simple way to connect TTL interface devices to USB. The VCC pins of this FTDI cable are configured to operate at 5V with 3.3V I/O.
What happens inside the USB?
USB micro controller inside which talks a proprietary protocol over USB (hence the need for drivers) and converts that into "normal" UART signals and back again.

Atmega328p sending data through USB

I'm using the atmega328p and I would like to send data through the USB to use like the serial monitor in the arduino for code testing purposes, so I doesn't need an LCD to print data. I used USART when simulating my code in proteus, and I believe there is a similar approach using the data pins of the USB connector.
When you send data over the UART on the ATmega328, it is converted to serial over USB by the Arduino. The Arduino will enumerate as a virtual serial port on your computer, and you can connect to this with the serial terminal of your choice (screen, PuTTY, RealTerm, etc). The Arduino IDE also has an built-in serial monitor. Note that you cannot use this serial connection while programming the Arduino via the USB port, as it will interfere with the programming.
If you are using the hardware UART for other purposes, then you can use an external TTL serial-USB converter and SoftwareSerial on the Arduino.

Arduino can not communicate serial (MIDI), when the USB is unplugged

I wanted to test the arduino MIDI example code:
https://www.arduino.cc/en/Tutorial/Midi
I tried it with a 9V 500mA AC/DC adapter, and i used a MIDI-USB cable to get the MIDI messages to my software (Hauptwerk).
When the Arduino's USB cable was connected to the computer (the MIDI-USB cable was connected too) it worked fine, but when I tried with the adapter and plugged out Arduino's USB cable, the software didn't received the MIDI messages.
To the serial communication I used the TX-pin like in the tutorial.

Bypassing powered on FTDI. Connect directly to RX/TX pins to drive externally

I'm working with a driver board which communicates with a PC program via USB -> FTDI -> TX/RX into the microcontroller. The serial pins are not broken out on the board and I need to talk to the board from another microcontroller (like Arduino). My plan is to just solder directly to the RX/TX pins on the microcontroller despite the fact that the FTDI is powered on and RX/TX of the FTDI will be electrically connected to those pins. I will not be transmitting anything via USB. My assumption is that the FTDI chip will be passive and I can just drive those pins from my Arduino.
Will this cause me any issues? I'm just concerned if the FTDI passively drives those pins low or high, I'll get "smoke" if I follow through with my plan. Perhaps I should put some resistors on my Arduino's RX/TX just as a safeguard.
It's very possible some of my logic is flawed here. Thanks in advance for your advice!!
Cheers
You need to check with the particular FTDI chip you're using on that board.
Some FTDI chips support RS485 and because of the required multidrop capability they operate as open-drain allowing to connect multiple devices.
Even if this solves your hardware problem, you still need to consider how the (live) FTDI chip may respond to your 'unexpected' incoming (RX) data stream. For example, possible XON/XOFF flow control appearing on TX especially since there won't be a consumer from the PC side and the internal FTDI buffers will eventually fill up.

Resources