How to configure sidework RF switch and hardware frequency offset?

Hi

   I am a new sidework developer,I want to use our designed board to develop sidework, but there are some differents between 52840 + sx1262 Development board(52840dk, sx1262 evaluation board)with our board. 

Can you give me some suggestions to modify the code to adapt to our board? Thanks.

1. Is it feasible for us to use the interrupt monitoring method to control the RF switch in the sidework project?

Semtech RF switch control(in sidework use semtech_sx1262_antenna_enable_gpios to control ANT_SW )

ANT_SW is always 1 so when DIO2 is 1 RF1 on RF2 off, when DIO2 is 0, RF1 off RF2 on

Below is our circuit diagram.

When DIO2 is 1 we can through P1.04 to know DIO2 statu so we should control ANT_SW2(P1.02) = 0

at this time ANT_SW1=1, ANT_SW2=0  RF1 on, RF2 off.

When DIO2 is 0 we can through P1.04 to know DIO2 statu so we should control ANT_SW2(P1.02) = 1

at this time ANT_SW1=0, ANT_SW2=1  RF1 off, RF2 on.

We use P1.04 in the sidework project to monitor and control P1.02. Is this method defective or do you have any recommended methods? I look forward to your suggestions.

2. How to set the RF crystal calibration value of sx1262 in the sidework project?

Our module has a slight frequency offset in the lora radio frequency part and needs software to adjust.

In the LoRawan project we can use the following code to adjust the frequency offset when sending.

In the sidework project I found in semtech_radio_ifc.h have emtech_radio_set_trim_cap_val interface.

How can I use this interface in my project?

Thank you

Parents
  • Hello,

    2. How to set the RF crystal calibration value of sx1262 in the sidework project?

    You can fill the configuration for the SX1662 here (we do not fill all the possible fields). See the function point trim_cap_val_callback which is declared in here and you have to provide a function that returns the trim value via the passed argument, and return status code (0 for success). You might also need to modify this line by changing the value of the GPIO_UNUSED_PIN to 128.

     So, add the callback, say,

    .trim_cap_val_callback = radio_sx1262_trim_val,

    in here: https://github.com/nrfconnect/sdk-sidewalk/blob/714d2267e8dafd8dfc68d3e1932926e141850517/subsys/config/common/src/app_subGHz_config.c#L104-L134

     

    and define the function as something like below:

     

    static int32_t radio_sx1262_trim_val (uint16_t trim_val)

    {

    (pass the value in argument trim_val and return 0 if success)

    }

     

    Also change the value of unused pin as follows:

     #define GPIO_UNUSED_PIN (uint32_t)(128)

    . Is it feasible for us to use the interrupt monitoring method to control the RF switch in the sidework project?

    Semtech RF switch control(in sidework use semtech_sx1262_antenna_enable_gpios to control ANT_SW )

    In this suggestion are you planning to use an another gpio that is connected to the ANT_SW controlled by semtech driver, and in zephyr you want to add an interrupt to monitor when the semtech driver changes its state, and in that interrupt you are setting the second ANT_SW to the opposite state? Is this correct? If inversion of the signal is the case then can't you do it in hardware by adding a negation in the ANT_SW line?

    Kind Regards,

    Abhijith

  • Hi,

       Thanks for your quick response.

        trim_cap_val_callback is get the  trim_val I want to set the trim_val, or Can you give me some advice on how to set this value on factory product step?
    We have to set this value before each launch. This value cannot be saved.
    Can't you do it in hardware by adding a negation in the ANT_SW line?
    It works I want your help to check if there are any software design flaws. thanks.

       

Reply
  • Hi,

       Thanks for your quick response.

        trim_cap_val_callback is get the  trim_val I want to set the trim_val, or Can you give me some advice on how to set this value on factory product step?
    We have to set this value before each launch. This value cannot be saved.
    Can't you do it in hardware by adding a negation in the ANT_SW line?
    It works I want your help to check if there are any software design flaws. thanks.

       

Children
No Data
Related