Today we are presenting an example on how to use the Arduino Ethernet Shield. In this example we have ported the Arduino Ethernet libraries and dependent core libraries to the PSoC 4. In this example we implement a web server application using the Pioneer Kit. This project can be used as a base platform for any Ethernet application using the PSoC 4 Pioneer Kit.
This example is fairly complex so please take some time to review the supplemental documentation we’ve provided on this example. In this example we’ve ported the C++ libraries from Arduino into PSoC. We’ve included documentation on how the firmware for this project was developed, but also documentation on how we ported the C++ code to PSoC.
- Ethernet Shield
Forum Post Attachments:
At the bottom of this post we are including the following items:
- Example Project Zip File
- Zip File of Images
- Project Schematic
- Component Configurations
The user can download the example project at the bottom of this post. The project uses the following list of Creator Components:
The components are configured by right clicking on the component in your Top Design schematic view and selecting Configure. Please enable the following selections in the Configuration windows for the listed components above.
The main.c firmware is included in the example project. Please review the commented sections for more details.
The detailed firmware description for this example project is long so we’ve attached it to this post. This example ports the Ethernet libraries from the Arduino software to the PSoC 4. The libraries are used to create a simple web server that provides inputs to the user through hyperlinks. When the user selects these links they will be able to control the RGB LED on the Pioneer kit. For more information on the Firmware and the porting from the Arduino libraries please take a look at the attached guide below.
For this example the user will need to populate the six pin J12 header. This header is located near the CapSense slider on the Pioneer board. The Arduino Ethernet shield uses the 6 pin connector for the SPI communications with the WiFi processor. You will need to populate this header to use this shield board.
For more information on the 6 pin header and part number please reference the Pioneer Kit Bill of Materials (BOM) section of the User Guide.
Once the connector is populated then please connect the Ethernet Shield to the Pioneer board. There are no other hardware connections needed.
Test Your Project:
Stack your Ethernet shield on your Pioneer Board.
Open the command prompt on your PC. Type in ‘ipconfig’ and you will get able to find your LAN default gateway. This assumes that your PC is connected to the internet. You will need to modify the main.cpp file with the updated Gateway IP address. For example, if your IP address is “444.444.4.4” then set the IP address in your main.cpp file to “444.444.4.402”.
Then recompile the project and program the Pioneer kit. Connect an Ethernet cable from the RJ45 connector on the Ethernet shield to the router.
Open a browser on the PC and type in the IP address that you configured above into the URL bar.
The browser will display the web page created by the Pioneer kit and Ethernet shield. Click on the links on the web page to control the RGB LED behavior on the Pioneer kit.
I hope this example can help you in your design.