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.

CC3100 Get Time Application

From Texas Instruments Wiki
Jump to: navigation, search
Cc31xx cc32xx return home.png
Cc31xx return sample apps.png

Overview and application details[edit]

This sample application demonstrates how to connect to an SNTP server and request for time information. The application processes the received data and displays the time on console.

NoteNote: This wiki page is only applicable for CC3100-SDK v1.0.0 and upward releases. For documentation on older SDKs' examples, refer corresponding file in <cc3100-sdk-installation-location>\cc3100-sdk\docs\examples\'

Source Files briefly explained[edit]

i. main - Initializes the device, connects to an AP, open an UDP socket, requests and displays the time information.

Usage[edit]

Prerequisite: This application requires an access-point with internet connectivity

  • Connect the board to a Windows-PC and configure the terminal-program for seeing the logs - Terminal Setting page has detailed instructions for configuring the terminal-program
  • Edit main.c to set the SNTP server's name (in variable SNTPserver) - Any server from the below list can be used for demo
   /*! ######################### 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
    *! ## 0.in.pool.ntp.org         | 123.108.225.6    | India
    *! ## For more SNTP server link visit 'http://tf.nist.gov/tf-cgi/servers.cgi'
    *! ###########################################################################
    */
    const _u8 SNTPserver[30] = "nist1-pa.ustiming.org"; /* Add any one of the above servers */
  • Edit sl_common.h and update the following parameters for the device to establish connection w/ the access-point
   #define SSID_NAME       "<ap_name>"
   #define SEC_TYPE        <security-type>
   #define PASSKEY         ""
  • Edit main.c and modify values for below macros for settings the GMT time-offset
   #define GMT_TIME_ZONE_HR        0
   #define GMT_TIME_ZONE_MIN       00
  • Build and run the application
  • See the self explanatory logs on the terminal-program's console.
   The application connects to the SNTP server and opens an UDP socket to communicate w/ it.
   It receives and processes the time-information and displays it on the console
  • On success, below message will be displayed on the terminal
Get_time_1.png

Limitations/Known Issues[edit]

None

Links[edit]

{{#invoke: Navbox | navbox }} {{#invoke: Navbox | navbox }}

E2e.jpg {{
  1. switchcategory:MultiCore=
  • For technical support on MultiCore devices, please post your questions in the C6000 MultiCore Forum
  • For questions related to the BIOS MultiCore SDK (MCSDK), please use the BIOS Forum

Please post only comments related to the article CC3100 Get Time Application here.

Keystone=
  • For technical support on MultiCore devices, please post your questions in the C6000 MultiCore Forum
  • For questions related to the BIOS MultiCore SDK (MCSDK), please use the BIOS Forum

Please post only comments related to the article CC3100 Get Time Application here.

C2000=For technical support on the C2000 please post your questions on The C2000 Forum. Please post only comments about the article CC3100 Get Time Application here. DaVinci=For technical support on DaVincoplease post your questions on The DaVinci Forum. Please post only comments about the article CC3100 Get Time Application here. MSP430=For technical support on MSP430 please post your questions on The MSP430 Forum. Please post only comments about the article CC3100 Get Time Application here. OMAP35x=For technical support on OMAP please post your questions on The OMAP Forum. Please post only comments about the article CC3100 Get Time Application here. OMAPL1=For technical support on OMAP please post your questions on The OMAP Forum. Please post only comments about the article CC3100 Get Time Application here. MAVRK=For technical support on MAVRK please post your questions on The MAVRK Toolbox Forum. Please post only comments about the article CC3100 Get Time Application here. For technical support please post your questions at http://e2e.ti.com. Please post only comments about the article CC3100 Get Time Application here.

}}

Hyperlink blue.png Links

Amplifiers & Linear
Audio
Broadband RF/IF & Digital Radio
Clocks & Timers
Data Converters

DLP & MEMS
High-Reliability
Interface
Logic
Power Management

Processors

Switches & Multiplexers
Temperature Sensors & Control ICs
Wireless Connectivity