cancel
Showing results for 
Search instead for 
Did you mean: 

STWBC86 GPIO registers

Andreas8882
Associate II

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!

1 ACCEPTED SOLUTION

Accepted Solutions

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 ...

 

View solution in original post

9 REPLIES 9
TDK
Guru

See Table 10 in the datasheet for how to configure these pins. Note that they are open drain.

TDK_0-1708437562098.png

https://www.st.com/resource/en/datasheet/stwbc86.pdf

 

If you feel a post has answered your question, please click "Accept as Solution".
Andreas8882
Associate II

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?

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.

If you feel a post has answered your question, please click "Accept as Solution".
willzhou
ST Employee

Hi Andreas
I understand you want to control gpio high or low,
for example control INTB/GPIO6 high/low set as below

willzhou_0-1708481834192.png

or use I2C reg command W 0x0036 0x04 set high

willzhou_1-1708481949759.png

or use I2C reg command W 0x0036 0x03 set low.

Also you can use other GPIO, Test waveform

willzhou_2-1708482046229.png

MCU example driver code

https://github.com/STwirelesscharger/Python_FT260_ST_WLC/blob/main/b8_wbc86_gpio_control.py

 

import driver_ft260
from wbc86_register import *
import time
wbc86 = driver_ft260.ft260_dongle()
wbc86.chip_info()
print("example code set gpio6/intb pin open drain high")
wbc86.write16(I2CREG_GPIO6_FUNC,GPIO_FUNC_PP_HI)
time.sleep(1)
print("example code set gpio6/intb pin open drain low")
wbc86.write16(I2CREG_GPIO6_FUNC,GPIO_FUNC_PP_LO)

 

 

In order to give better visibility on the answered topics, please click on Accept as Solution on the reply which solved your issue or answered your question.

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?

willzhou
ST Employee

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.

 

willzhou_0-1708508998373.png

Also you can refer to this example code

https://github.com/STwirelesscharger/Python_FT260_ST_WLC/blob/main/b9_wbc86_gpio_read.py

 

 

 

In order to give better visibility on the answered topics, please click on Accept as Solution on the reply which solved your issue or answered your question.

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 ...

 

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.

In order to give better visibility on the answered topics, please click on Accept as Solution on the reply which solved your issue or answered your question.
willzhou
ST Employee

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

In order to give better visibility on the answered topics, please click on Accept as Solution on the reply which solved your issue or answered your question.