Ethernet Communication with ENC28J60 using CASP

 

This example project demonstrates how to establish Ethernet communication between the target board and the host (native) PC with ENC28J60 module. We try to acquire analog periodic signal from the target board to the host PC through Ethernet and plot the signal on the host PC.

 

Hardware Required

·     Vega Aries v2.0 is used for interfacing with ENC28J60. However, any supported boards can be used.

·     A suitable signal generator for generating analog input voltage.

 

Description

Connect the circuit as shown in the circuit diagram. Since ENC28J60 module communicates in raw Ethernet frame format user may need to install Npcap drivers and libraries on the host PC before continuing.

 

Following are the steps to properly program the target board.

·     Connect the target board 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 Hardware 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.

 

Following are the steps to run the native model on the native PC

·     Load the ‘native_model’ project.

·     With the target board connected to the host PC, double click on ‘SimPanel IP’ block and change the ‘Remote IP/MAC Address’ to the device MAC address if required.

 

·     Run the model by clicking on the Run button. A simulation panel window should open and communicate with the board.

·     Screen shot of the output for 10Hz frequency sine wave source connected to the A0 pin.

 

·     Screen shot of the output for 100Hz frequency sine wave source connected to A0 pin.

 

Circuit Diagram & Models

References

Please go through our video tutorials, tutorial projects and CASP main documentation for getting started with CASP.