Receiver state machine on AX5043 (RADIOSTATE)

Добрый день! В моём приложении необходимо отслеживать моменты прихода преамбулы и синхрослова, как полагается я настроил прерывания через регистры IRQMASK0 бит RQMRADIOCTRL(6), регтистр RADIOEVENTMASK0 бит REVMRXPARAMSETC
HG(3). И что я увидел в своем приложении по фронту импульса (1) см. фото. я вычитываю значение (0x0D) (Rx Preamble 2) регистра RADIOSTATE, что мне не совсем понятно я ожидал значение (0x0С)Rx Preamble 1. Потом в прерывании импульса (2) а наблюдаю значение 0x0С. Это меня заводит в ступор потому что по логике должно быть сначала детектирование Preamble 1 а потом Preamble 2. Я наблюдаю ситуацию наоборот.

Hi @AjaxSystems ,
In RADIOEVENTMASK0 you have enabled REVMRXPARAMSETCHG and therefore are obesrving the change of RXPARAMETER register rather than the state transitions of RADIOSTATE. To fire an interrupt for RADIOSTATE change events you shall enable bit 2 REVMRADIOSTATECHG.
The receiver state machine of the AX5043 operates as shown in Figure 13 of the programming manual:

Note that the state transitions occur when the matching unit fires a match (MATCH1/MATCH0) and when the corresponding TMRXPREAMBLEx is different from zero.
By default our easyax5043 radio driver is programmed by config.c to go through the following RADIOSTATE stages= PREAMBLE1(0xC) → PREAMBLE2 (0xD) → RX PACKET (0xF).
If DIVERSITY is enabled, you want the AGC to reset itself for each antenna, this is why TMGRXPREAMBLE1 is set to different from 0 and RADIOSTATE transitions through RX Antenna Selection (0x9).

Normally the radio will stay in PREAMBLE1 until the preamble sequence in MATCH1PAT (16bits) is found in the receiving bitstream. Then the RADIOSTATE will jump to PREAMBLE2 and wait for the sync word sequence MATCH0PAT (32 bits) to match. After packet reception (RX) the statemachine falls back as RX (0xF) → PREAMBLE2 (0xD) → PREAMBLE1 (0xC) and returns to look for a valid preamble.

Note the inconvenient naming of the states and parameter sets:

  • RADIOSTATE==PREAMBLE1, loads RXPARAMSET 0, and is used for preamble detection of MATCH1PAT;
  • RADIOSTATE==PREAMBLE2, loads RXPARAMSET 1, and is used for sync word detection of MATCH0PAT;
  • we don’t use PREAMBLE3 as TMGRXPREAMBLE3==0;