Did you know...
|
|
Direct
Host Control
This is the simplest of the channel modes, designed to allow
the host to directly control the state (input, high or low) of
any of the Serial Wombat's digital pins. In default mode an
18F4620 based Wombat has 29 pins configured for digital I/O.
Direct controlled mode is the default mode for all non-analog
pins coming out of powerup. The CHANNEL_MODE_DIRECT
mode is the result of an IMMEDIATE_CONFIGURE command
or can be the result of a SET_CHANNEL_MODE command.
When invoking this mode the host commands the Wombat to make the
channel an input or a high or low output. This change happens
when the message is received. The channel does not have to be
serviced by the executive to change the state of its pin. When
the executive services a channel in CHANNEL_MODE_DIRECT
mode the buffer value of the channel is updated to 1 or 0 based
on the measured or set value of the pin.
To configure a channel to CHANNEL_MODE_DIRECT, send
the following set of 8 bytes:
| Byte # |
Byte Value |
Description |
| 0 |
200 |
Configure pin |
| 1 |
pin# |
Physical Pin number |
| 2 |
0 |
Channel mode = CHANNEL_MODE_DIRECT |
| 3 |
Pin State |
0 for output low, 1 for output high, 2 for input |
| 4 |
unused |
|
| 5 |
unused |
|
| 6 |
unused |
|
| 7 |
unused |
|
For example, to configure pin 20 to an output high, the following
command would be sent:
200 20 0 1 0x55 0x55 0x55 0x55
Return packet is an echo of the sent packet.
|
|