Skip to main content
FW version: Stable

GPIO/GDIN

info
  • 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.
note

The GPIO stands for General Purpose Input Output. The GPIOs provide high precision, noise-free analog reading. Usual reading voltage range is 0-10V. They can also read negative voltages in some cases. They can be individually configured with pull-up or pull-down resistors, can be used for precise timing pulse measurement (PAS, speed sensor), and are typically isolated from the power stage. In the default variants of our controllers, the GPIOs have only input functionality.

States

gpioX [mV]

The voltage on individual GPIO pins in [mV], where X is the GPIO number. The GPIO readings are also available as the gpio array.

info

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 interfacing buttons and switches. Note that each GPIO can serve as a multiplexed input of up to 4 buttons.

GDIN valuevoltage range on GPIOnote
-1<0.5VOnly with ioconf = 1. GPIO connected to GND
00V (0.5V) - 2.5VGPIO is floating, not connected
12.6V - 4.1VGPIO is connected to 3.3V
24.2V - 7VGPIO is connected to 5V
3>7.1VGPIO is connected to 10V
info

There is a built-in hysteretic debounce mechanism on this reading.


Parameters

ioconfX

This parameter changes the GPIO input configuration, where X is the GPIO number.

ioconf valueDescription
0no pull-up or pull-down in processor. But there is always some pull-dn, because of the input divider.
1pull-up connected to 3.3V
2pull-down
info

The pull-up or pull-dn are built-in weak resistors. With pull-up enable, you will usually shift the offset of up to 2V and also extend measurements slightly into negative range.

tip

If you enable pull-dn resistor, you can increase maximum input voltage. Usually from 0-10V -> 0-12V. For more info, check the hardware documentation of your device.

tip

If you want to use the GPIO for analog reading, always use the ioconf value 0. The built-in resistor adds 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 valueDescriptionUsage
72period measurement with GDIN as edge counter, GPIO value in [ms]Speed sensor
104period measurement with GDIN as full period counter, GPIO value in [ms]Speed sensor with non-symmetrical signal
80duty cycle measurement with GDIN as edge counter, GPIO value in 0-1000 -> 0-100%
88abs(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 post-processing: 89 (88 + 1) PAS input + pull-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