AD5941 GPIO2 cannot act as general-purpose output — any workaround without a board respin?
I'm using the AD5941 (CPZ-RL7) and driving 3 external mux address lines from its GPIO0, GPIO1, and GPIO2 pins. This IC has only 3 GPIO's. Firmware engineer reported that GPIO2 cannot act as general-purpose output. I also did not check the datasheet in detail while doing the schematic. Now board fabrication and assembly is going on.
Below is the table from the datsheet of AD5941.
So GPIO2 can't be toggled as a normal output bit the way GPIO0/GPIO1 can. My board is already built with GPIO2 wired to the MSB of a 3-bit mux address, and I need all 8 address combinations.
Has anyone found a way to get GPIO2 to behave as a software-controlled static/toggleable level?
Appreciate any war stories or patterns from anyone who's hit something like this before.
2 answers
There may be workaround, potentially, although I haven't done it. Neither have I used the AD5941.
The GPIO2 has an output function for synchronizing external device. Configure it for synchronization, then set the pin state of GPIO2 through the SYNCEXTDEVICE register. Control the state of GPIO0 and GPIO1 through the GP0OUT register.
p.s.
Perhaps they shouldn't have named the GPIO2 a GPIO in the datasheet.
These GPIO pins have muxed functions. Table 152 on p.124 in the datasheet describes which functions each pin can have. All of them can be a GPIO, except for the GPIO2. They should have called it something else, and not GPIO. They invited this slip.
What might be a better naming? SYNC0/GPIO0, SYNC1/GPIO1, SYNC2, SYNC3/GPIO3, etc.
1 comment thread
I also did not check the datasheet in detail while doing the schematic. Now board fabrication and assembly is going on.
Yeah, that was a dumb and lazy thing to do. Hopefully you've learned a lesson.
At least this mistake was caught early in the process. Read the datasheet and work with the software engineer to see which pins they can use, then rework the boards to move the third address line to another pin. Fix it for real in the next revision.
This IC has only 3 GPIOs.
The table you copied into the question clearly shows 8 GPIOs, but I don't see any GPIO pins coming out of the part in your schematic. It is unclear what is really going on.
Some possible fixes:
- Use a different part with more GPIO.
- Use a separate microcontroller.
- Use an IIC digital output expander. Those only require two lines to control.

1 comment thread