Star Network

Description

This application uses the WPS to implement a Star Network. The Star Network is composed of 3 SPARK devices, one Coordinator and two Nodes. Communication is bidirectional between a Coordinator and a Node. This application provides a basic example of how to configure a point to multipoint connection.

Behavior

The Coordinator communicates bidirectionally with each Node. The Nodes do not communicate with each other. There are two types of information exchanges in this application.

  1. Count Values: The Nodes send a “count value” to the Coordinator and the Coordinator sends a “count value” to both Nodes. Each device displays the count value it receives on a display linked to its USB interface. To see the messages, simply connect a serial terminal software to the device’s serial port on your PC.

  2. Switch State: Pressing switches on the transmitting device will momentarily replace the “count value” in the sent packets by the switch’s state. When that happens, the receiving device will reflect the switch state on its LED instead of sending the packet’s payload to the serial port.

    • Pushing the SW1 button on Node 1 will turn on LED0 on the Coordinator.

    • Pushing the SW1 button on Node 2 will turn on LED1 on the Coordinator.

    • On the Coordinator, pressing SW1 or SW2 buttons will turn on LED0 on Node 1 and LED0 on Node 2 respectively.

The schedule used for this application is different than the other application example schedules since we now have 3 devices sharing the air time. The schedule structure is shown in the diagram below.

Star Network schedule

Configuration

Setting a compile option is required on the Node devices since more than one can be used. The following table shows the possible value associated with each Node. Note that this is done automatically with the provided build configurations in the STM32CubeIDE project.

Role

Value

Node 1

NODE1

Node 2

NODE2

Host terminal configuration should be as follows:

  • Speed (baud): 115200

  • Data bits: 8

  • Stop bit: 1

  • Parity: None

  • Flow control: None