Archive

Archives pour 10/2011

Using Arduino as serial to usb converter

As some might know there are several FTDI chip based usb to serial converter breakout boards. Sparkfun produced several of them through time , and recently Adafruit launched a new product called ”FTDI friend”. Those are the well known ones. But if you have an Arduino board with usb connectivity ( like Duemilanove ) , you don’t need to buy any of those for basic usb to serial converting tasks. If you have a Seeeduino, you are luckier!

First some technical stuff. The Atmel chips inside the Arduino boards come with a special bootloader firmware. That allows user to program the chip without needing of any other ICSP , JTAG , etc.. programmers. That bootloader firmware uses hardware UART module of the chip. So you can program the chip with a standart RS232 cable.

Early versions of Arduino (i guess that one called Arduino Serial) used MAX232 level converter chip to match computer’s RS232 signals to TTL signal for loading new sketches(actually, firmwares). Later on, since RS232 ports started to dissapear from notebooks , they started to use FTDI chips to create serial port connection between computer and the chip. And here comes the story.

If we look at the schematic of Duemilanove, we will see that the RX and TX pins are connected to the FTDI chip (as we expected) and theese pins are pinned out at the Arduino board as pin 0 and pin 1 . That means we can use those pins for using the FTDI chip itself.

To do that, you don’t need to unplug the Atmel chip from its place. Before using your Arduino board as usb-serial converter you can upload that piece of code.
void setup()
{
pinMode(0,INPUT);
pinMode(1,INPUT);
}
void loop()
{

}
By doing that, you are guaranteed that Atmel chip wont interfere your communication between FTDI chip and other device.

Also, if you have a Arduino clon named Seeeduino ,like me, you can talk with your external devices both with 3.3V and 5V levels. It has ability to work both 3.3 volts and 5 volts.

Sparkfun sells 3v and 5v versions of FTDI breakout board seperately and FTDI Friend has ability to work at both levels but you need to make a little jumper soldering to change voltage levels. At Seeduino board, it is simple as changing a switch.

I hope it helps someone out there.

Categories: Geek Tags: , , ,

Devinez la suite logique

Je suis tombé sur cette suite logique que j’ai bien aimé.
Saurez-vous trouver la solution ?

Categories: Geek Tags: