Skip to content

Instantly share code, notes, and snippets.

@billiegoose
Created July 19, 2013 01:37
Show Gist options
  • Star 15 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save billiegoose/6034455 to your computer and use it in GitHub Desktop.
Save billiegoose/6034455 to your computer and use it in GitHub Desktop.
Use your Arduino as a direct USB to serial converter! Tested on an Arduino Duemilanove. Probably 3.3V TTL but worked for communicating with my supposedly 5V TTL HerkuleX servo at 115200 baud.
/*
* Arduino Serial Bypass - use an Arduino as a dumb USB 2 Serial Converter
*
* This code makes the Arduino not interfere with pins 0 and 1
* which are connected to RX and TX on the FTDI chip. This allows
* the data coming from the FTDI USB 2 Serial chip to flow directly
* to another device. Since RX and TX are labeled from the Arduino's
* point of view, don't cross the wires, but plug the device's
* RX wire into the RX pin 0 and the TX wire into the TX pin 0.
*
* Because this is a direct hardware connection, high baud rates
* like 115200 are not a problem like they are with SoftwareSerial.
*
* Credit goes to "ihsan". His original website is down at the time
* of writing, but I found the text archived on:
* http://web.archive.org/web/20101027200300/http://students.sabanciuniv.edu/kehribar/?p=19
*/
void setup()
{
pinMode(0,INPUT);
pinMode(1,INPUT);
}
void loop()
{
}
@Mediacj
Copy link

Mediacj commented Oct 27, 2015

Really works great and much more stable with esp8266, thanks for sharing!

@zoobab
Copy link

zoobab commented Apr 7, 2017

Copy link

ghost commented Apr 6, 2018

Nothing in setup() or loop() also silences the MCU, and is exactly the same.

@joshuarli
Copy link

You can also achieve this by shorting the RESET pin if you have a jumper wire handy.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment