Hello World

Description

This Hello World application presents a standard and basic usage of the SPARK Wireless Core. This is a good starting point for anyone wanting to design wireless links using the Wireless Core. This application creates a synchronized bidirectional link between 2 devices to exchange predetermined data.

Behavior

In this example, two devices are setup with the same behavior. Both devices transmit a packet to the other device. The payload consists of the string “Hello, World!” appended with an 8-bit counter value. The counter value is incremented before each transmission. Upon receiving the packet, the application prints the message with useful statistics on a serial interface.

To see the message, simply connect and configure a terminal emulator software to the device’s serial port on your PC.

The first device is set up as a “Coordinator” and the second as a “Node”. The Node device will synchronize its clock to the Coordinator device, ensuring that both devices are synchronized to the same time schedule.

The following diagram illustrates the general structure of the schedule used in this application.

Hello Word schedule

Coordinator Device

  • LED0 toggles every time a packet is successfully transmitted to the Node (almost always on because of the high packet rate).

  • LED1 toggles every time a packet is successfully received from the Node (almost always on because of the high packet rate).

Table 1: Coordinator User Interface Description

Interface

Name

Description

SW1

Reset Stats

Reset the TX and RX statistics

SW2

N/A

N/A

LED0

Transmission Success

Toggle LED when a wireless transmission is successful.

LED1

Reception Success

Toggle LED when a wireless reception is successful.

LED2

N/A

N/A

Node Device

  • LED0 toggles every time a packet is successfully transmitted to the Coordinator (almost always on because of the high packet rate).

  • LED1 toggles every time a packet is successfully received from the Coordinator (almost always on because of the high packet rate).

Table 2: Node User Interface Description

Interface

Name

Description

SW1

Reset Stats

Reset the TX and RX statistics.

SW2

N/A

N/A

LED0

Transmission Success

Toggle LED when a wireless transmission is successful.

LED1

Reception Success

Toggle LED when a wireless reception is successful.

LED2

N/A

N/A

Configuration

Dual Radio

The Wireless Core supports a configuration called Dual Radio where a single board can make use of two physical transceivers of the same model (e.g. 2x SR1020) for increased RF coverage. By adding the global symbol “WPS_RADIO_COUNT 2” in the Hello-World Node build configuration, the Node can activate a section of the code that configures a second transceiver. This feature requires a custom board with two physical transceivers. The SPARK EVK board has only one transceiver, so it cannot be used to demonstrate this feature.

Important

Do not activate the dual radio feature if using a board, such as the SPARK EVK, that has only one physical transceiver or the code will not compile due to missing board support package functions.

Terminal

Host terminal configuration should be as follows:

  • Speed (baud): 115200

  • Data bits: 8

  • Stop bit: 1

  • Parity: None

  • Flow control: None

The following figure shows the serial interface output of this application.

Serial interface output example

Figure 7: Hello World serial interface output.