CASP User Data Input Output (UDIO) is a light weight communication protocol used to transfer data between the target (such as a micro-controller board or an SBC) and the host computer. Unlike CASP GPIO protocol, CASP UDIO transfers user data (bytes, integers and floats) instead of GPIO data. This example demonstrates how to exchange data between Vega Aries Eco board and host PC using UDIO protocol through serial communication.
Pre-Requisites
- Vega Aries Eco board with a USB cable.
- CASP software is installed and functional.
- Vega Aries BSP is installed.
- The project files are located at CASP installed directory ‘CASP/support/examples/casp_udio_examples/udio_led_control_aries_eco’. These are also available for download at this link.
Model Details
Two CASP projects are developed, one that runs on the target board and the other on host computer.
The target model:
- Reads ADC pin value and transfer the value to the host as a UDI 32-bit integer data at byte index 0.
- Controls the frequency of the on-board LED based on the frequency value received from host at byte index 0 as a UDO 32-bit floating point value.
- Controls PWM pin based on the amplitude value received from the host at byte index 4 as a UDO 32-bit integer value.

The host model:
- Reads ADC value from the target as a UDI 32-bit integer data at byte index 0 and plots the trend.
- Vary the frequency of the on-board LED by sending a 32-bit floating point value at byte index 0 of UDO.
- Vary the PWM pin magnitude on the board by sending a 32-bit integer value at byte index 4 of UDO.

Upload Target Model to Vega Aries Eco
- Ensure, the board is connected to the computer.
- Run CASP and open the target project ‘CASP/support/examples/casp_udio_examples/udio_led_control_aries_eco/control_led_udio_target_eco/control_led_udio_target_eco.prj’ from CASP installed directory.
- Open ‘Setup Simulation’ window and change the ‘Target Programmer Port’ to which the board is connected.
- Click Run button to program the board.
Run Native Model on Host Computer
- Ensure, the board is connected to the computer.
- Run CASP and open the native project ‘CASP/support/examples/casp_udio_examples/udio_led_control_aries_eco/control_led_udio_native_eco/control_led_udio_native_eco.prj’ from CASP installed directory.
- Double click on the serial port block ‘serial0’ and set the serial port to which the board is connected.
- Click Run button to start simulation. Simulation panel should show a plot similar to below figure.

