This example project demonstrates how to monitor and control analog & digital inputs and outputs of Vega Aries development board from host PC through WiFi using CASP.
Target
Aries v2.0 development board is used in this project. However, any supported micro-controller board can be used. ESP8266 WiFi module is used with the micro-controller board to enable wireless connectivity.
Pre-Requisites
- CASP software is installed on the host PC
- Vega Aries BSP is installed.
- The project files are located at CASP installed directory ‘CASP/support/examples/vega_aries_examples/iot/01_casp_gpio_server’. These are also available for download at this link.
Connection Diagram & Model
Connect any sensor to the ADC pins A0 and A1 of the target board for sensing. On-board LEDs are used for controlling. Two servos may be connected to the PWM2 and PWM3 pins. Connect any DC motor through a suitable driver circuit to PWM0 output of the board.

Procedure
- Connect the peripherals as shown in above connection diagram and connect the target board to the host PC.
- Launch CASP and open the downloaded project.
- Click ‘Setup Simulation’ to open a dialog box.
- Select ‘Target Programmer’ to ‘Programmer0’ to upload the program to RAM or ‘Programmer1’ to upload the program to flash memory of the target board.
- Set the ‘Target Programmer Port’ to which the board is connected.
- Save and Close the dialog box.
- Click Run button to build and program the board.
- The ESP8266 block in the ‘target_model’ is configured as ‘Access Point’ mode with IP address 10.10.0.1. As such, after the board is programmed the on-board LED LD2 should blink after some time indicating that the board is ready to communicate.
- Connect the host PC to the board’s WiFi access point. The access point will appear with SSID ‘esp8266_ap’ and password ‘0000000000’.
- After the WiFi connection is established run another instance of CASP on the host PC and load the ‘native_model’ project.
- Click on Home->Simulation->Configure Simulation IO menu item. ‘Configure Simulation Hardware’ window will open. Click on ‘Connect Device’ button to connect to the board as shown in below figure. After the connection is established check the ‘Online Data’ option to start communicating with board with cycle times around 30 msec as shown in below figure. Target board is now available as end point ‘EP0’ to the native model. Native model can use this end point to transfer data with respective IOs on the target.

- Run the model by clicking on the Run button. A simulation panel window should open and communicate with the board. A screen shot of the simulation panel window is shown below.

