How to control setup/hold times on FT232H MPSSE?

Breakout boards, sensors, other Adafruit kits, etc.

Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.
Locked
leonerd
 
Posts: 3
Joined: Thu Nov 05, 2015 11:20 am

How to control setup/hold times on FT232H MPSSE?

Post by leonerd »

When you're using the FT232H in UART mode, you can use "baud rate" to directly set the bitrate of that asynchronous serial signal.

When you're using sync. or async bitbang mode, the chip repurposes that baud rate setting to control the tick rate of clocking data in or out.

But what about when in MPSSE mode? There's a separate "clock divider" command in MPSSE, to control the bitrate of the serial data transfer in/out commands (those with command numbers < 0x80). However, this doesn't seem to affect the rate of execution of e.g. GPIO commands. Nor does this rate appear to be affected by the "baud rate".

More concretely: If I send GPIO commands to toggle the CS line of an SPI chip, those commands seem to execute in 625ns exactly. Regardless of the setting of either the baud rate, or the clock divider. This means that if you send simple commands to, say: "lower CS, clock out 4 bytes of data, raise CS", the CS setup time is 625ns between when it gets lowered and when the serial data starts, and another 625ns after the final bit of the last byte before it raises again. Good thing my SPI-talking chips are fast enough.

But what if they aren't? What if some chip's data sheet says it needs some number of microseconds, say, after CS before I start sending data? E.g. how would I implement a 5usec delay here? Is there any sort of timed delay in MPSSE? I couldn't see one. Nor could I see any mechanism to control the rate at which my buffered commands are executed.

User avatar
mailhouse
 
Posts: 107
Joined: Sat Jul 25, 2015 8:06 pm

Re: How to control setup/hold times on FT232H MPSSE?

Post by mailhouse »

in the mpsse basics tech note example code it sends the same command repeatedly to wait a given number of uSec

you could also usleep() to kill time

leonerd
 
Posts: 3
Joined: Thu Nov 05, 2015 11:20 am

Re: How to control setup/hold times on FT232H MPSSE?

Post by leonerd »

Yes - I see that the Adafruit I2C-over-MPSSE driver does indeed just repeat output of the GPIO setting commands a number of times, in order to effect a kind of delay. It's a little hackish but it does seem to work. I was just hoping there'd be some (perhaps-undocumented) "timed delay" command, where I could tell the chip to literally do nothing for some number of clock cycles.

Ahwell; this will have to do...

leonerd
 
Posts: 3
Joined: Thu Nov 05, 2015 11:20 am

Re: How to control setup/hold times on FT232H MPSSE?

Post by leonerd »

Oh additionally I even see the same thing in FTDI's own application note; "AN_255 - USB to I2C Example using the FT232H and FT201X devices".

I wonder if it just didn't occur to them that people might want a timer.

actually that said, I wonder what happens if you try to use a command that's neither read nor write - i.e. something around the 0x00 range. Maybe I'll try that just to see...

Locked
Please be positive and constructive with your questions and comments.

Return to “Other Products from Adafruit”