libftdi Archives

Subject: Mixing SPI and Bitbang on FTDI4232, how to do it ?

From: "Edwin van den Oetelaar (via gmail.com)" <oetelaar.automatisering@xxxxxxxxx>
To: libftdi@xxxxxxxxxxxxxxxxxxxxxxx
Date: Thu, 01 Oct 2009 13:39:30 +0200
Hello everybody,

I am new to this library.
I have a FTDI4232 device (4 ports A,B can be MPSSE)
What I want is to use SPI mode to send data into my device
(using pins SK/DO/DI/CS on port A)
and use the remaining pins (Port A :GPIOL0..GPIOL3) to do other stuff like select a target chip.

I managed to use the ports in bitbang mode like so :

ftdi_usb_open(&ftdic, 0x0403, 0x6011)
ftdi_enable_bitbang(&ftdic, OUPUTMASK)
ftdi_write_data(&ftdic, data, sizeof(data))

This outputs the bytes in bitbang mode at about 200KHz.

When setting the bitmode, I get nothing (I can see) on the pins.

ftdi_set_bitmode(&ftdic,OUPUTMASK,BITMODE_MPSSE)
ftdi_write_data(&ftdic, data, sizeof(data))

No bits (leds) flash. My expectation was that it would clock the data out somehow using SPI.

What is the correct way to use SPI mode and how to assert the GPIO pins then?

Thanks for reading this far ;-)

Best regards,
Edwin van den Oetelaar


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