Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SUBGRF_SetTxParams Pa config #82

Open
dbanello opened this issue Apr 18, 2024 · 1 comment
Open

SUBGRF_SetTxParams Pa config #82

dbanello opened this issue Apr 18, 2024 · 1 comment
Assignees
Labels
bug Something isn't working internal bug tracker Issue confirmed and reported into a ticket in the internal bug tracking system mw Middleware-related issue or pull-request. subghz SubGHz-related issue or pull-request.

Comments

@dbanello
Copy link

I'm working on STM32CubeWL 1.3.0. I've seen that SUBGRF_SetTxParams function seems to set Pa config and power setting in according to Table 27. "PA optimal setting and operating mode of RM0461".
But I think the implementation in STM32CubeWL 1.1.0 is more correct beacause it use power instead of max_power to select the right configuration of PA.

Version 1.3.0:
`

if (paSelect == RFO_LP)
{
    max_power = RBI_GetRFOMaxPowerConfig(RBI_RFO_LP_MAXPOWER);
    if (power >  max_power)
    {
      power = max_power;
    }
    if (max_power == 14)
    {
        SUBGRF_SetPaConfig(0x04, 0x00, 0x01, 0x01);
        power = 0x0E - (max_power - power);
    }
    else if (max_power == 10)
    {
        SUBGRF_SetPaConfig(0x01, 0x00, 0x01, 0x01);
        power = 0x0D - (max_power - power);
    }
    else /*default 15dBm*/
    {
        SUBGRF_SetPaConfig(0x07, 0x00, 0x01, 0x01);
        power = 0x0E - (max_power - power);
    }
    if (power < -17)
    {
        power = -17;
    }
    SUBGRF_WriteRegister(REG_OCP, 0x18);   /* current max is 80 mA for the whole device*/
}

`

Version 1.1.0
`

if( paSelect == RFO_LP )
{
    if( power == 15 )
    {
        SUBGRF_SetPaConfig( 0x06, 0x00, 0x01, 0x01 );
    }
    else
    {
        SUBGRF_SetPaConfig( 0x04, 0x00, 0x01, 0x01 );
    }
    if( power >= 14 )
    {
        power = 14;
    }
    else if( power < -17 )
    {
        power = -17;
    }
    SUBGRF_WriteRegister( REG_OCP, 0x18 ); // current max is 80 mA for the whole device
}

`

Example
In version 1.3.0 if the input power is 10dbm and max_power in LP is 15dbm the settings will be this:
SUBGRF_SetPaConfig(0x07, 0x00, 0x01, 0x01);
power = 0x0E - (max_power - power) = 0x0E - (15-10) = 14-5 = 9
These values are not what I'm expecting reading the RM0461

@ALABSTM ALABSTM added this to To do in stm32cube-mcu-fw-dashboard via automation Apr 19, 2024
@ALABSTM ALABSTM added bug Something isn't working mw Middleware-related issue or pull-request. subghz SubGHz-related issue or pull-request. labels Apr 19, 2024
@RJMSTM
Copy link
Contributor

RJMSTM commented Apr 19, 2024

ST Internal Reference: 179540

@RJMSTM RJMSTM added the internal bug tracker Issue confirmed and reported into a ticket in the internal bug tracking system label Apr 19, 2024
@RJMSTM RJMSTM moved this from To do to Analyzed in stm32cube-mcu-fw-dashboard Apr 19, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working internal bug tracker Issue confirmed and reported into a ticket in the internal bug tracking system mw Middleware-related issue or pull-request. subghz SubGHz-related issue or pull-request.
Projects
Development

No branches or pull requests

3 participants