Interfacing a microcontroller serial  with a  FTDI usb device - Page 1
Forum section: electronics / beginners

author: sean87
author_rank: Regular Contributor
timestamp: December 13, 2012, 10:26:43 pm
content: Hi guys,I have one of these babies. When connected to PC, it is being recognized as a serial port. (It is a TI MSP430 that comes with FTDI chip)http://inst.eecs.berkeley.edu/~cs194-5/sp08/lab1/telosb.JPGCan I wire directly to the USB port and connect it to a microcontroller? I mean it should be connected to a real usb port to work as a COM port, or if I wire up to usb lines of it (Well this is using a FTDI chip) will it work as a TX/RX ?If not, I think if I find the TX/RX pins of its microcontroller and connect that pins to PIC?

author: Psi
author_rank: Super Contributor
timestamp: December 13, 2012, 10:37:30 pm
content: Quote from: sean87 on December 13, 2012, 10:26:43 pmno, (well, not easily), you'd need to write a USB layer and driver in software on the micro so it could talk USB to the FTDI chip.There's no point in doing that, its extremely complicated for no real reason.Quote from: sean87 on December 13, 2012, 10:26:43 pmAh, do you mean if you have a second FTDI chip and wire them usb->usb ?na, i'd be very surprised if that worked.AFAIK the chip is a usb device only, it can't function as a usb host.For USB to work there must always be a host and a device.Quote from: sean87 on December 13, 2012, 10:26:43 pmYes, that should work fine, but you'll probably want to disconnect the existing microcontroller TX pin.Otherwise your PIC will try and fight with it.Although, i guess it may work without that as long as the existing micro is in reset state (not running) since the pin probably goes to highZ in that state.Also you'll want to check the logic levels of everything involved to make sure you're not trying to push 5V into a 3.3V device, or to handle it if you are.

author: sean87
author_rank: Regular Contributor
timestamp: December 13, 2012, 10:47:27 pm
content: Thanks, I guess I would try to find the UART pins of MSP430 that goes into that FTDI chip and hijack it right there.The pic is 5v and this MSP430 is 3.3 I guess. I would need a converter also.Hope it works! But finding and soldering wires to that tiny chip is a HOLAPOLA work.

author: Psi
author_rank: Super Contributor
timestamp: December 13, 2012, 11:12:10 pm
content: Quote from: sean87 on December 13, 2012, 10:47:27 pmFor a hobby project you can feed 3.3V into a 5V micro input and it will be quite happy.For the 5V output you just need a 3.3V zener diode and a resistor to level shift 5V to 3.3V. (Or if you want to be ultra cheap you can get away with just a ~10k resistor in series between the 5V output and 3.3v input. That's really bad practice though)Quote from: sean87 on December 13, 2012, 10:47:27 pmyeah, it can take some skill.

author: free_electron
author_rank: Super Contributor
timestamp: December 13, 2012, 11:13:18 pm
content: ftdi has a usb HOST controller now as well. so you could slap that on the other side to go usb to RS232 ...

author: Psi
author_rank: Super Contributor
timestamp: December 13, 2012, 11:14:08 pm
content: Quote from: free_electron on December 13, 2012, 11:13:18 pmInteresting, is that a new chip or new firmware for existing ftdi chips?

author: mikeselectricstuff
author_rank: Super Contributor
timestamp: December 13, 2012, 11:26:45 pm
content: Vinculum VNC2 - microcontroller with USB host.However there are also some PICs with USB host at similar prices and more package options (Pic24FJxxGBxxx), and full source code for all the USB stuff.

author: sean87
author_rank: Regular Contributor
timestamp: December 13, 2012, 11:36:35 pm
content: Quote from: mikeselectricstuff on December 13, 2012, 11:26:45 pmWell thanks mike but thats far beyond my knowledgehate using USB ...I spent couple of month running usb on PIC18F4550 and it was waste of timeThe microchip documentation is evil toward rookies.I just did the soldering and HOLA...I could make the connection.Now there is one big problem.The MSP430 is internally programmed to send the data at 115200 baud rate. and the pic is programmed to receive at 57600 baud rate. Well I checked with scope and I receive at 115200 a meaningful signal.Is there any baud rate converter/buff IC out of the shelf that can input 115200 and output 57600?

author: free_electron
author_rank: Super Contributor
timestamp: December 14, 2012, 01:04:22 am
content: no its not the vinculum ! that is a different beast.FT313H Host controller.and there is one specifically for Android platforms : FT311D

author: Mechatrommer
author_rank: Super Contributor
timestamp: December 14, 2012, 01:51:57 am
content: Quote from: sean87 on December 13, 2012, 10:26:43 pmwhy dont you buy a $5 FTDI USB->Serial module it should be more suitable for generic mcu use. saving your baby, its look more usefull for other stuff. or if you want to salvage the ftdi chip to make a usb-serial converter, there's schematic online or from datasheet on how to do that.Quote from: sean87 on December 13, 2012, 10:26:43 pmif you are talking pc usb port... ftdi chip is meant to connect directly to it.Quotethere must be 5V-3.3V regulator on board. bypassing the regulator should get you to the native usb 5v.Quoteyes. but i'm not sure what ftdi chip is that, i assume its the normal pc usb to serial chip.Quoteyes but please disconnect the pin from original mcu first?above all, get the datasheet for the said ftdi chip first and study it.

author: T4P
author_rank: Super Contributor
timestamp: December 14, 2012, 04:34:31 pm
content: The STM32 L1,F1, F2 and F4 series have documented USB protocols ...However only certain STM32s have USB FSSTM32F102 onwards only, 100 and 101 have no USB support