Skip to main content
FW version: Stable

GPIO

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. In the 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 reading 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

din

The state of digital input (DIN). This state is an array.

info

There is a built-in debounce 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 is a built-in resistor in the MCU. Usually, this resistor is weak ~80k. With pull-up enable you will usually get around 2V.

tip

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

tip

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