I use WSN from BitCloud and try to manualy set one of 2 antennas from deRFmega25623M12 chip (with SE2431L-R amplifier) and I have some problems.
First of all I have set the antenna diversity for endnode and works properly because I have RSSI -10 near to the coordinator. In this case, coordinator has no amplifier signal chip and no antenna diversity. The configuration used for endNode with SE2431L-R amplifier is the next one:
HAL_RF_RX_TX_INDICATOR = TRUE
HAL_ANT_DIVERSITY = TRUE
ANT_DIV &= ~((1<<ANT_DIV_EN) | (1<<ANT_EXT_SW_EN)); // disable antena diversity
TRX_CTRL_1 &= ~(1<<PA_EXT_EN); // External PA support enable OFF
DDRD |= 0x40; //enable DDRD6
PORTD &= ~ 0x40; //disable PD6
//DDRD |= 0x40;
PORTD |= 0x40; //enable PD6
TRX_CTRL_1 |= (1<<PA_EXT_EN); // External PA support enable ON
ANT_DIV |= (1<<ANT_DIV_EN) | (1<<ANT_EXT_SW_EN); // enable antena diversity and external switch
Trying to set only one antenna through SE2431L-R amplifier, I followed theATMEL documentation and used next configuration in BaseMainApp.c
DDRD |= 0x40; //for deRFmega CSD activation
PORTD |= 0x40;
ANT_DIV |= (0<<ANT_DIV_EN) | (1<<ANT_EXT_SW_EN) | (3<<ANT_SEL) | (1<<ANT_CTRL0); //similar as ATMEL recommendation from pdf document
TRX_CTRL_1 |= (1<<PA_EXT_EN) ;
HAL_RF_RX_TX_INDICATOR = FALSE
HAL_ANT_DIVERSITY = FALSE
Something doesn't work properly because I have RSSI at -70 at less that 10 cm distance between coordinator and endnode.
I want to set only 1 antenna and I hope someone of you that has used deRFmega can guide me.
Of course, I have tryied the alexru recomendation https://community.atmel.com/forum/how-manually-switch-between-atmega128rfa1-antennas?skey=ANT_CTRL with the same bad results.