GPIO Control of the nRF21540 FEM

I have a custom board with a nRF52840 and a nRF21540.  To control my FEM (nRF21540) I have added the following to my code to my nRF52840_nRF52840.dts file:

/ {
    nrf_radio_fem: name_of_fem_node {
       compatible  = "nordic,nrf21540-fem";
       tx-en-gpios = <&gpio0 22 GPIO_ACTIVE_HIGH>;
       rx-en-gpios = <&gpio0 24 GPIO_ACTIVE_HIGH>;
       pdn-gpios   = <&gpio0 31 GPIO_ACTIVE_HIGH>;
       ant-sel-gpios = <&gpio0 20 GPIO_ACTIVE_HIGH>;
       mode-gpios = <&gpio0 17 GPIO_ACTIVE_HIGH>;
 };
};
Now, in the 'main.c' file, I want to add the code to control these pins/signals.  I'm sorry this is probably so simple, but I am new to this type of configuration, and I don't what I should do next.  I don't know what to do to control the various FEM lines within the 'main.c' program.  Any help would greatly be appreciated.
Thanks,
Sheldon
  • Hi,

    As you see the control poins toggling on the scope the control mechanism seems to be good, and so I would be very interested in looking at the HW as the next step.

    Sheldon01 said:
    Note that I care nothing about power consumption.  I want to detect/decode all of the advertisement packets of my reference transmitter.  I don't care if it uses more power.  I don't want to miss a single transmission.

    I see. In that case you can try to set for instance the TN_EN externally and see if that makes a difference on the Tx power. Note that you will not loose any transmissions by letting the MPSL control this. By controlling the FEM, it will enable the PA and LNA as needed, and there should not be any down sides with this approach.

  • As an experiment, I redefined the location of the '&nRF_radio_fem rx-en' pin to an unused location.  The RSSI that I then measured was much much weaker.  Thus, I think the signals are probably being switched ok but there is a hardware problem.  Is there a way that I can confidentially have someone at Nordic look at my design (not letting it be shown to the public where our competition could see it)?

  • Alas, I've really not looked at the hardware layout much (until now) and I can clearly see something that is very different than the development board.  My boards were made incorrectly!  I'm sorry that I have wasted your time looking at the software aspect of the possibilities.  Clearly something is wrong with my hardware!

  • Hi,

    I see, that makes sense. You can make a new private ticket and request a review of your board. Please upload both your schematic and layout in form of gerber files in the private case, and write that you see low output power.

  • There are critical errors in the schematic.  I need a new board.  I will send in the schematic and layout if I have trouble AFTER I get a new board made from the correct schematic if I still have problems.  I highly suspect that if the schematic were correct, the operation of my board will be fine.

    Thanks.

Related