本帖最后由 testcode 于 2010-9-17 06:32 编辑
【摘录】FT232的非典应用:
http://www.sparkfun.com/commerce/news.php?id=386
We all know the popular FT232R from FTDI Chip is a very common solution for embedding USB in your project. The royalty free drivers, built in EEPROM and oscillator already create enough value in the FT232R chip to be used alone for USB to UART communication. But...
Did you know the FT232R offers bit bang modes on its IO pins? What this means is that the FT232R can convert some of its IO pins into 8-bit bi-directional data lines. These lines can be used to simulate a serial bit stream, essentially turning the FT232R into an IO expander with a USB interface.
Our friend, Michael from chinwah-engineering.com, has written detailed explanations on how to bit bang SPI and parallel interfaces on an FT232R.
There's more! Michael has created quite a few tutorials on how to use the FT232R with a range of sensors. Here are a couple that use SparkFun parts.
How is the data presented from the sensors? Michael has written some C# applications (available on his tutorial pages) and combined them with public code (from FTDI and shareware) to create a nice graphical interface to configure the devices and view the data.
Bit banging on an FT232R the way Michael has done can be beneficial for a very good reason. If you are looking for a relatively easy to use, low bill of materials (BOM) cost for a USB to SPI or parallel bridge, this is a very good option. Also since the FTDI interface works cross-platform, your system can be very versatile.
If you are interested in how to write C code to control an FT232R, Hack-a-Day wrote a great post a while back on how to write C code to blink an LED with an FT232, check it out here. |