GPIO
- All here listed variables are located in folder
/common
. - This description is general for all siliXcon ESC devices (motor controllers). This means some variables may not be present in your device.
The GPIO stand for General Purpose Input Output. In the controllers the GPIOs have only input functionality.
States
gpio0
[mV]
gpio1
[mV]
gpio...
[mV]
gpio
[mV] (an array)
The voltage on individual GPIO pins in [mV].
If corresponding ioconf..
is set for reading pulses and device have isolated GPIO (expander). It shows pulse duration.
gdin
Digital representation of voltage on GPIO. This state is an array.
This is often used for reading buttons.
gdin value | voltage range on gpio | note |
---|---|---|
-1 | <0.5V | Only with ioconf = 1. GPIO connected to GND |
0 | 0V (0.5V) - 2.5V | GPIO is floating, not connected |
1 | 2.6V - 4.1V | GPIO is connected to 3.3V |
2 | 4.2V - 7V | GPIO is connected to 5V |
3 | >7.1V | GPIO is connected to 10V |
din
The state of digital input (DIN). This state is an array.
There is build-in debounce on this reading.
Parameters
ioconf0
ioconf1
ioconf...
This parameter change GPIO input configuration.
ioconf value | Description |
---|---|
0 | no pull-up or pull-down in processor. But there is always some pull-dn, because of the input divider. |
1 | pull-up connected to 3.3V |
2 | pull-down |
The pull-up or pull-dn is build-in resistor in the MCU. Usually this resistor is weak ~80k. With pull-up enable you will usually get around 2V.
If you enable pull-dn resistor, you can increase maximum input voltage. Usually from 0-10V -> 0-12V. For more info check hardware documentation.
If you want to use the gpio for analog reading, always use the ioconf 0. The build-in resistor are not precise and they add inaccuracy.
Post-processing - edge measuring
This is only for devices with an expander (SC, SL, SX).
The measured frequency can be up to 100Hz. This is used for PAS sensor or speed sensor.
ioconf value | Description | Usage |
---|---|---|
72 | period measurement with gdin as edge counter, gpio value in [ms] | Speed sensor |
104 | period measurement with gdin as full period counter, gpio value in [ms] | Speed sensor with non-symmetrical signal |
80 | duty cycle measurement with gdin as edge counter, gpio value in 0-1000 -> 0-100% | |
88 | abs(gpio) = period measurement, gpio in [ms] with gdin as edge counter, sign is duty cycle 0-50 / 50-100% | PAS input |
You can combine input settings and postrocessing:
89 (88 + 1) PAS input + pul-up
pulsethr
[mv]
When you are reading pulses using GPIO (PAS sensor, speed sensor), this is used as the threshold for detecting pulse.
Some older devices use value
gpiothr
[lsb]. There 0lsb = 0V. 4000 ~ 10V