uBITX V5 suppoort and SDR Frequency Change

This commit is contained in:
phdlee 2019-04-02 23:09:18 +09:00
parent 2c075d5236
commit 05de66a038
3 changed files with 44 additions and 10 deletions

View File

@ -23,23 +23,23 @@
// Compile Option // Compile Option
//============================================================================== //==============================================================================
//Ubitx Board Version //Ubitx Board Version
#define UBITX_BOARD_VERSION 4 //v1 ~ v4 : 4, v5: 5 #define UBITX_BOARD_VERSION 5 //v1 ~ v4 : 4, v5: 5
//Depending on the type of LCD mounted on the uBITX, uncomment one of the options below. //Depending on the type of LCD mounted on the uBITX, uncomment one of the options below.
//You must select only one. //You must select only one.
//#define UBITX_DISPLAY_LCD1602P //LCD mounted on unmodified uBITX (Parallel) #define UBITX_DISPLAY_LCD1602P //LCD mounted on unmodified uBITX (Parallel)
//#define UBITX_DISPLAY_LCD1602I //I2C type 16 x 02 LCD //#define UBITX_DISPLAY_LCD1602I //I2C type 16 x 02 LCD
//#define UBITX_DISPLAY_LCD1602I_DUAL //I2C type 16 x02 LCD Dual //#define UBITX_DISPLAY_LCD1602I_DUAL //I2C type 16 x02 LCD Dual
//#define UBITX_DISPLAY_LCD2004P //24 x 04 LCD (Parallel) //#define UBITX_DISPLAY_LCD2004P //24 x 04 LCD (Parallel)
//#define UBITX_DISPLAY_LCD2004I //I2C type 24 x 04 LCD //#define UBITX_DISPLAY_LCD2004I //I2C type 24 x 04 LCD
#define UBITX_DISPLAY_NEXTION //NEXTION LCD //#define UBITX_DISPLAY_NEXTION //NEXTION LCD
//#define UBITX_DISPLAY_NEXTION_SAFE //Only EEProm Write 770~775 //#define UBITX_DISPLAY_NEXTION_SAFE //Only EEProm Write 770~775
#define I2C_LCD_MASTER_ADDRESS_DEFAULT 0x27 //0x27 //DEFAULT, if Set I2C Address by uBITX Manager, read from EEProm #define I2C_LCD_MASTER_ADDRESS_DEFAULT 0x27 //0x27 //DEFAULT, if Set I2C Address by uBITX Manager, read from EEProm
#define I2C_LCD_SECOND_ADDRESS_DEFAULT 0x3F //0x27 //only using Dual LCD Mode #define I2C_LCD_SECOND_ADDRESS_DEFAULT 0x3F //0x27 //only using Dual LCD Mode
//Select betwen Analog S-Meter and DSP (I2C) Meter //Select betwen Analog S-Meter and DSP (I2C) Meter
//#define USE_I2CSMETER #define USE_I2CSMETER
#define EXTEND_KEY_GROUP1 //MODE, BAND(-), BAND(+), STEP #define EXTEND_KEY_GROUP1 //MODE, BAND(-), BAND(+), STEP
//#define EXTEND_KEY_GROUP2 //Numeric (0~9), Point(.), Enter //Not supported in Version 1.0x //#define EXTEND_KEY_GROUP2 //Numeric (0~9), Point(.), Enter //Not supported in Version 1.0x

View File

@ -6,7 +6,7 @@
// So I put + in the sense that it was improved one by one based on Original Firmware. // So I put + in the sense that it was improved one by one based on Original Firmware.
// This firmware has been gradually changed based on the original firmware created by Farhan, Jack, Jerry and others. // This firmware has been gradually changed based on the original firmware created by Farhan, Jack, Jerry and others.
#define FIRMWARE_VERSION_INFO F("+v1.120") #define FIRMWARE_VERSION_INFO F("+v1.200")
#define FIRMWARE_VERSION_NUM 0x04 //1st Complete Project : 1 (Version 1.061), 2st Project : 2, 1.08: 3, 1.09 : 4 #define FIRMWARE_VERSION_NUM 0x04 //1st Complete Project : 1 (Version 1.061), 2st Project : 2, 1.08: 3, 1.09 : 4
/** /**
@ -74,13 +74,37 @@
// is shifted down a little due to the loading from the impedance matching L-networks on either sides // is shifted down a little due to the loading from the impedance matching L-networks on either sides
#if UBITX_BOARD_VERSION == 5 #if UBITX_BOARD_VERSION == 5
#define SECOND_OSC_USB (56064200l) //For Test //45005000
//#define SECOND_OSC_USB (56064200l)
//#define SECOND_OSC_LSB (33945800l)
/*
//For Test //4500000
#define SECOND_OSC_USB (56059200l)
#define SECOND_OSC_LSB (33940800l)
*/
/*
//For Test // V1.121 44991500(LSB), 44998500 (USB), abs : 7k
#define SECOND_OSC_USB (56057700l)
#define SECOND_OSC_LSB (33932300l)
*/
//==============================================================================================================================
//For Test // V1.200 V1.122 45002500 (LSB), 45002000 (USB) (Change Default BFO Frequency 11056xxx, adjust bfo and ifshift ), abs: 0.5k
//Best, Test 3 uBITX V5
//Last Value, If more data is collected, it can be changed to a better value.
#define SECOND_OSC_USB (56058700l)
#define SECOND_OSC_LSB (33945800l) #define SECOND_OSC_LSB (33945800l)
#define INIT_USB_FREQ (11059200l)
//Not used, Just comment (Default)
#define INIT_USB_FREQ (11056500l)
//-----------------------------------------------------------------------------------------------------------------------------
#else #else
#define SECOND_OSC_USB (56995000l) #define SECOND_OSC_USB (56995000l)
#define SECOND_OSC_LSB (32995000l) #define SECOND_OSC_LSB (32995000l)
//these are the two default USB and LSB frequencies. The best frequencies depend upon your individual taste and filter shape //these are the two default USB and LSB frequencies. The best frequencies depend upon your individual taste and filter shape
//Not used, Just comment (Default)
#define INIT_USB_FREQ (11996500l) #define INIT_USB_FREQ (11996500l)
#endif #endif
@ -479,13 +503,23 @@ void setFrequency(unsigned long f){
moveFrequency = (f % 1000000); moveFrequency = (f % 1000000);
} }
#if UBITX_BOARD_VERSION == 5
si5351bx_setfreq(2, 45002000 + if1AdjustValue + f);
si5351bx_setfreq(1, 45002000
+ if1AdjustValue
+ SDR_Center_Freq
//+ ((advancedFreqOption1 & 0x04) == 0x00 ? 0 : (f % 10000000))
+ moveFrequency);
// + 2390); //RTL-SDR Frequency Error, Do not add another SDR because the error is different. V1.3
#else
si5351bx_setfreq(2, 44991500 + if1AdjustValue + f); si5351bx_setfreq(2, 44991500 + if1AdjustValue + f);
si5351bx_setfreq(1, 44991500 si5351bx_setfreq(1, 44991500
+ if1AdjustValue + if1AdjustValue
+ SDR_Center_Freq + SDR_Center_Freq
//+ ((advancedFreqOption1 & 0x04) == 0x00 ? 0 : (f % 10000000)) //+ ((advancedFreqOption1 & 0x04) == 0x00 ? 0 : (f % 10000000))
+ moveFrequency + moveFrequency );
+ 2390); //+ 2390); Do not add another SDR because the error is different. V1.3
#endif
} }
else else
{ {

View File

@ -1041,7 +1041,7 @@ void SendUbitxData(void)
EEPROM.get(EXTERNAL_DEVICE_OPT1, nextionDisplayOption); EEPROM.get(EXTERNAL_DEVICE_OPT1, nextionDisplayOption);
SendCommandUL(CMD_DISP_OPTION2, nextionDisplayOption); SendCommandUL(CMD_DISP_OPTION2, nextionDisplayOption);
SendCommandStr(CMD_VERSION, (char *)("+v1.120")); //Version SendCommandStr(CMD_VERSION, (char *)("+v1.122")); //Version
SendEEPromData(CMD_CALLSIGN, 0, userCallsignLength -1, 0); SendEEPromData(CMD_CALLSIGN, 0, userCallsignLength -1, 0);
/* /*