lagerdata / python-ft4222

Forked from https://gitlab.com/msrelectronics/python-ft4222
MIT License
8 stars 1 forks source link

SPI IDLE_LOW not functioning #4

Open sjnaylor59 opened 1 year ago

sjnaylor59 commented 1 year ago

No change in SS0 when changing between Cpol.IDLE_LOW and Cpol.IDLE_HIGH. Both show SS0 idling high.

Using:

#initiate ft4222 channel
spiA = ft4222.openByDescription('FT4222 A')

#set channel to SPI mide
spiA.spiMaster_Init(Mode.DUAL, Clock.DIV_32, Cpha.CLK_LEADING, Cpol.IDLE_LOW, SlaveSelect.SS0)

spiA.spiMaster_SetLines(Mode.SINGLE) 

And UMFT4222EV HW rev. 1.1

charkster commented 8 months ago

@sjnaylor59 Cpol only configures the clock (the "C' stands for clock). SS0 polarity is controlled by the eeprom settings in FT4222. You need to use FT_PROG to change those settings for your part (it is not a dynamically controlled by the API... It should be, but isn't). It is very rare to find a device that uses an active-high slave select. https://www.ftdichip.com/Support/Documents/AppNotes/AN_124_User_Guide_For_FT_PROG.pdf Page 20, see slave select pullups/pulldowns/drive strength etc...