NOTICE: The Processors Wiki will End-of-Life on January 15, 2021. It is recommended to download any files or other content you may need that are hosted on processors.wiki.ti.com. The site is now set to read only.
CC3200 Info Center Get Time Application
Contents
Overview[edit]
Get Time application connects to a SNTP server, request for time, process the data and displays the time on Hyperterminal. The communication between the device and server is based on the Network Time Protocol (NTP).
Application details[edit]
Get Time application connects to a open AP with SSID "cc3200demo" (common.h). In case the connection to this default AP is unsuccessful, the user is prompted to enter the AP details on the hyperterminal.
The AP details have to be entered in the format as specified below:
<ap_ssid>:<security_type>:<password>:<wep_key_id>:
- ap_ssid - ssid of the AP to be connected
- security_type - values 1(for Open) or 2(for WEP) or 3(for WPA)
- password - network password in case of 2(for WEP) or 3(for WPA)
- wep_key_id - key ID in case of 2(for WEP)
The RED LED continuously blinks as long as a connection with AP is not established. Once established, the RED LED stays continuously ON.
User can use any of the listed servers to get the time by changing the variable <syntaxhighlight lang="c"> //! ######################### list of SNTP servers ################################## //! ## //! ## hostname | IP | location //! ## ----------------------------------------------------------------------------- //! ## nist1-nj2.ustiming.org | 165.193.126.229 | Weehawken, NJ //! ## nist1-pa.ustiming.org | 206.246.122.250 | Hatfield, PA //! ## time-a.nist.gov | 129.6.15.28 | NIST, Gaithersburg, Maryland //! ## time-b.nist.gov | 129.6.15.29 | NIST, Gaithersburg, Maryland //! ## time-c.nist.gov | 129.6.15.30 | NIST, Gaithersburg, Maryland //! ## ntp-nist.ldsbc.edu | 198.60.73.8 | LDSBC, Salt Lake City, Utah //! ## nist1-macon.macon.ga.us | 98.175.203.200 | Macon, Georgia //! //! ## For more SNTP server link visit 'http://tf.nist.gov/tf-cgi/servers.cgi' //! ################################################################################### const char g_acSNTPserver[30] = "nist1-nj2.ustiming.org"; </syntaxhighlight> Depending on the region of interest, the GMT offset can be changed by changing the macro: <syntaxhighlight lang="c">
- define GMT_DIFF_TIME_HRS 5
- define GMT_DIFF_TIME_MINS 30
</syntaxhighlight> Get time application gives the current time in the configured time zone. This application can be used to get familiar with using UDP sockets to communicate with server.
Source Files briefly explained[edit]
- network_if - Common functions to handle connection to AP and FreeRTOS hook functions.
- gpio_if - Basic GPIO interface APIs. Used to control the RED LED.
- main - Initializes the device, connects to a AP, Open a UDP socket, Request and display time
- pinmux - Assigns a personality to the pins at the device boundary
- uart_if - To display status information over the UART
- timer_if - Wrapper function for timer module driver
- startup_* - Tool specific vector table implementation
Usage[edit]
- Setup a serial communication application (HyperTerminal/TeraTerm). For detail info visit CC31xx & CC32xx Terminal Setting
On the host PC, open a hyperterminal, with the following settings- Port: Enumerated COM port
- Baud rate: 115200
- Data: 8 bit
- Parity: None
- Stop: 1 bit
- Flow control: None
- Run the reference application (Flashing the bin/IAR/CCS).
- Open the Project as mentioned in 'docs\CC3200-Getting Started Guide.pdf'.
- Build and download the application to the board
- Application requires the AP to have the internet connectivity.
- On the Hyperterminal, in case the connection to this default AP is unsuccessful, the user is prompted to enter the AP details.
- The RED LED continuously blinks as long as a connection with AP is not established. Once established, the RED LED stays continuously ON.
- The current time as obtained from the SNTP server is displayed on the Hyperterminal periodically.
- Terminal snapshot when application runs on device:
Limitations/Known Issues[edit]
- WEP connectivity with this example is not tested.
Links[edit]
{{#invoke: Navbox | navbox }} {{#invoke: Navbox | navbox }}