LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

FT4222.dll GPIO Write returns GPIO Write Not Supported

Solved!
Go to solution

I'm getting error when using GPIO Write Function from FT4222.dll.

I'm using FT4222.dll version 1.4.4.44

 

Calling function like this:

AndrazS_0-1644404460039.png

 

The prototype in datasheet is:

AndrazS_1-1644404494000.png

 

Function is always returning me error 1015 and I think this is "GPIO Write not supported"

AndrazS_2-1644404549770.png

 

AndrazS_3-1644404571404.png

 

Please help!

 

 

0 Kudos
Message 1 of 5
(1,760 Views)
Solution
Accepted by topic author AndrazS

The FTDI Application Node AN-329 explicitly states:

 

FT4222_GPIO_WRITE_NOT_SUPPORTED: Direction on this port is not writing direction

 

So you may have forgotten to configure the according port to be an output port before trying to call this function?

Rolf Kalbermatter
My Blog
0 Kudos
Message 2 of 5
(1,755 Views)

Hello actually this really helped! but cannot understand the situation...

 

When I configured port as INPUT and call function there wasn't error anymore, but when I reconfigured it back to OUTPUT and call function there also wasn't any error anymore. 

 

Can anyone exmplain it?

0 Kudos
Message 3 of 5
(1,714 Views)

@AndrazS wrote:

Hello actually this really helped! but cannot understand the situation...

 

When I configured port as INPUT and call function there wasn't error anymore, but when I reconfigured it back to OUTPUT and call function there also wasn't any error anymore. 

 

Can anyone explain it?


I don't have any hardware to test with, but maybe a bug in the chip? Does that status remain if you close the driver (VISA Close) and reopen it (may hint at that the driver does some improper session status caching)? Or if you unplug the interface and plug it in again (some optimization on the chip that gets reset with a power cycle)?

 

Or something in the manual that you haven't read or that they forgot to document. Datasheets are always incomplete, that's the nature of datasheets. If a chip doesn't get used very often nobody will bother to update the datasheet. If it gets used often a new chip generation will be developed with a new datasheet that is incomplete again and the old datasheet will slowly be forgotten and definitely not worked on anymore.

 

The art of software driver development for any hardware is about getting a feeling of things that might not be complete in the datasheets and work around it and testing, testing, testing, testing! Did I mention that you need to do lots and lots of tests?

Rolf Kalbermatter
My Blog
0 Kudos
Message 4 of 5
(1,707 Views)

I had troubles setting the GPIO bits initially.  You need to use the FT4222 Set Suspend Out VI and FT4222 Set Wake Up interrupt VI.  Set the enable inputs to 0 (disabled) for both VIs.  Also, I think you should use FT4222 A for the SPI or I2C and the FT4222 B for the GPIO.  That is what worked for me.  Keep in mind that GPIOs are used for SCL and SDA for I2C and GPIO2 and GPIO3 are used for suspend and interrupt functions.  As such, if you are using I2C, GPIO0 and GPIO1 are SCL and SDA, respectively.  GPIO2 and GPIO3 are SUSPEND and INTERRUPT by default, which has to be disabled by the VI I mentioned previously.  I'm assuming you generated the necessary VIs with the import shared DLL operation of Labview, too.  If you need help with that, I have worked that out, too.

0 Kudos
Message 5 of 5
(115 Views)