Antenna diversity on MKW21D512

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Antenna diversity on MKW21D512

2,352 Views
lixn_paulian
Contributor II

Hi,

We are trying to activate the antenna diversity feature (FAD) on a radio we designed with the MKW21D512 (we use the Skyworks SE2436L Front End that includes also the antenna switch). Problem is, it doesn't operate properly: the antenna switch shows as it would "hunt" for a preamble all the time, even then when a frame is received. It switches back and forth with the specified 28us interval, but never decides to stop on a specific antenna (the better one). We've done a setup where one of the antenna input delivers a better signals than the other, but due to this permanent switching, the resulting LQI is jumpy.

There is unfortunately no application note from Freescale showing how are the involved registers to be set. There is also at least one undocumented register, FAD_THR (0x50, probably FAD threshold), but there is no reference to what this register is supposed to do. In our application we activated FAD by setting bit 0 in the ANT_AGC_CTRL register (0x51). We played around with the FAD_THR, and it clearly makes a difference, but we couldn't see that the FAD feature works. Is it anything else required to do?

After googling the Internet on this issue and finding almost nothing (there is only this post on this forum: KW24D512 antenna diversity which doesn't say anything about the register configuration; and the APIs referenced in the post are nowhere to find!), we start to believe that this feature simply doesn't work (silicon bug?). Did anyone managed to use the Fast Antenna Diversity feature on these chips?

Labels (2)
8 Replies

1,847 Views
billpoole
Contributor III

Thanks for posting this.

FAD picks the first antenna with a signal that meets the criteria of 1.5 s0 (the preamble), not necessarily the stronger of the two antennas. If one signal is at -30 dBm and the other signal is at -95 dBm, the receiver can choose the -95 dBm signal just as often as the -30 dBm signal. Although from your description, it appears as though your system is not receiving either signal.

First be certain that the ANT_A and ANT_B are configured in 0x30 as needed for your FEM and that all are assembled and functioning properly

If you disable FAD are you able to receive the signal on the one antenna? (ie is the receiver configured properly?)

Does the signal you are transmitting consist of a preamble long enough to detect during the 128us preamble search?

I am not aware of any Si bugs regarding FAD. I am conferring with our software and hardware team and will follow up as I learn more.

Bill Poole

Freescale Connectivity & IoT Applications.

0 Kudos

1,847 Views
lixn_paulian
Contributor II

(note: I'm resending my PM also here)

Hello William,

Thank you for taking on this one.

Your statement that "FAD picks the first antenna with a signal that meets the criteria of 1.5 s0 (the preamble), not necessarily the stronger of the two antennas. If one signal is at -30 dBm and the other signal is at -95 dBm, the receiver can choose the -95 dBm signal just as often as the -30 dBm signal” is hard to comprehend. The question is thus, how can FAD help if this is true? In my opinion, it can’t.

Enclosed you will find the function we use to manually switch (via a monitor program) between ANT A, ANT B and FAD. Switching between A and B leads to the expected results, i.e. the difference between the direct signal (eg. on ANT A) and the attenuated signal (eg. ANT B). When switching to FAD, the received frames' LQI jumps between the values recorded for ANT A and ANT B in manual mode (see examples below).

The tests are conducted using a variant of your “Connectivity test” firmware, adapted to our monitor program. And of course we receive the frames on both antennas if we switch them manually, including in FAD mode. Below some examples of radio traffic:

Manual mode ANT A

Frame   1 of  10, LQI =  -76 dBm, data = 000102030405060708090A0B0C0D0E0F

Frame   2 of  10, LQI =  -76 dBm, data = 000102030405060708090A0B0C0D0E0F

Frame   3 of  10, LQI =  -75 dBm, data = 000102030405060708090A0B0C0D0E0F

Frame   4 of  10, LQI =  -76 dBm, data = 000102030405060708090A0B0C0D0E0F

Frame   5 of  10, LQI =  -76 dBm, data = 000102030405060708090A0B0C0D0E0F

Frame   6 of  10, LQI =  -76 dBm, data = 000102030405060708090A0B0C0D0E0F

Frame   7 of  10, LQI =  -76 dBm, data = 000102030405060708090A0B0C0D0E0F

Frame   8 of  10, LQI =  -76 dBm, data = 000102030405060708090A0B0C0D0E0F

Frame   9 of  10, LQI =  -76 dBm, data = 000102030405060708090A0B0C0D0E0F

Frame  10 of  10, LQI =  -76 dBm, data = 000102030405060708090A0B0C0D0E0F

Good: 100% (10 out of 10)

Manual mode ANT B:

Frame   1 of  10, LQI = -101 dBm, data = 000102030405060708090A0B0C0D0E0F

Frame   2 of  10, LQI = -101 dBm, data = 000102030405060708090A0B0C0D0E0F

Frame   3 of  10, LQI = -101 dBm, data = 000102030405060708090A0B0C0D0E0F

Frame   4 of  10, LQI = -101 dBm, data = 000102030405060708090A0B0C0D0E0F

Frame   5 of  10, LQI = -101 dBm, data = 000102030405060708090A0B0C0D0E0F

Frame   6 of  10, LQI = -100 dBm, data = 000102030405060708090A0B0C0D0E0F

Frame   7 of  10, LQI = -101 dBm, data = 000102030405060708090A0B0C0D0E0F

Frame   8 of  10, LQI = -101 dBm, data = 000102030405060708090A0B0C0D0E0F

Frame   9 of  10, LQI = -100 dBm, data = 000102030405060708090A0B0C0D0E0F

Frame  10 of  10, LQI = -101 dBm, data = 000102030405060708090A0B0C0D0E0F

Good: 100% (10 out of 10)

FAD mode:

Frame   1 of  10, LQI = -101 dBm, data = 000102030405060708090A0B0C0D0E0F

Frame   2 of  10, LQI =  -76 dBm, data = 000102030405060708090A0B0C0D0E0F

Frame   3 of  10, LQI =  -76 dBm, data = 000102030405060708090A0B0C0D0E0F

Frame   4 of  10, LQI = -101 dBm, data = 000102030405060708090A0B0C0D0E0F

Frame   5 of  10, LQI =  -76 dBm, data = 000102030405060708090A0B0C0D0E0F

Frame   6 of  10, LQI =  -76 dBm, data = 000102030405060708090A0B0C0D0E0F

Frame   7 of  10, LQI =  -77 dBm, data = 000102030405060708090A0B0C0D0E0F

Frame   8 of  10, LQI =  -77 dBm, data = 000102030405060708090A0B0C0D0E0F

Frame   9 of  10, LQI =  -78 dBm, data = 000102030405060708090A0B0C0D0E0F

Frame  10 of  10, LQI = -103 dBm, data = 000102030405060708090A0B0C0D0E0F

Good: 100% (10 out of 10)

Our expectation is that in FAD mode the device selects ANT A and stays there. It is worth mentioning that when looking with a scope on the pin ANT A in FAD mode, this pin is continuously toggling as if no preamble is ever detected. This explains also the above results.

Below is the function we use to switch between ANT A, ANT B and FAD mode:

I would be grateful for any suggestions.

Code to switch antennas in various modes:

enum antennaSel_t

{

  ANTENNA_A,

  ANTENNA_B,

  ANTENNA_FAD

};

void antennaSelection(int antenna)

{

  uint8_t current;

  current = MC1324xDrv_IndirectAccessSPIRead(ANT_AGC_CTRL);

  if (antenna == ANTENNA_FAD)

  {

  /* switch antenna diversity on */

  current = MC1324xDrv_IndirectAccessSPIRead(ANT_AGC_CTRL);

  MC1324xDrv_IndirectAccessSPIWrite(ANT_AGC_CTRL, current |= 1);

  MC1324xDrv_IndirectAccessSPIWrite(ANT_PAD_CTRL, 0xB);

  MC1324xDrv_IndirectAccessSPIWrite(FAD_THR, 25);

  }

  else

  {

  /* switch antenna diversity off */

  MC1324xDrv_IndirectAccessSPIWrite(ANT_AGC_CTRL, current &= 0xFE);

  /* switch antenna to A or B */

  current = MC1324xDrv_IndirectAccessSPIRead(ANT_PAD_CTRL);

  if (antenna == ANTENNA_B)

  {

  current |= 0x10;

  current &= 0xDF;

  }

  else

  {

  current |= 0x20;

  current &= 0xEF;

  }

  MC1324xDrv_IndirectAccessSPIWrite(ANT_PAD_CTRL, current);

  }

  nvConfig.ant_mode = antenna;

  saveConfig();

}

0 Kudos

1,847 Views
billpoole
Contributor III

Sorry only limited update today

our software team assures me that FAD does indeed function, so there are no Si bugs in it.

as to your inquiry:

"... statement that "FAD picks the first antenna with a signal that meets the criteria of 1.5 s0 (the preamble), not necessarily the stronger of the two antennas. ... The question is thus, how can FAD help if this is true? In my opinion, it can’t."

If any antenna has a strong enough signal to receive then receive it no need to pick the stronger signal. FAD will help in the case where one antenna has a satisfactory signal and the other has no signal or a signal buried in the noise precluding reliable reception.

Go back to ANT_B manual mode and decrease the signal level until the frame reception is 5 out of 10 or lower and repeat the test, see if it reliably grabs the only usable antenna.

Your data does seem to show what you describe that the antenna switch continues toggling during packet reception, as I understand it it should not do that, but maybe it does, since both antennas provide readable signals. (I need to confirm with designers)

Thanks

Bill Poole

Freescale Connectivity 7 IoT applications

0 Kudos

1,847 Views
lixn_paulian
Contributor II

We had some field testing today and anecdotal evidence suggests that FAD indeed helps when the signals are weak (down to less than -90 dBm). We will do additional laboratory testing this week and I will report back. In particular we want to double check if the antenna switch toggles during the reception of a frame, or only during the preamble.

0 Kudos

1,847 Views
billpoole
Contributor III

Antenna switch toggles, after the preamble (1.5 s0) is detected, Antenna is locked, and used for RX normal packet processing as well as TX, FAD is disabled until the next RX preamble detection.

Keep us informed as to your progress.

Bill Poole

Freescale Connectivity & IoT Applications.


0 Kudos

1,847 Views
lixn_paulian
Contributor II

Just a short note on the FAD issue: we did some testing today with the two inputs artificially attenuated with different coefficients and indeed the FAD works as described in the documentation. After detecting a valid preamble it remains steady. Under very low signal conditions, however sometimes the signal is lost before the end of the frame and then the antenna switch starts again to toggle. But in principle it works as documented.

Lix

1,847 Views
leper
Contributor II

Hi Lix,

Thanks for posting your results here, we have been trying to decide if it will be worth our while using the FAD feature in future products and as far as I know you're the first group to report any success with it. Just to clarify a couple of things from previous posts to make sure I understand:

FAD mode:

Frame   1 of  10, LQI = -101 dBm, data = 000102030405060708090A0B0C0D0E0F

Frame   2 of  10, LQI =  -76 dBm, data = 000102030405060708090A0B0C0D0E0F

Frame   3 of  10, LQI =  -76 dBm, data = 000102030405060708090A0B0C0D0E0F

Frame   4 of  10, LQI = -101 dBm, data = 000102030405060708090A0B0C0D0E0F

Frame   5 of  10, LQI =  -76 dBm, data = 000102030405060708090A0B0C0D0E0F

Frame   6 of  10, LQI =  -76 dBm, data = 000102030405060708090A0B0C0D0E0F

Frame   7 of  10, LQI =  -77 dBm, data = 000102030405060708090A0B0C0D0E0F

Frame   8 of  10, LQI =  -77 dBm, data = 000102030405060708090A0B0C0D0E0F

Frame   9 of  10, LQI =  -78 dBm, data = 000102030405060708090A0B0C0D0E0F

Frame  10 of  10, LQI = -103 dBm, data = 000102030405060708090A0B0C0D0E0F

Good: 100% (10 out of 10)

This appears to be FAD working as documented, i.e. sometimes the weaker signal path will be selected as long as it is above the minimum threshold. Is that the correct interpretation?

It seems strange that there is no way to configure the FAD feature to lock the strongest path every time. Would you agree that it would be better if the FAD logic did this, or am I missing some obvious reason that this likely wasn't done?

Finally, have you considered any active application-level control of your TX path based on previous path performance, as discussed in this thread: KW24D512 antenna diversity

Once again thanks for documenting your progress and results here! I will do the same once we have our new products under test. Hopefully we can fill in the blanks in Freescale's FAD documentation.

Cheers,

Tim

0 Kudos

1,847 Views
lixn_paulian
Contributor II

Hello Tim,

Yes, the FAD works exactly as documented, even though my initial assumption about the antenna selection algorithm was different. The description in the data sheet holds, i.e. the antenna that first detects a valid preamble will remain active throughout the whole frame. My assumption was that the device would check both antennas during a preamble and then would select the stronger one.

Our decision to use FAD or not, based on our results is not yet final, but the general feeling is that it doesn't bring so much gain as to justify the additional overhead of designing two antennas in our product. It may be however presented as a marketing argument. But as fir yet, we don't know.

As to your suggestion to implement a sort of antenna diversity at application level, this is not realistic as in practice the variances in signals between the antennas are so fast (e.g. due to multi path propagation in indoor use, as our devices are mostly used) that this would probably do more harm than good.

Currently we have other problems with the chip as it sends spurious signals during sequence switching to/from Transmit mode. This hampers the FCC certification if we want to use the full permissible power (20 dBm output using a FE).

Lix