interfacing with usb (FT232R)

Go To Last Post
11 posts / 0 new
Author
Message
#1
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

I have an application where I want to interface with usb device. That is to say, read usb in to a mega chip. I'd like not to do the work on the mega chip and instead use another device to get the USB data (at least for mice,keyboards,and game pads) in to serial data. I came across this

 

https://www.digikey.com/product-...

 

I have used FT before to go from serial to usb but I didn't know you could go the other way around. Does anyone have experience with this? Would I be right in guessing I could get USB data from this chip? Will I get just the raw data or all of the USB info(not needed)?

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

You seem very confused an FT232 (clue in name - "232" hails from the days of RS232 - the electrical standard for UART) is a chip with only one function. On one side it has USB that ONLY appears as a CDC-ACM class USB device. That is usually presented to a PC and within that the device then looks like a "virtual serial port". (CDC= Communications Device Class, ACM= Abstract Control Model). The other side of the FT232 presents "RS232" signalling - that is UART signals - initially at TTL level though often this is then routed through a MAX232 to take it to +12/-12V signalling.

 

But you said:

S_K_U_N_X wrote:
read usb in to a mega chip
now perhaps it's just your terminology but in the world of USB where you have "hosts" (often PCs) that generally read data and "devices" that generally produce data to be read it seems to me you may be saying you want your AVR to act as a USB host. This is especially true when you then go on to say:

S_K_U_N_X wrote:
get the USB data (at least for mice,keyboards,and game pads)

Those are all "HID class devices". To read/interface with them would usually require a USB "host" too.

 

No AVR(8) offers true host capability but there are two models: AT90USB647 and AT90USB1287 that offer a more limited form of host mode called "On The Go" (OTG). OTG was actually designed so you could have devices such as cameras into which you could plug USB memory sticks and that kind of thing. So it is "host" but it is "host with a lot of the complexity" (often only found in Windows and Linux) removed.

 

So if you pick a 647/1287 then, yes you can use it either in device modes - so it can appear to a host such as a PC as all kinds of USb devices (HID, CDC, MSD, Printer, MIDI etc) or you can use it in OTG mode and then it can act as host for devices like keyboards and mice. It will be the "master" to the keyboard/mouse "slave".

 

FTDI do produce a standalone chip that can offer similar kinds of hosting services to micros that do not have host mode (the other AVR mega chips for example). That is called Vinculum:

 

http://www.ftdichip.com/Products...

 

Looking at their site it seems the original Vinculum may have been replaced by a "better" Vinculum II:

 

http://www.ftdichip.com/Products...

 

As it says:

The device features a powerful 16-bit MCU core, with embedded 256KB Flash and 16KB RAM memory.

So actually this is probably just like a bit of a "souped up" 647/1287 kind of device.

 

If you are familiar with AVR I'd stick with 647/1287. In fact I'd stick with those and use LUFA. When Dean developed LUFA I believe he did most of the work on the AT90USB1287 in  fact. Actually the very device he used was the original version of:

 

http://www.microchip.com/Develop...

 

For $30 that's quite a formidable little development board - it even has a small joystick and not just a red LED but two bi-color LEDs!

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

clawson wrote:
it seems the original Vinculum may have been replaced by a "better" Vinculum II

That must be at least 5 years ago?!

 

EDIT: At least 8, in fact: http://ftdi.newsweaver.co.uk/new...

 

Some other options:

 

http://www.hobbytronics.co.uk/usb-host - based on PIC

 

Lots of Cortex-M - including Atmel Microchip SAM

 

There are USB Host shields available for Arduino; eg,

https://www.proto-pic.co.uk/usb-host-shield.html

 

Top Tips:

  1. How to properly post source code - see: https://www.avrfreaks.net/comment... - also how to properly include images/pictures
  2. "Garbage" characters on a serial terminal are (almost?) invariably due to wrong baud rate - see: https://learn.sparkfun.com/tutorials/serial-communication
  3. Wrong baud rate is usually due to not running at the speed you thought; check by blinking a LED to see if you get the speed you expected
  4. Difference between a crystal, and a crystal oscillatorhttps://www.avrfreaks.net/comment...
  5. When your question is resolved, mark the solution: https://www.avrfreaks.net/comment...
  6. Beginner's "Getting Started" tips: https://www.avrfreaks.net/comment...
Last Edited: Tue. Jun 19, 2018 - 11:54 AM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Yeah I was looking for host emulation. So USB 2.0 to UART (RS232) Bridge  means USB 2.0 host to UART (RS232) Bridge and not USB device 2.0 to UART (RS232) Bridge. I didn't know the 1287 had a host mode. That maybe be suffice.

 

though I kind of like the USB Host Controller IC - SSOP

 

Last Edited: Tue. Jun 19, 2018 - 11:58 AM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

The "USB 2.0 to UART" thingy is a USB device; so it needs to plug into a USB host - ie, your computer.

Top Tips:

  1. How to properly post source code - see: https://www.avrfreaks.net/comment... - also how to properly include images/pictures
  2. "Garbage" characters on a serial terminal are (almost?) invariably due to wrong baud rate - see: https://learn.sparkfun.com/tutorials/serial-communication
  3. Wrong baud rate is usually due to not running at the speed you thought; check by blinking a LED to see if you get the speed you expected
  4. Difference between a crystal, and a crystal oscillatorhttps://www.avrfreaks.net/comment...
  5. When your question is resolved, mark the solution: https://www.avrfreaks.net/comment...
  6. Beginner's "Getting Started" tips: https://www.avrfreaks.net/comment...
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

S_K_U_N_X wrote:
though I kind of like the USB Host Controller IC - SSOP
Oh lots of vendors have "host controllers". In the past I've worked in projects where we used a device from Cypress(*) for example. I was simply saying that if you are familiar with AVR you might want to stick in AVR territory and combine your project controller with the USB host facilities in a single silicon. Of course, it's true that the "USB bits" in a device like 647/1287 will be "unknown territory" for most AVR users. But this is kind of why LUFA exists - so all the complexity is hidden and Dean just offers and easy to use interface that can be accessed from your own project.

 

(*) EDIT: a quick Google suggest that Cyrpess no longer have the chip I used but as that was almost 20 years ago I'm maybe not entirely surprised but they do appear to have "EZ-OTG" - which could fit the bill?

Last Edited: Tue. Jun 19, 2018 - 12:06 PM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

The "USB 2.0 to UART" thingy is a USB device; so it needs to plug into a USB host - ie, your computer.

 

Yeah I had it backwards

 

Last Edited: Tue. Jun 19, 2018 - 12:25 PM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Oh lots of vendors have "host controllers". In the past I've worked in projects where we used a device from Cypress for example. I was simply saying that if you are familiar with AVR you might want to stick in AVR territory and combine your project controller with the USB host facilities in a single silicon. Of course, it's true that the "USB bits" in a device like 647/1287 will be "unknown territory" for most AVR users. But this is kind of why LUFA exists - so all the complexity is hidden and Dean just offers and easy to use interface that can be accessed from your own project.

 Sure and the solution is still sound. It really will come down to if have access to the PIC code.

 

edit, never-mind they break that all down in the description .

Last Edited: Tue. Jun 19, 2018 - 12:26 PM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

That EZ-OTG Looks much nicer, how wold one go about programming it.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 1

S_K_U_N_X wrote:
how wold one go about programming it.
I'm sort of guessing Cypress probably put a lot of effort into writing datasheets and perhaps even application notes with that very intention in mind ;-)

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Ahh, its API based. Makes sense.