The following figure illustrates the program flow for the SAMC21 application. This
application performs initialization of the peripherals (GPIOs, USART and SPI), the LEDs
and the OLED display. The ATA5831 RF transceiver is
switched into RF Polling mode to check for the reception of a valid Remote Sensor
signal. In addition, the base station initializes a timer for time measurements between
RF signal transmissions. The software, then, enters into an infinite loop to check for
an RF event signal from the RF transceiver or for a button press of one of the buttons
on the OLED1-XPRO extension board. A button press shows the corresponding information on
the OLED display (see the following figure). When the base station detects an RF event,
the RX and RSSI buffer are read and the RX data are checked with their checksum to be a
valid data stream. If the data is not valid, the base station enables the Polling mode
to check for another RF signal. If the data is valid, the base station sends an
acknowledgment telegram and waits for an RF answer telegram. At last, the OLED display
shows the received temperature and RSSI data. All the text on the OLED display is also
streamed via the USART peripheral, and the user can see the same on the PC terminal
program connected to the virtual COM port of the ATSAMC21-XPRO evaluation kit.Figure 5-2. Flash Application for the
SAMC21 MCU
The OLED display shows the following information:
Start page – Displays the welcome message with software and transceiver
firmware version information and awaits a Remote Sensor signal
ATA8510-EK1 Demo Kit
(c)2022 Microchip V4.0
waiting for RF signal
.....
Button 1 menu – Displays RF signal
characteristics
RF-Channel 433.92MHz
Data rate 8kBit/s
FSK deviation +/-8kHz
Manchester coding
Button 2 menu – Displays parameters used for the virtual COM port. These
parameters must be set in the PC terminal application to receive the text
strings.
COM port settings
baudrate 38.4kBaud
8 data + 1 stop bit
no parity, no handshake
Button 3 menu – Displays receiver packet
statistics
Measurement results – The measurement display shows the time interval
dt between two consecutive RF telegram receptions
together with the RSSI value for the RF signal strength at the base station
and at the remote sensor. The temperature at the sensor is shown with a
resolution of 1°C.
If there is an error, the OLED displays the following error messages:
When the received data telegram
is corrupted or when the temperature sensor is broken or not
present
The online versions of the documents are provided as a courtesy. Verify all content and data in the device’s PDF documentation found on the device product page.