libftdi Archives

Subject: mpsse sync with bad command

From: "Matt" <lists@xxxxxxxxxxxxxxx>
To: libftdi@xxxxxxxxxxxxxxxxxxxxxxx
Date: Mon, 5 Dec 2011 12:42:48 -0000
Hi all,

I have 2 x MPSSEs configured for I2C and JTAG use with libftdi 0.19 on
linux. I configure each mpsse using a common function which makes the
following series of libftdi api calls:

ftdi_init(&mpsse->ftdi);
ftdi_set_interface(&mpsse->ftdi, mpsse->channel);
ftdi_usb_open(&mpsse->ftdi, cfg->vid, cfg->pid);
ftdi_usb_reset(&mpsse->ftdi);
ftdi_set_latency_timer(&mpsse->ftdi, LATENCY_MS);
ftdi_write_data_set_chunksize(&mpsse->ftdi, CHUNK_SIZE);
ftdi_read_data_set_chunksize(&mpsse->ftdi, CHUNK_SIZE);
ftdi_set_bitmode(&mpsse->ftdi, 0, BITMODE_RESET);
ftdi_set_bitmode(&mpsse->ftdi, 0, BITMODE_MPSSE);
ftdi_usb_purge_buffers(&mpsse->ftdi);

After this, I synchronise the mpsse by sending a bad command to it. The
synchronisation routine sends one byte (0xAA) to the mpsse, reads back two
bytes and then checks if bytes 0 and 1 are 0xFA and 0xAA respectively.
This works as expected.

However, what I have noticed since enabling the JTAG channel (and
therefore the performing the set up and configuration of the second mpsse)
is that sending the bad command to the JTAG mpsse appears to prevent the
I2C mpsse from working completely (I fail to read an ack from an i2c slave
device). If I omit synchronising the mpsse on the JTAG channel there is no
problem.

Each mpsse is accessed via its own ftdi context structure and initialised
with the calls above. I'm of the understanding that each mpsse can be
accessed separately provided a separate ftdi context is used (which I do).

Why does sending a bad command to a different mpsse cause this? Does
anybody have any ideas? Thoughts much appreciated.

Thanks,
--  Matt


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

Current Thread
  • mpsse sync with bad command, Matt <=