WFly freq tuning on channel 15

You need to enable the tuning in _config.h: #define USE_CYRF6936_CH15_TUNING
This commit is contained in:
Pascal Langer 2019-05-18 17:36:39 +02:00
parent c3b48c78af
commit f3ca7ad644
3 changed files with 20 additions and 2 deletions

View File

@ -19,7 +19,7 @@
#define VERSION_MAJOR 1 #define VERSION_MAJOR 1
#define VERSION_MINOR 2 #define VERSION_MINOR 2
#define VERSION_REVISION 1 #define VERSION_REVISION 1
#define VERSION_PATCH_LEVEL 50 #define VERSION_PATCH_LEVEL 51
//****************** //******************
// Protocols // Protocols

View File

@ -155,6 +155,9 @@ uint16_t ReadWFLY()
uint8_t status,len,sum=0,check=0; uint8_t status,len,sum=0,check=0;
uint8_t start; uint8_t start;
static uint8_t retry; static uint8_t retry;
#ifdef USE_CYRF6936_CH15_TUNING
static uint16_t Channel15=1024;
#endif
switch(phase) switch(phase)
{ {
@ -236,6 +239,15 @@ uint16_t ReadWFLY()
while ((uint8_t)((uint8_t)micros()-(uint8_t)start) < 200) while ((uint8_t)((uint8_t)micros()-(uint8_t)start) < 200)
if((CYRF_ReadRegister(CYRF_02_TX_CTRL) & 0x80) == 0x00) if((CYRF_ReadRegister(CYRF_02_TX_CTRL) & 0x80) == 0x00)
break; // Packet transmission complete break; // Packet transmission complete
#ifdef USE_CYRF6936_CH15_TUNING
if(Channel15!=Channel_data[CH15])
{ // adjust frequency
Channel15=Channel_data[CH15]+0x155; // default value is 0x555 = 0x400 + 0x155
CYRF_WriteRegister(CYRF_1B_TX_OFFSET_LSB, Channel15&0xFF);
CYRF_WriteRegister(CYRF_1C_TX_OFFSET_MSB, Channel15>>8);
Channel15-=0x155;
}
#endif
return WFLY_send_data_packet(); return WFLY_send_data_packet();
} }
return 1000; return 1000;
@ -253,7 +265,7 @@ uint16_t initWFLY()
rx_tx_addr[2]=0xBF; // ID rx_tx_addr[2]=0xBF; // ID
rx_tx_addr[3]=0x13; // ID rx_tx_addr[3]=0x13; // ID
ch=0x16; // value seen between 0x0A and 0x17 ch=0x16; // value seen between 0x0A and 0x17
rc_ch_num=0x15 // RF channel to send the current hopping table rf_ch_num=0x15 // RF channel to send the current hopping table
#endif #endif
debug("ID:") debug("ID:")

View File

@ -109,6 +109,12 @@
//#define FORCE_AFHDS2A_TUNING 0 //#define FORCE_AFHDS2A_TUNING 0
//#define FORCE_BUGS_TUNING 0 //#define FORCE_BUGS_TUNING 0
/** CYRF6936 Fine Frequency Tuning **/
//This is required in rare cases where some CYRF6936 modules and/or RXs have an inaccurate crystal oscillator.
//If using Serial mode only (for now), you can use CH15 to find the right tuning value. -100%=-300, 0%=default 0, +100%=+300.
//Uncomment the line below (remove the "//") to enable this feature.
//#define USE_CYRF6936_CH15_TUNING
/** Low Power **/ /** Low Power **/
//Low power is reducing the transmit power of the multi module. This setting is configurable per model in PPM (table below) or Serial mode (radio GUI). //Low power is reducing the transmit power of the multi module. This setting is configurable per model in PPM (table below) or Serial mode (radio GUI).
//It can be activated when flying indoor or small models since the distance is short or if a model is causing issues when flying closed to the TX. //It can be activated when flying indoor or small models since the distance is short or if a model is causing issues when flying closed to the TX.