Author Topic: Interfacing a microcontroller serial with a FTDI usb device  (Read 8048 times)

0 Members and 1 Guest are viewing this topic.

Offline sean87Topic starter

  • Regular Contributor
  • *
  • Posts: 150
  • Country: nl
  • EE WannaBee
    • EMBEDONIX
Interfacing a microcontroller serial with a FTDI usb device
« on: December 13, 2012, 10:26:43 pm »
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.JPG

Can 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?
EMBEDONIX - Embedded Systems, Linux and good stuff!
 

Online Psi

  • Super Contributor
  • ***
  • Posts: 9953
  • Country: nz
Re: Interfacing a microcontroller serial with a FTDI usb device
« Reply #1 on: December 13, 2012, 10:37:30 pm »
Can I wire directly to the USB port and connect it to a microcontroller?

no, (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.

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 ?
Ah, 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.

If not, I think if I find the TX/RX pins of its microcontroller and connect that pins to PIC?

Yes, 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.
« Last Edit: December 13, 2012, 10:45:06 pm by Psi »
Greek letter 'Psi' (not Pounds per Square Inch)
 

Offline sean87Topic starter

  • Regular Contributor
  • *
  • Posts: 150
  • Country: nl
  • EE WannaBee
    • EMBEDONIX
Re: Interfacing a microcontroller serial with a FTDI usb device
« Reply #2 on: December 13, 2012, 10:47:27 pm »
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.
EMBEDONIX - Embedded Systems, Linux and good stuff!
 

Online Psi

  • Super Contributor
  • ***
  • Posts: 9953
  • Country: nz
Re: Interfacing a microcontroller serial with a FTDI usb device
« Reply #3 on: December 13, 2012, 11:12:10 pm »

The pic is 5v and this MSP430 is 3.3 I guess. I would need a converter also.


For 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)


finding and soldering wires to that tiny chip is a HOLAPOLA work.
yeah, it can take some skill.
« Last Edit: December 13, 2012, 11:17:31 pm by Psi »
Greek letter 'Psi' (not Pounds per Square Inch)
 

Offline free_electron

  • Super Contributor
  • ***
  • Posts: 8517
  • Country: us
    • SiliconValleyGarage
Re: Interfacing a microcontroller serial with a FTDI usb device
« Reply #4 on: December 13, 2012, 11:13:18 pm »
ftdi has a usb HOST controller now as well. so you could slap that on the other side to go usb to RS232 ...
Professional Electron Wrangler.
Any comments, or points of view expressed, are my own and not endorsed , induced or compensated by my employer(s).
 

Online Psi

  • Super Contributor
  • ***
  • Posts: 9953
  • Country: nz
Re: Interfacing a microcontroller serial with a FTDI usb device
« Reply #5 on: December 13, 2012, 11:14:08 pm »
ftdi has a usb HOST controller now as well. so you could slap that on the other side to go usb to RS232 ...

Interesting, is that a new chip or new firmware for existing ftdi chips?
Greek letter 'Psi' (not Pounds per Square Inch)
 

Offline mikeselectricstuff

  • Super Contributor
  • ***
  • Posts: 13748
  • Country: gb
    • Mike's Electric Stuff
Re: Interfacing a microcontroller serial with a FTDI usb device
« Reply #6 on: December 13, 2012, 11:26:45 pm »
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. 
Youtube channel:Taking wierd stuff apart. Very apart.
Mike's Electric Stuff: High voltage, vintage electronics etc.
Day Job: Mostly LEDs
 

Offline sean87Topic starter

  • Regular Contributor
  • *
  • Posts: 150
  • Country: nl
  • EE WannaBee
    • EMBEDONIX
Re: Interfacing a microcontroller serial with a FTDI usb device
« Reply #7 on: December 13, 2012, 11:36:35 pm »
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. 

Well thanks mike but thats far beyond my knowledge :D hate using USB ...I spent couple of month running usb on PIC18F4550 and it was waste of time :( The 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?



EMBEDONIX - Embedded Systems, Linux and good stuff!
 

Offline free_electron

  • Super Contributor
  • ***
  • Posts: 8517
  • Country: us
    • SiliconValleyGarage
Re: Interfacing a microcontroller serial with a FTDI usb device
« Reply #8 on: December 14, 2012, 01:04:22 am »
no its not the vinculum ! that is a different beast.

FT313H Host controller.

and there is one specifically for Android platforms : FT311D
Professional Electron Wrangler.
Any comments, or points of view expressed, are my own and not endorsed , induced or compensated by my employer(s).
 

Online Mechatrommer

  • Super Contributor
  • ***
  • Posts: 11653
  • Country: my
  • reassessing directives...
Re: Interfacing a microcontroller serial with a FTDI usb device
« Reply #9 on: December 14, 2012, 01:51:57 am »
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)
why 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.

Can I wire directly to the USB port and connect it to a microcontroller?
if you are talking pc usb port... ftdi chip is meant to connect directly to it.

Quote
The pic is 5v and this MSP430 is 3.3 I guess. I would need a converter also.
there must be 5V-3.3V regulator on board. bypassing the regulator should get you to the native usb 5v.

Quote
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 ?
yes. but i'm not sure what ftdi chip is that, i assume its the normal pc usb to serial chip.

Quote
If not, I think if I find the TX/RX pins of its microcontroller and connect that pins to PIC?
yes but please disconnect the pin from original mcu first?

above all, get the datasheet for the said ftdi chip first and study it.
Nature: Evolution and the Illusion of Randomness (Stephen L. Talbott): Its now indisputable that... organisms “expertise” contextualizes its genome, and its nonsense to say that these powers are under the control of the genome being contextualized - Barbara McClintock
 

Offline T4P

  • Super Contributor
  • ***
  • Posts: 3697
  • Country: sg
    • T4P
Re: Interfacing a microcontroller serial with a FTDI usb device
« Reply #10 on: December 14, 2012, 04:34:31 pm »
The STM32 L1,F1, F2 and F4 series have documented USB protocols ...
However only certain STM32s have USB FS
STM32F102 onwards only, 100 and 101 have no USB support
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf