4.2.
Base Station Application for SAMD20 MCU
The program flow for the SAMD20 application is illustrated in
. This application performs at the
start an initialization of the peripherals, the LEDs and the OLED display. The ATA8515 RF transceiver is
switched into RF polling mode to check for the reception of a valid remote sensor signal. In addition a
timer is initialized for time measurements between RF signal transmissions. The software is then entering
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 extension board. A button press will show the corresponding information on the
OLED display as shown in
. When a RF event is detected 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 polling
mode is enabled again to check for another RF signal. If the data is valid an acknowledge signal is send
followed by waiting for an RF answer telegram. Finally the received temperature and RSSI data are
shown on the OLED display. All text shown on the OLED display is also streamed via the USART
peripheral and can be shown on a PC Terminal program connected to the virtual COM port of the
SAMD20 kit.
Figure 4-2. Flash Application for SAMD20 MCU
Initialisation
IO, USART, SPI, ATA8515,
OLED, LED
Reset
Display temperature and
RSSI data
yes
yes
yes
no
no
RF event?
Set ATA8515 in Polling mode
Enable timer
Show COM port settings
Show RF statistics
Read RX and RSSI buffer
Send Acknowledge
Wait for Sensor answer
no
no
no
Button 1
pressed?
Button 2
pressed?
Button 3
pressed?
Data correct?
Show RF settings
yes
yes
Atmel User Guide for the Evaluation Kit ATA8510-EK1 [APPLICATION NOTE]
Atmel-9343D-ATAN0046_Application Note-09/2016
14