libftdi Archives

Subject: Re: ft4232h & control of peripherals

From: "Matt" <lists@xxxxxxxxxxxxxxx>
To: libftdi@xxxxxxxxxxxxxxxxxxxxxxx
Date: Wed, 16 Nov 2011 13:52:19 -0000
>
> Matt wrote:
>>
>> If I can configure the device as per items 1,2 & 3 above using
>> libftdi then this should solve my problems. From looking at the code
>> it's
>> not clear how I can do this, though. If anybody else out there could
>> give
>> me a few pointers I'd very much appreciate it.
>>
>
> To configure the MPSSE for I2C you basically have to:
>
> 1) Put the FTDI chip into MPSSE mode using ftdi_set_bitmode()
> 2) Configure the MPSSE clock frequency
> 3) Enable the 3-phase clock
> 4) Configure the DO/DI/SK pins as inputs/outputs
> 5) Ensure that when you send data you set the MPSSE_WRITE_NEG bit, and
> clear
> that bit when reading
> 6) After each byte you read/write send a single clock bit for the ACK/NACK
>
> There are a few other details, like ensuring your I2C start and stop
> conditions are properly met and I'm sure a few others that I'm forgetting
> at
> the moment. Libmpsse uses libftdi to do SPI and I2C, so you can look at
> that
> code for an example (http://libmpsse.googlecode.com). The I2C examples on
> FTDI's Web site are also good.

Yes, I'm looking at libmpsse now as it happens. For JTAG I've found some
info from the xc3sprog project on sourceforge. This also uses libftdi.
Between this, libmpsse and the 'normal' serial control (there is an
example in the libftdi src for reading so using it for writing should
hopefully be trivial), I should be able to get to where I need to be.

Thanks for the info all. Nice to post to an active forum :-)

Cheers,
--  Matt


--
libftdi - see http://www.intra2net.com/en/developer/libftdi for details.
To unsubscribe send a mail to libftdi+unsubscribe@xxxxxxxxxxxxxxxxxxxxxxx   

Current Thread