io Input/Output

GPIO

In this window, each individual GPIO (General Purpose Input/Output) behavior can be configured:

../../_images/io_gpio.png

GPIO panel

  • Signal: Pin ID as described in the Pinout - Hardware installation section of the MEX Hardware Manual.

  • GPIOId: GPIO ID of the microcontroller.

  • IO: Define GPIO as an input or ouput.

  • Pull-up: Enable or disable the pull-up resistance.

  • Function: Mux 0/GPIO: GPIO, Mux 1: PWM, Mux 2 or Mux 3. These are the different functionalities that the GPIO can have, depending on the multiplexer.

    Note

    When users set Function to “Mux 1”, it indicates that the corresponding pin is disabled as GPIO and enabled as PWM. Consequently, the Enable checkbox in the PWM menu for that pin should be activated automatically.

    Warning

    Check that the corresponding Enable checkbox in the PWM menu is changed.

  • Qsel: This is the “input qualification”, it is used to control how the value of a GPIO is evaluated. The available options are:

    • Sync: The value is taken as the time it is checked (synchronously). This is the default mode of all GPIO pins.

    • 3 Samples: The value is checked 3 times and the value is only changed when the 3 times are the same.

    • 6 Samples: Same as 3 samples, but checking 6 times instead of 3.

    • ASync: No checks are performed. It is used when it is not used as GPIO.

PWM

In this panel, each PWM can be configured:

../../_images/io_pwm.png

PWM panel

Note

PWMs in MEX work in normalized mode, when the input value is 0 the output value will be the minimum configured, and when the input value is 4095 (12 bits all with ones), the output will be the maximum configured. This approach allows usage of the maximum resolution for the commanded value.

  • Enable: Defines if the PWM is enabled or not.

    Note

    This checkbox disables the pin as GPIO and enables it as PWM. Hence, in the GPIO menu the “Function” parameter shall change to “Mux 1”.

  • Sub id: Identifies the sub-id of the PWM and, according to this value, determines the command to be used using one type of CAN message or another.

  • Frequency: PWM output frequency. This determines the period of the pulses sent by the MEX

  • Timeout: If a PWM message is not received in less than this time, the PWM will send as output the start value.

  • Start value: Value used before any PWM message arrives and on timeout.

  • Pulse source ID: PWM input ID [0,3], defined in the Digital Input panel.

  • Active High: Polarity high or low (high if enabled).

  • Mode: The avilable options are Time and Duty cycle.

    • Time: The values indicated in Min and Max parameters are expressed in time units.

      ../../_images/io_pwm_time.png

      PWM panel - Time units

    • Duty cycle: This option is a a different way of indicating the pulse width. Now the value indicated in Min and Max parameters is a percentage which corresponds to the relation between the pulse width over the total period of the sent signal.

      So a 100% duty cycle will correspond to a signal with a constant value of 1, while a 0% duty cycle implies a constant signal with value 0. Between this two extremes, the pulse width can vary as in the examples shown in the following figure.

      ../../_images/duty_cycle.png

      Duty cycle

      Note

      Duty cycle percentages can be expressed in percent and per unit.

      ../../_images/io_pwm_duty_cycle.png

      PWM panel - Duty cycle units

  • Min: This parameter is the pulse width value that will make the servo/actuator go to its lowest position.

    It will be the output when the PWM message specifies 0.

  • Max: This parameter is the pulse width value that will make the servo/actuator go to its highest position.

    It will be the output when the PWM message specifies 4095.

An example about reading PWM signals can be found in Commanding/Reading PWMs - Integration examples section of the present manual.

I/O Setup

In this panel the user can establish the relationship between a determined signal with a I/O port. This allows users to configure external sensors, custom messages, etc.

../../_images/io_io_setup.png

I/O Setup panel

  • Priority: Connections between I/O ports can be marked with high priority with this checkbox. If enabled, they will run at high frequency: 1000 Hz.

  • Producer: Functions for creating and sending messages.

  • Consumer: Functions for receiving and parsing messages.

  • Bit: This assigns each connection to a bit. Thus, the connection is activated/deactivated depending on the status of the selected bit. By default, the Always Ok bit is set to all connections so that they are always active.

The following are the steps to setting up reception or transmission between ports:

  1. Choose the Producer to use.

  2. To configure the desired Consumer that will be bind to the chosen Producer, it is first required to establish the relationship between them:

    • Bind \(\rightarrow\): Unidirectional relationship.

    • Bind Bidirectional \(\leftrightarrow\): Bidirectional relationship. This enables a port to receive or send information.

    Note

    Once the Consumer has been selected, it is possible to undo the selection by pressing the Clear button.

  3. Select the desired Consumer element.

  4. (optional) Configure the Bit parameter. By pressing on the bit button, the user can select the bit to assign the connection to.

The following I/O ports are available:

Field

Description

RS232-A

Serial Port 232 A

RS232-B

Serial Port 232 B

RS485-C

Serial Port 485

Commgr port

COM Manager ports send and receive VCP messages. This is the protocol used by Veronte products to communicate. For more information, read the VCP user manual

Tunnel

Creates a bidirectional brigde between two devices, see Tunnel

Custom message producer/consumer

This allows user to send/receive a serial custom message, see Serial Custom Messages

CAN to Serial / Serial to CAN

Serial to CAN sends serial streams over a CAN Bus / CAN to Serial undoes the transformation ‘Serial to CAN’

CAN wrapper for serial transmission / Serial CAN unwrapper

CAN wrapper for serial transmission sends CAN streams over a serial Bus / Serial CAN unwrapper undoes this transformation. For more information on these ports, please refer to CAN wrapper/CAN unwrapper - Input/Output section of the 1x PDI Builder user manual

Tribunus ESC

Reads telemetry data from the Tribunus ESCs by connecting it to one of the serial ports

Lift - MCU

Created for communication with a Lift MCU

JETI box

Simulates a Jetibox to read telemetry from legacy Jeti devices, see JETI box

JETI telemetry

Reads telemetry from Jeti devices

More information about some elements can be found in the following sections.

Tunnel

A tunnel is a bidirectional bridge between units that communicate each other, sharing information about an external device connected to the serial or digital port. The following image shows an example of tunnel configuration:

../../_images/io_io_setup_tunnel.png

Tunnel configuration

In the previous image there is a device connected to the RS232-A (Producer) and there is a Tunnel (Consumer) which sends that information to all units on network (Broadcast). On the other hand, another Veronte device has to be configured to receive the signal sent by another device. In this case, the Producer will be Tunnel, while Consumer will be the port or destination tunnel where the device is connected.

The options available when configuring Tunnel as Consumer are:

  • Veronte ID: Enter the address that will receive the information. The following options are the most common:

    • App 2: Veronte applications address.

    • Broadcast: All units on the network. Select this option for a generic configuration.

    • Address of a specific Veronte unit, it can be a 1x, a 4x, a CEX, a MEX, etc.

      For more information on the available addresses, see List of addresses section of the MEX Software Manual.

  • Parser: The user can choose the protocol to parse message data. The options available are:

    • No protocol

    • RTCM3

    • CAN serial

  • Destination tunnel: Number of port is used to avoid mistakes and identify each Tunnel when using more than one. Tunnel 1, 2 and 3 are available.

  • Time between messages.

  • Bytes to send: Sets the message size to send.

When configuring Tunnel as Producer (i.e. on the unit that receives the information), no configuration is required. It is only necessary to connect it to a Consumer, usually to a serial port.

Serial Custom Messages

Warning

MEX has the following limitations for serial messages:

  • 10 maximum vectors.

  • 32 maximum fields (adding all serial messages).

It is possible to configure messages sent and received through the serial port and its conversion to system variables. To do that, select the option Custom message producer/consumer and configure the I/O port.

../../_images/io_io_setup_serial_custom_message.png

Serial Custom Messages

The previous image illustrates two possible configurations using a Custom Message.

The red one is configured to receive a given message from Tunnel 1 and the green is used to send a Custom Message through the RS485-C serial port. It is also possible to use the same Custom Message for both tasks if the bidirectional relationship is selected (the arrow indicates this, \(\leftrightarrow\)).

To configure a Custom message, the user must follow the next steps:

  1. Press the configuration button (gears icon) and another window will be displayed.

    In this window press the add icon to add a custom message.

    ../../_images/io_io_setup_custom_message.png

    Serial Custom Message configuration

  2. When it is already added, the following options are available to configure a custom message:

    ../../_images/io_io_setup_producer_message.png

    Custom Message producer configuration

    ../../_images/io_io_setup_consumer_message.png

    Custom Message consumer configuration

    • Endianness: Depending on the order the message is made, it is possible to select:

      • Big endian: Set value from left to right.

      • Little endian: Set value from right to left.

      • Mixed endian: Some devices use this format. If users need to configure it, please contact the support team (create a ticket in the customer’s Joint Collaboration Framework; for more information, see Tickets section of the JCF manual).

    • Period/Time out: This option has a dual role depending on whether it is used to transmit or receive data.

      • Period - Producer: Time between produced messages. It is the inverse of the send frequency

      • Time out - Consumer: Time threshold between receptions to consider that messages are not received correctly.

    • Delay/Time to Idle: This option has a dual role depending on whether it is used to transmit or receive data.

      • Delay - Producer: Delay applied before sending the message. This serves to send messages with the same period without overloading the Serial bus.

      • Time to Idle - Consumer: Time that MEX waits before discarding partially parsed bytes.

    • Bit ID: This option is only available when a message is configured as Consumer. The user bit selected in Bit ID box will be true if the message is being received correctly.

    Warning

    Pay attention that the user bit selected in Bit ID is not in use for another task.

  3. To create the structure of the message, click on the edit_list icon and then press the add icon to add fields to it. The following type of messages are available to configure a structure: Variable, Checksum, Matcher, Skip and Parse ASCII.

    The configuration of each structure is covered in the Custom Messages types - Input/Output section of the 1x PDI Builder user manual.

Warning

Before configuring any message, user has to know the structure according to the device that is connected to the port. Each device may have a different message structure when it sends or receives information.

JETI box

JETIBOX is a universal communication terminal which can be used with any JETI products.

JETIBOX operates as a two-way terminal, showing all data stored in the JETIBOX Compatible product. Employing its four buttons, users browse its menu and set the selected values.

../../_images/io_io_setup_jetibox_device.png

JETI box device

To simulate it, it is necessary to link the specific JETI box consumer to a serial port:

../../_images/io_io_setup_jetibox.png

JETI box Consumer

Then, the sequence to retrieve data shall be configured by clicking on gears:

To add a Custom Message, just click on the add icon:

../../_images/io_io_setup_jetibox_configuration.png

JETI box Configuration

The following parameters can be configured in the previous pop-up window:

  • Endianness: Depending on the order in which the device issues the message, it is possible to select:

    • Big endian: Sets values from left to right.

    • Little endian: Sets values from right to left.

    • Mixed endian: Some devices use this format. If users need to configure it, please contact the support team (create a ticket in the customer’s Joint Collaboration Framework; for more information, see Tickets section of the JCF manual).

  • Command: Here the user can select between Jeti box Left, Jeti box Down, Jeti box Up, Jeti box Right or Jeti box Nop. These correspond to the four buttons on the physical JETIBOX (see image above), except the Jeti box Nop that is only for simulating a “wait”.

For example, to read the Actual Voltage of a Jeti MasterSpin 220 the Consumer must be configured with a series of custom messages (use Big endian for all messages).

../../_images/io_io_setup_jetibox_custom_message_all.png

JETI box example

The following example shows the configuration of one of these messages, the full example can be found in Jetibox - Integration examples section of this manual.

  • Expected text: “CONTROLLER TYPE MasterSpin 220~”

  • Command: Jeti box Down

    • Matcher(32) “CONT” 0x434F4E54 (1129270868)

    • Skip(24*8) 192

    • Matcher(32) “220~” 0x3232307E (842150014)

../../_images/io_io_setup_jetibox_custom_message.png

JETI box custom message example

CAN I/O

A CAN (Controller Area Network) Bus is a robust standard communication protocol for vehicles widely used in the aviation sector. MEX has two CAN buses that can be configured independently.

The structure of a CAN message can be seen in the following image:

../../_images/can_structure.png

CAN message structure

Only the ID is introduced in the system, the rest of the message layout is already coded. The data field is built by the user to send, and parsed when received.

For more information on the CAN Bus protocol, see CAN Bus protocol section of the MEX Software Manual.

The baudrate of both CAN buses can be configured in the CAN Setup panel.

Configuration

This menu allows the configuration of CAN communications between different devices.

../../_images/io_can_io_configuration.png

CAN I/O - Configuration panel

In this menu, the user can find the same ‘columns’ (Priority, Producer, Consumer and Bit) as in the I/O Setup panel. In addition, the process for configuring producers and consumers is also the same as described in the I/O Setup - Input/Output section.

Warning

In CAN, while the specified period is not guaranteed in the Low state, in the High state it is.

However, only those messages that are critical for external devices should be set as high priority, as this may disrupt the proper functioning of MEX.

On the one hand, MEX has the following list of producers:

  • Application Processor: Sends a specific set of information, the “status message”.

    This message is composed as: version (major . minor . revision), address (serial number), system bit error, system power up bit error, PDI bit error, memory allocation bit, fily system bit error, CAN A bit error, CAN B bit error, arbiter enabled and arbiter status.

  • CAN Input Filter: Those CAN messages received in one filter can no longer be received in subsequent filters.

    The following parameters need to be configured by clicking on gears:

    ../../_images/io_can_io_can_input_filter.png

    CAN Input Filter configuration

    • Port: It is required to configure the CAN bus from which it listens, the user can choose between CAN A, CAN B or BOTH.

    • Id: CAN Id must be set and it is used to identify messages. The value set has to be decimal format.

    • Mask: A CAN Id mask can be set to filter messages. The mask marks which bits of the message id (in binary) are matched.

      For example, to admit standard Ids (11 bits) from 8 to 11 (100 to 111 in binary) the user should set the mask to binary 11111111100, that is 2044 in decimal.

      Warning

      Make sure that mask is set properly to be able to receive the desired CAN messages.

      The mask should be 11 bits for Standard frame format and 29 bits for Extended frame format.

      More information about this can be found in How to calculate a mask - FAQ section of this manual.

    • Filter type: The available options are Standard (frame format with a 11-bit identifier), Extended (frame format with a 29-bit identifier) and Both.

  • CAN unwrapper: This undoes the ‘CAN serial wrapper’ action, it has to be connected to I/O Setup consumer (Serial CAN unwrapper).

  • Serial to CAN: Serial messages through CAN output, it has to be connected to I/O Setup consumer. It can be configured in gears, a pop-up window will appear:

    ../../_images/io_can_io_serial_can.png

    Serial to CAN configuration

    • Id: CAN Id must be set and it is used to identify messages. The value set has to be decimal format.

    • Extended: If it is enabled, the frame format will be ‘Extended’, i.e. with a 29-bit identifier. Otherwise, the frame format ‘Standard’ (11-bit identifier) is set by default.

    • Time out: This is the threshold time between receptions to consider that it is not being received correctly.

  • CAN Telemetry: Telemetry messages sent via CAN (such as CAN custom messages on Veronte Autopilot 1x). They are configured in the next section: CAN Telemetry.

On the other hand, the consumers are the following:

  • Application Processor: Receives a specific set of information sent by Veronte Autopilot 1x or Arbiter.

  • CAN Output Filter: CAN output filters. The user can choose between CAN A, CAN B or BOTH in gears.

    ../../_images/io_can_io_can_output_filter.png

    CAN Output Filter configuration

  • CAN serial wrapper: CAN messages through serial output, it has to be connected to I/O Setup producer (CAN wrapper for serial transmission).

  • CAN GPIO consumer: CAN messages from Autopilot 1x or 4x for GPIO inputs.

    An example of how to implement it can be found in GPIO Command - Integration examples section of the present manual.

  • CAN to Serial: This undoes the ‘Serial to CAN’ action, it has to be connected to I/O Setup producer.

CAN Telemetry

In the CAN Telemetry tab, the user chooses the telemetry to be sent/received over the CAN buses. The following elements can be configured:

  • TX Ini: Used to configure transmitted messages that are only sent once at the beginning of the operation (sent when the MEX boots up). They can be used to initialize some devices.

  • TX: It is employed to configure transmitted messages.

Warning

  • The maximum capacity of a CAN message is 64 bits (8 bytes), so to send more information it must be divided into several messages.

  • MEX has the following CAN limitations:

    • Maximum number of vectors (fieldsets): 8 \(\rightarrow\) 1 for TX Ini and 7 for TX.

    • Maximum number of fields: 32 (adding all CAN messages).

../../_images/io_can_io_telemetry.png

CAN I/O - CAN Telemetry panel

Since this panel works in a similar way as in the 1x PDI Builder software, the explanation to configure the telemetry messages via CAN can be found in the Custom Messages - Input/Output section of the 1x PDI Builder user manual.

An example of the sending of CAN telemetry messages can be found in the CAN communication - Integration examples section of this manual.

Digital Input

Digital inputs can be used to measure pulse count, pulse widths and PPM signals from a RC radio. Each source shall be connected to the desired consumer to allow measurements.

../../_images/io_digital_input.png

Digital Input panel

In this menu, the user can find the same ‘columns’ (Producer, Consumer and Bit) as in the I/O Setup menu. In addition, the process for configuring producers and consumers is also the same as described in the I/O Setup - Input/Output section.

The process to configure a device can be done as follows:

  1. Select and configure a Producer to read the external signal. There are 2 possible producers: CAP 1 and 2.

    Press on the configuration button gears and a pop-up window will show.

    ../../_images/io_digital_input_producer.png

    Digital Input panel - Producer

    The pop-up window contains the following configurable elements:

    • Enable: By ticking this checkbox, the corresponding producer is enabled.

      Note

      When enabling it, in the GPIO menu the “Function” parameter corresponding to this pin shall automatically change to “Mux 1”.

      Warning

      Please check that this change has been made.

    • CAP pin entry: Selects which pin this CAP is associated to and, therefore, to which device is connected. They are associated in this way: CAP 1 with GPIO/ECAP 1 and CAP 2 with GPIO/ECAP 2.

    • Edge detection: How the pulses are read and transformed into a digital signal (how they are processed).

      By clicking on the drop-down menu, the following options can be selected:

      ../../_images/io_digital_input_edge_detection.png

      Digital Input panel - Edge detection option

      • First rising edge: With this option, when the rise of the pulse is detected, the data will start to be stored. Recommended when consumer is PPM or Pulse.

      • First falling edge: With this option, when the fall of the pulse is detected, the data will start to be stored.

      Note

      By clicking on the marked arrows, it can also be configured as desired.

      For example, if the user has selected the ‘First rising edge’ option, but clicking on the arrows gets the arrow scheme of another defined edge detection option, the name of the edge detection will not be ‘First rising edge’, but will become that edge detection option’s name.

      ../../_images/io_digital_input_edge_detection_example.png

      Digital Input panel - Edge detection arrows

  2. Click on the Bind button to select the type of Consumer, it is possible to choose PPM0 (Stick PPM), RPM 1-4 (RPM Sensor) or Pulse 1-4 (Pulse Sensor).

    ../../_images/io_digital_input_consumer.png

    Digital Input panel - Consumer

    • PPM 0: The variable where the information is stored is ‘PPM channel 1 output’. Stick PPM is configured in the Stick panel.

    • RPM 1-4: The variables where the information read here is stored are ‘RPM 1-4’. For more information about RPM configuration, read the RPM section.

    • Pulse 1-4: The variables where the information is stored are ‘Captured pulse 1-4’. It is possible to configure it clicking on gears.

      ../../_images/io_digital_input_pulse.png

      Digital Input panel - Pulse

    In the pop-up window, users will find the following options for configuration:

    • Mode:

      • Positive pulse duration: The period of the pulse is obtained. It takes the time in ‘High’ state.

      • Negative pulse duration: The period of the pulse is obtained. It takes the time in ‘Low’ state.

      ../../_images/io_digital_input_positive_negative.svg

      Positive/Negative pulse duration

      • Positive duty cycle: The duty cycle of the pulse is obtained. It takes the time in ‘High’ state.

      • Negative duty cycle: The duty cycle of the pulse is obtained. It takes the time in ‘Low’ state.

      ../../_images/io_digital_input_duty_cycle.png

      Positive/Negative duty cycle

    • Time out: This defines the time to consider that no signal is received.

    • Function: Here the user can customize a function to handle values. Normally, a function is set with the points [0,0] and [1,1], so no transformation is applied (output = input). However, the user can configure it as desired.

Example

Let’s imagine that First rising edge has been selected as the edge detection option in Producer and the pulse that MEX has to read is a square signal with a period of 2 seconds and a duty cycle of 25% (see the image below).

../../_images/io_digital_input_signal.png

Signal generated

Therefore, if Positive pulse duration is selected as Consumer and it is configured as in the previous image (Digital Input - Pulse), it will get 0.50 s as value in the variable Captured pulse (Captured pulse 1 in the following example), since it corresponds to the period of the “positive pulse” of that pulse.

Nonetheless, if Positive duty cycle is selected as Consumer, the value obtained in the variable Captured pulse (Captured pulse 2 in the following example) will be 0.25, since it corresponds to the positive cycle of that pulse.

../../_images/io_digital_input_signal_vops.png

Digital Input example

Serial

MEX can use up to three serial peripherals (SCI A, SCI B and SCI C). Serial ports A, B and C parameters can be edited in this menu to fit the serial protocol requirements.

../../_images/io_serial.png

SCI panel

  • Baudrate: This specifies how fast data is sent over a serial line.

  • Length: Number of data bits for each character: 4 to 8 bits.

  • Stop: Number of stop bits sent at the end of each character: 1, 1.5 or 2.

  • Parity: Method to detect errors during transmission. When parity is used with a serial port, an extra data bit is sent with each data character, arranged so that the number of 1 bits in each character, including the parity bit. Disabled, odd or even.

  • Use address mode: 9-bit data framing uses the bit typically associated with parity error detection to identify address messages. Sent serial data that does not have the address bit set will be ignored (unless the device had previously identified an address message associated with it). This option can be disabled or enabled.

Note

SCI A corresponds to port RS232-A, SCI B to port RS232-B and SCI C to port RS485-C.

CAN Setup

In this screen users can configure the baudrate and the reception mailboxes of each CAN Bus (CAN A or CAN B), as well as enable an internal CAN resistor.

Since MEX is going to receive data on the CAN Bus, it is mandatory to configure a certain number of mailboxes to store that data until MEX reads it.

A mailbox can be configured for multiple CAN message IDs as long as the mask is configured correctly and these messages are sent spaced out with enough time between them to allow the high priority core to read each one individually. More information on masks can be found in How to calculate a mask - FAQ section of this manual.

Warning

Since MEX PDI Builder allows up to 32 mailboxes, users should make sure to leave at least one mailbox free for transmission (TX).

If any mailbox is full and another message arrives, the new message is discarded.

../../_images/io_can_setup.png

CAN Setup panel

By activating ‘Enable Terminator’, the internal MEX resistor of 120 \(\Omega\) is activated. For more information on this resistor, refer to the Electrical diagram of CAN bus - Hardware Installation section of the MEX Hardware Manual.

More information about Mailboxes can be found in the Mailboxes - Input/Output section of the 1x PDI Builder user manual.

Custom Msg Trigger

This menu allows the user to send custom messages (which have been previously configured) every time there is a new magnetometer reading/measurement.

It works similar to the Custom Serial TX and Custom CAN TX automations of 1x PDI Builder software.

In this case, the “automation” will work like this:

  • Events: Each new magnetometer reading/measurement.

  • Action: Sending of the custom message already configured.

../../_images/io_custom_msg_trigger.png

Custom Msg Trigger panel

Users can configure custom messages to be sent via serial or CAN:

../../_images/io_custom_msg_trigger_u8.png

Custom Msg Trigger panel - U8 communication

../../_images/io_custom_msg_trigger_can.png

Custom Msg Trigger panel - CAN communication

The two parameters to configure in this menu are:

  • Producer: The user has to specify where the custom message is located (mailbox):

    • For serial: Custom message producer 1 or 2.

    • For CAN: CAN Telemetry

  • Message ID: The ID of the custom message (not the CAN ID) that will be sent.

Warning

  • As it is used to send a single message on demand, in its configuration in Custom Messages, the user must set its period to \(-1\). This way, this message will only be sent when there is a new magnetometer reading/measurement.

  • For CAN communications, do not confuse it with the CAN ID of the custom message:

../../_images/io_custom_msg_trigger_message_id.png

Message ID in CAN communication