EasyManua.ls Logo

Alkeria NECTA Series - Input and Output Ports Usage Examples; Serial Interface Module

Default Icon
140 pages
Print Icon
To Next Page IconTo Next Page
To Next Page IconTo Next Page
To Previous Page IconTo Previous Page
To Previous Page IconTo Previous Page
Loading...
4. Interfacing to the world 65
4.5.6 Input and output ports usage examples
The following code congures NECTA port 0 (bidirectional) as an input, sets 10 µs as debounce time and
enables the internal differential termination:
Example Code 4.16 | P0 conguration as input
device.PIOPorts[0].Direction = IODirection.Input; // Configure port 0 direction
device.PIOPorts[0].DebounceTime = 10; // Set debounce time to 10us
device.PIOPorts[0].Termination = true; // Enable termination
bool status = device.PIOPorts[0].Value; // Read port 0 value
bool rising = device.PIOPorts[0].RisingEvent; // Read port 0 rising event
The following code congures port 0 (bidirectional) as an output and sets level as high:
Example Code 4.17 | P0 conguration as output
device.PIOPorts[0].Direction = IODirection.Output; // Configure port 0 direction
device.PIOPorts[0].Value = true; // Set output high
4.6 SERIAL INTERFACE MODULE
NECTA cameras are equipped with a serial interface module to communicate with external devices. This
module is able to send and receive data through dedicated FIFO buffers. Incoming data are stored in
an input FIFO and can be retrieved via simple read commands issued to the camera. Output data sent
through write commands are temporarily stored in an output buffer and then sent through the serial
interface.
Each FIFO is 64-byte deep. If the receiving FIFO gets full before the received data are retrieved by your
application, an error bit is set. This condition can be checked via the Overrun property.
MaestroUSB3 provides methods to set the requested baud rates, check the input buffer level and size
and assign I/O pins to serial Tx and Rx. Hardware handshake is not supported.
Note
If your application needs serial input or serial output only, you can enable just
the required pin (Tx or Rx), avoiding wasting an I/O pin for the unneeded func-
tion (see below).

Table of Contents