Hello World

Description

This application presents a basic usage of the SPARK Wireless Protocol Stack (WPS). This is a good starting point for anyone wanting to design links using the WPS. This application creates a synchronized bidirectional link between 2 devices to exchange predetermined data. Various new concepts such as the “schedule” and “timeslots” are introduced in this example. More details can be found in the Wireless Protocol Stack section.

Behavior

In this example, two devices are setup with the same behavior. Both devices will send a packet every 50ms. The payload consists of the string “Hello World” along with a number that increments at each transmission. Upon receiving the packet, the application will send the message to the USB interface. To see the message, simply connect and configure a serial terminal software to the device’s serial port on your PC. The text “Hello-World” and incrementing numbers will appear on the terminal window when the wireless link (and terminal) is working. 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. You can observe LED0 blinking very quickly when communication is successful; this is because LED0 blinks every time a packet is successfully transmitted (which implies a successful ACK has been received following the transmission). The following diagram shows the role of each device in time.

Hello Word schedule

Configuration

Host terminal configuration should be as follows:

  • Speed (baud): 115200

  • Data bits: 8

  • Stop bit: 1

  • Parity: None

  • Flow control: None