CASP supports exchanging data between micro-controller and host computer with very low latency Ethernet communication. Data received from the micro-controller can then be used in CASP models on host computer or can be visualized with the help of CASP GUI widgets such as plotters, dials, 2D/3D graphs.
This example project demonstrates how to establish Ethernet communication between the Vega Aries (with ENC28J60 module) and the host (native) computer using CASP. We try to acquire analog periodic signal from the target board to the host PC through Ethernet and plot the signal on the host computer.
Pre-Requisites
- Vega Aries v2 for interfacing with ENC28J60 is used in this project. However, any supported micro-controller board can be used.
- A suitable signal generator (1 to 100 Hz) to test the Ethernet latency of complete setup.
- ENC28J60 Ethernet module.
- CASP software is installed along with CASP Python Libraries (optional).
- Vega Aries BSP is installed.
- The project files are located at CASP installed directory ‘CASP/support/examples/vega_aries_examples/communication/02_enc28j60’. These are also available for download at this link.
Connection Diagram
Connect the circuit as shown below. Since ENC28J60 module communicates in raw Ethernet frame format user may need to install Npcap drivers and libraries on the host PC before continuing.

CASP Model for Vega Aries

Procedure
- Connect Vega Aries to the host PC via a USB cable.
- Note the serial port number to which the board is connected to the host PC, from the host operating system.
- Run CASP and load the ‘target_model’ project.
- Open Home->Simulation->Setup Simulation Parameters menu item. Under TargetHW->General tabs set ‘Target Programmer Port’ parameter to the serial port to which the board is connected.
- Build the model and program the board by clicking on Run button.
CASP Model that runs on Host Computer

Procedure
- Run CASP and load the ‘native project’.
- Open the ‘native.wsp’ workspace file. Double click on the ‘Serial SimPanel’ block and set ‘Serial Port Settings->Serial Port’ parameter to the serial port to which the board is connected as shown in above figure.
- Click Run button to build the model and start simulation. A simulation panel window should open and communicate with the board. Screen shots for 10 Hz and 100 Hz sine wave input at the ADC port of Vega Aries are shown below.

