FX3 simple GPIO pins initialization

Tip / Sign in to post questions, reply, level up, and achieve exciting badges. Know more

cross mob
AnPo_1318261
Level 1
Level 1
Welcome!

Hello.

   

We have a custom FX3 based controller. Our controller has is very similar FX3 chip connection to DVK board. The difference is additional output pins usage: they are GPIO[26], GPIO[27], GPIO[45]. We use synch slave FIFO sample as a base for out project. To use new GPIO pins we use CyU3PDeviceGpioOverride and CyU3PGpioSetSimpleConfig methods. These methods are placed after state machine start. The problem I have is a wrong GPIO[45] initial state after GPIO configuration. I want to have a '0' (low) output on GPIO[45] initially, but this output is set to '1' (high) after startup of firmware. At the same time two other pins (GPIO26 and GPIO27) are correct after initialization and all three pins are controlled correctly with CyU3PGpioSetValue and CyU3PGpioGetValue methods from UsbSetup callback.

   

The same problem I have with I2C devices located on our board. We need to preset one of I2C devices on initialization. But write to I2C is failed in AppThread_Entry method. And again all works properly from UsbSetup callback.

0 Likes
2 Replies
Anonymous
Not applicable

Hi,

   

The initialvalue after GPIO Confguration can be set in the CyU3PGpioSetSimpleConfig API in the outValue field. You can make it CyTrue or CyFalse to set the initial state as high or low after the GPIO Config Api.

   

We need to check why the i2c write has failed actually. Please create a Tech Support Case and share your firmware to us for review.

   

Regards,

   

- Madhu Sudhan

0 Likes
AnPo_1318261
Level 1
Level 1
Welcome!

Thank for response. I think I was not clear.

   

CyU3PGpioSetSimpleConfig API is called for GPIO pins 26,27,45. outValue is set CyFalse for GPIO[26], CyTrue for GPIO[27], CyFalse for GPIO[45]. After initialization FX3 pins physical state are: GPIO[26]=0, GPIO[27]=1, GPIO[45]=1. So the problem is that GPIO[45] is not reset as it is specified in CyU3PGpioSetSimpleConfig method call. In the same time GPIO[26], GPIO[27] initialization works properly.

0 Likes