User`s manual

PK2200 Software Reference s 53
The lower eight bits returned by the inport() function represent the
status of the digital inputs. Bits which are set ( 1 ) represent inputs
which are high. Bits which are reset ( 0 ) correspond to inputs which
are low.
Example:
lowDIBank = inport( DIGBANK1 );
highDIBank = inport( DIGBANK2 );
void DMA0Count (unsigned int count)
Loads the DMA channel 0 with the count value and enables the DMA
channel 0 interrupt.
The function sets the flag
_
DMAFLAG0
to zero. When count negative
edges have been detected, the channel causes an interrupt, and the
interrupt service routine sets the flag
_
DMAFLAG0
to 1. A program can
monitor
_
DMAFLAG0
to determine if the number of counts has occurred.
PARAMETER: count is the number of pulses to count.
RETURN VALUE: None
void DMA1Count (unsigned int count)
Loads DMA channel 1 with the count value and enables the DMA
channel 1 interrupt.
The function sets the flag
_
DMAFLAG1
to zero. When count negative
edges have been detected, the channel causes an interrupt, and the
interrupt service routine sets the flag
_
DMAFLAG1
to 1. A program can
monitor
_
DMAFLAG1
to determine if the number of counts has occurred.
PARAMETER: count is the number of pulses to count
RETURN VALUE: None
unsigned int DMASnapShot (byte channel,
unsigned int *count)
Reads the number of pulses that a DMA channel has counted. A DMA
counter is initialized with one of the two preceding functions.
PARAMETERS: channel is the DMA channel (0 or 1)
*count is a pointer to variable holding the pulse count.
RETURN VALUE: 0, if pulse train is too fast to have a snap shot
taken; 1, if a snap shot is obtained and valid data is in *count.
Even if a program is unable to read the counts, DMA inter-
rupts still occur when the DMA channel counts down from its
loaded value.
!