2024-02-20 04:41 AM - last edited on 2024-02-20 06:52 PM by willzhou
Hello,
I'd like to use GPIO00 ... GPIO04 as outputs to select the used coil from a coil array for power transmitting.
I've seen the i2c addresses of the GPIO's configuration at 0x30 and followed. I'm wondering what address is foreseen to read or write the GPIO data. Have I overseen anythink?
Thanks if anyone has an idea!
Solved! Go to Solution.
2024-02-21 03:02 AM
Hi willzhou,
thank you very much, now there is light in the darkness for me.
Of course it would be even better to know the corresponding hw address for the output in order to output all bits at once.
I am currently working on using the stwbc86 with a 5-coil array (WPC power transmitter design A32) and the coils are connected to the AC full bridge one after the other via the GPIOs and a coil multiplexer in order to then determine via "ping" where a device to be loaded may be located.
I hope that such a scan function can later be executed directly by the STWBC86 firmware. If you are interested, we can also contact each other outside the forum ...
2024-02-20 06:00 AM
See Table 10 in the datasheet for how to configure these pins. Note that they are open drain.
https://www.st.com/resource/en/datasheet/stwbc86.pdf
2024-02-20 06:11 AM
Hi TDK, thanks, the question was not about the configuration but how the GPIO data should be read or written ...
Is there a register to read/write this bits itself?
2024-02-20 06:34 AM - edited 2024-02-20 06:35 AM
To configure the pin as open drain low (i.e. outputting a low signal), set it to 0x04. To configure it as open drain high (i.e. high impedance), set it to 0x03. Is this not what you're seeing?
As an open drain output pin, these are the only two states it can be in. No other GPIO data register is necessary.
2024-02-20 06:28 PM
Hi Andreas
I understand you want to control gpio high or low,
for example control INTB/GPIO6 high/low set as below
or use I2C reg command W 0x0036 0x04 set high
or use I2C reg command W 0x0036 0x03 set low.
Also you can use other GPIO, Test waveform
MCU example driver code
https://github.com/STwirelesscharger/Python_FT260_ST_WLC/blob/main/b8_wbc86_gpio_control.py
2024-02-21 01:02 AM
Hi willzhou, from my point of view this is an unusual approach to set a data bit, however how do i read in a bit after i have set it as floating?
2024-02-21 01:52 AM
Hi Andreas
Yes, it is unusual approach , not like STM32 MCU we do not open GPIO register to customer.
So we use this way to control GPIO.
Question: however how do i read in a bit after i have set it as floating?
Answer: you need to read 0x2001A01C address, we connect 1.8V to GPIO1 and nothing to GPIO0.
use gui and read this value data is 0x02, bit1 is 1 means GPIO1 is high.
Also you can refer to this example code
https://github.com/STwirelesscharger/Python_FT260_ST_WLC/blob/main/b9_wbc86_gpio_read.py
2024-02-21 03:02 AM
Hi willzhou,
thank you very much, now there is light in the darkness for me.
Of course it would be even better to know the corresponding hw address for the output in order to output all bits at once.
I am currently working on using the stwbc86 with a 5-coil array (WPC power transmitter design A32) and the coils are connected to the AC full bridge one after the other via the GPIOs and a coil multiplexer in order to then determine via "ping" where a device to be loaded may be located.
I hope that such a scan function can later be executed directly by the STWBC86 firmware. If you are interested, we can also contact each other outside the forum ...
2024-02-21 05:50 PM
Hi Andreas
We only support big volume for firmware customize, and it can save external MCU to control STWBC86.
for 5-coil array you just need to control each gpio high or low, it can use I2CREG_GPIOx_FUNC to control.
Also you use hardware register to control GPIO, but it will make some mistake and influence to other gpio.
So i recommend to use I2CREG_GPIOx_FUNC to control.
2024-02-25 06:11 PM
Hi Andreas
I suppose you have MCU to control all devices, so I recommend you use MCU to control STWBC86.
It is simple for you to modify some config and logic, here is example code for your reference.
https://github.com/STwirelesscharger/Python_FT260_ST_WLC/blob/main/b10_wbc86_gpio_switchcoil.py