|Description||This application focuses on demonstrating the use of CC3000 commands to retrieve the IP address of a given host name.|
This application note requires that the reader have already read the brief presentation related to initializing and establishing connection to an access point. This documentation is limited to discussing the addition of a string. The additional string is the identification of a server from the internet. The remote IP address of the string will be resolved in this project.
Pre-requisite Application Note:
Before getting started, the following are required:
- The target module can also be a Diablo16 display
Visit www.4dsystems.com.au/products to see the latest display module products that use the Diablo16 processor.
- 4D Programming Cable or µUSB-PA5
- micro-SD (µSD) memory card
- Workshop 4 IDE (installed according to the installation document)
- When downloading an application note, a list of recommended application notes is shown. It is assumed that the user has read or has a working knowledge of the topics presented in these recommended application notes.
This application is focused to demonstrating the use of CC3000 commands to retrieve the IP address of a given host name.
For instructions on how to launch Workshop 4, how to open a ViSi project, and how to change the target display, kindly refer to the section “Setup Procedure” of the application note
For instructions on how to create a new ViSi project, please refer to the section “Create a New Project” of the application note
Design of the Project
In this project couple of objects were used to provide a simple user interface form for the CC3000. In this project, a space is provided to display the encoded website address. The information given in the space provided for the website will have is IP address resolved in this project.
These icons show the status of connecting to the network. The progress percentage display at the internal functions are executed and completed.
If the access point SSID and PASSKEY have all been entered as represented by the check mark beside the spaces. The next icon to consider is the connect command execute icon.
This icon contains the command that takes the input strings from the SSID and PASSKEY which was entered by the use and sends it to the CC3000 via the SPI port 2 of the Diablo 16.
** NOTE: A child program is run in flash bank 2. The program included in the zip file with this project.
In this part of the application note statements that were written in 4DGL will be shown. These statements are used to produce the functionality desired for this project application. Each of the sub-routines has a group of statements that are intended for a designated purpose only.
The statements presented here are called upon in the main function later in this document. It is best to present the purpose of each sub-routine for us to be able to easily understand the main program statements.
Most of the subroutines in this projects are already used and mentioned from the pre-requisite application notes listed at the overview.
This sub-routine contains the command to transport data to flashbank_2. Notice that there is memory allocation in the statements. The memory set allows data to be saved to the location while a program is run in the other flash bank locations.
The wifi_connect()executes commands from the secondary flash, which is this case is FLASHBANK 2, by passing parameters. To pass the parameters, wlan(…) subroutine is used the first seven parameters are used to identify the command to be used and the data needed by the command. On the other hand the 8th parameter of the command identifies an array where the data will be returned. For example, the command below direct that the website’s address be resolved and save the remote IP address to array ‘result’. The statement below is the actual command to retrieve the address.
The commands being executed in this subroutine covers the essential commands for initializing and setting up the CC3000. After initialization has been made, only then connections to access points can be done. If a successful retrieval of IP address is attained the project should display the remote address of the specified host name. Regardless of success of the address retrieval the output will be displayed on the screen using the statements below.
Refer to the section "Connect the WiFi Module to the uLCD-35DT" of the application note
for the connection diagram of the WiFi module to the 4D display.
For instructions on how to save a ViSi project, how to connect the target display to the PC, how to select the program destination, and how to compile and download a program, please refer to the section “Run the Program” of the application note
After downloading the project, if using a uLCD-35DT, wire the 30-way header on the Diablo display similar to the one below.