l. Enhanced 16-bit hardware counters support (robotics)

The counter 0 is incereased by 1 by impulse on PA2 input (I2 on an K8055 or K8055N board). The counter 1 is incereased by 1 by impulse on PC0 input (I3 on an K8055 or K8055N board). Unlike the original Velleman firmware which implements counters in software, these counters are entirely implemented in PIC18FxxJ50 hardware. There are also two examples: Impulse counter example (32-bit).zip and Impulse counter example (64-bit).zip.

PIC18FxxJ50 microcontrollers have five counters T0 through T4. T0 and T3 timers may also be used as hardware counters. SVLIB_PIC18F24J50 v3.0.NET4(x64).DLL library supports the following functions:

public: int SVPICAPI::SetCounter(int CounterNr, int val); // DLL VERSION 3.0 and PIC18FxxJ50 with firmware 2.x only

public: int SVPICAPI::ResetCounter(int CounterNr); // starting with DLL VERSION 3.0 also supported on PIC18FxxJ50 with firmware 2.x

public: int SVPICAPI::ReadCounter(int CounterNr); // starting with DLL VERSION 3.0 also supported on PIC18FxxJ50 with firmware 2.x

public: void SVPICAPI::SetCounterDebounceTime(int CounterNr, int DebounceTime); // starting with DLL VERSION 3.0 also supported on PIC18FxxJ50 with firmware 2.x

SetCounter function allows you to load an arbitrary 16-bit unsigned integer value into a counter (counter number 0 or 1). This function is only supported with firmware 2.x. ResetCounter sets the selected counter to 0. Read counter reads the 16-bit value from counter. SetCounterDebounceTime is only supported with the original Velleman firmware, which implements counters in software.