Giter VIP home page Giter VIP logo

Comments (5)

nestorayuso avatar nestorayuso commented on June 29, 2024

why to manage the RF Switch control pin with a GPIO pin and not with the SX127x RXTX dedicated pin?

from loramac-node.

jmalangoni avatar jmalangoni commented on June 29, 2024

SX1276SetAntSw(0); // SX1276.RxTx is still 0, this function is not worked as expected

to set to tx, you must pass non-zero as argument. you are setting to rx from rx i think.

On April 19, 2016 10:51:16 AM GMT+03:00, Jiapeng Li [email protected] wrote:

SX1276.RxTx variable is not synced when the device is set to low power
mode.
This may cause RxWindow2 receive sesitivity lost issue of LoRaWAN
stack.

// Reproduce the issue
SX1276SetAntSwLowPower(false);
SX1276SetAntSw(0); // SX1276.RxTx is 0 now
SX1276SetAntSwLowPower(false);
SX1276SetAntSw(0); // SX1276.RxTx is still 0, this function is not
worked as expected

The related functions locate at sx127x-board.c files.

void SX1276SetAntSwLowPower( bool status )
{
   if( RadioIsActive != status )
   {
       RadioIsActive = status;

       if( status == false )
       {
           SX1276AntSwInit( );
       }
       else
       {
           SX1276AntSwDeInit( );
       }
   }
}

void SX1276AntSwInit( void )
{
GpioInit( &AntSwitchLf, RADIO_ANT_SWITCH_LF, PIN_OUTPUT, PIN_PUSH_PULL,
PIN_PULL_UP, 1 );
GpioInit( &AntSwitchHf, RADIO_ANT_SWITCH_HF, PIN_OUTPUT, PIN_PUSH_PULL,
PIN_PULL_UP, 0 );
}

void SX1276AntSwDeInit( void )
{
GpioInit( &AntSwitchLf, RADIO_ANT_SWITCH_LF, PIN_OUTPUT,
PIN_OPEN_DRAIN, PIN_NO_PULL, 0 );
GpioInit( &AntSwitchHf, RADIO_ANT_SWITCH_HF, PIN_OUTPUT,
PIN_OPEN_DRAIN, PIN_NO_PULL, 0 );
}

void SX1276SetAntSw( uint8_t rxTx )
{
   if( SX1276.RxTx == rxTx )
   {
       return;
   }

   SX1276.RxTx = rxTx;

   if( rxTx != 0 ) // 1: TX, 0: RX
   {
       GpioWrite( &AntSwitchLf, 0 );
       GpioWrite( &AntSwitchHf, 1 );
   }
   else
   {
       GpioWrite( &AntSwitchLf, 1 );
       GpioWrite( &AntSwitchHf, 0 );
   }
}

You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
#68

from loramac-node.

mluis1 avatar mluis1 commented on June 29, 2024

@nestorayuso It is is for flexibility reasons. Depending on the antenna switch used the polarity may be inverted (requires additional external inverter), some may need to have 2 control pins. Globally it is PCB design dependent.

If your board design directly connects the Radio RxTx pin to the antenna switch then you could remove the contents of these functions.

The board files in this project are meant to be adapted to the specific board design.

from loramac-node.

SaiPrakash14 avatar SaiPrakash14 commented on June 29, 2024

I am having the SX1272 chip which have TX_switch and Rx_switch (https://www.rfsolutions.co.uk/radio-modules-c10/frequency-c57/fm-lora-transceiver-module-pre-set-to-868mhz-p4682).
but in code implementation they used single RXTX pin to control antenna operation(transmission or reception). based upon RXTX pin they control antenna operation
How can i modified this related to my situation (i am having the separate pins RX_Switch & TX_Switch).
How can I connect those pins to GPIO of micro controller(MCU)
Could you please help me to solve this problem

Thanks in Advance.

Regards
SAI

from loramac-node.

nestorayuso avatar nestorayuso commented on June 29, 2024

please don't post the same questions in several places.

First you must create a folder inside boards with the name of your board.

The LoRaMote board is quite similar to your board, use it as a template: copy LoRaMote files to your new folder.

Looking at here: https://github.com/Lora-net/LoRaMac-node/blob/master/src/boards/LoRaMote/sx1272-board.c#L195 you can see it already uses two gpio pins to manage external RF switch, I think you need to modify nothing here.

Modify board.h https://github.com/Lora-net/LoRaMac-node/blob/master/src/boards/LoRaMote/board.h#L103 with your particular gpio pin asignations.

from loramac-node.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.