User`s manual

BL1600 System Development s 41
Invoking the Virtual Driver
To invoke the virtual driver, call uplc
_
init from your main function.
The uplc
_
init function will initialize the following items.
Variables for the virtual driver
Virtual watchdog timers (if requested)
The real-time kernel (if requested)
The timer that runs the background routine.
If you do not use uplc
_
init, your program must periodically hit the
hardware watchdog (if it is enabled by connecting pins 2728 on header
J1). Otherwise, the BL1600 will reset approximately once every second.
Virtual Driver Variables
The variables described in this section are defined in the CPLC.LIB
library. The virtual driver updates input variables every 25 ms to reflect
the state of the hardware inputs, and also sets hardware outputs based on
the state of its output variables.
The virtual driver does not change input variables unless the hardware
input has the same value for at least 2 consecutive ticks of the virtual
driver.
Digital Inputs
Once uplc
_
init is called, the virtual driver references the 12 variables
DIGIN1, DIGIN2, DIGIN3, DIGIN4, ..., DIGIN10, DIGIN11, DIGIN12
that represent the 12 digital inputs. For example,
heater = DIGIN1 || DIGIN12;
These variables take the value 1 if the input is high (>2.5 V) and 0 if the
input is low. The parameter value is changed only if the new value remains
the same for 2 ticks (25 ms to 50 ms) of the virtual driver.
Digital Outputs
Sets the variables OUTB1, OUTB2, ..., OUTB7, OUTB8 for digital outputs to a
value of 0 for a low level, or to a value of 1 for a high level. Sets the
variables HC1, HC2, ..., HC5, HC6 for high-current outputs to a value of 0 to
turn off the high-current output (on the screw terminals, header J2), or to a
value of 1 to turn on the output. Sinking driver outputs pull low when on;
sourcing driver outputs pull high.