User manual

PoKeys user manual
32
www.poscope.com
8.3. Digital counters (only on PoKeys56 devices)
Selected pins of the PoKeys56U and PoKeys56E/57E can be setup to count the number of signal
transitions on those pins. Pin digital counter can be setup to be incremented/decremented on rising,
falling or rising and falling edges of the input signal. If needed, additional pin can be selected to
toggle between incrementing and decrementing mode.
For the list of pins that support digital counter option go to Device pin functions chapter of this
manual.
If switches are used in the combination with digital counters, external debouncing circuit must be
installed.
PoKeys configuration software usage
To setup digital counter inputs, first set the selected pin as ‘Digital input’ and if digital counter is
available on the selected pin, the ‘Enable counter’ option will be enabled. Check this option and
check ‘rising’ and/or ‘falling’ edge counting option.
To enable selection between incrementing or decrementing counter modes, a direction pin can be
selected in the ‘Direction pin’ drop-down menu. If no pin is selected, the counter mode defaults to
incrementing mode.
Digital counters values status page (menu Peripherals > Digital counters values…’) can be used to
check the proper working of the configured digital counters.
Applicable PoKeys library commands
Read or set single pin digital counter configuration
GetPinData
SetPinData
GetDigitalCounterDirectionPin
SetDigitalCounterDirectionPin
Reads pin data with counter options
Set pin data with counter options
Reads direction pins for the digital counters
Sets direction pins for the digital counters
IsCounterAvailable
Checks if specified pin supports digital
counter
Read or set multiple pin digital counter configuration
GetAllPinConfiguration
SetAllPinConfiguration
Read pin configuration for all pins with
digital counter options
Set pin configuration for all pins with digital
counter options
Read or set digital counters values
GetDigitalCountersValues
Reads current values of digital counters
ResetDigitalCounters
Resets values of digital counters
COM_Execute command
COM_ExecuteInner with the following parameters:
- GetDigitalCounterValues
- GetPinConfiguration
- SetPinConfiguration