Compare commits
54 Commits
version1.0
...
v1.04
Author | SHA1 | Date | |
---|---|---|---|
|
a21dbe2fa5 | ||
|
9faa8bb44c | ||
|
d926b15e3d | ||
|
fb2c9d2cc3 | ||
|
bf68dd6c26 | ||
|
4a6909f361 | ||
|
c911d26163 | ||
|
98e3b41f5a | ||
|
277666f82f | ||
|
e532dccce7 | ||
|
04949cdb93 | ||
|
bbdd0947d3 | ||
|
a374297d49 | ||
|
c1d81d9d5b | ||
|
d69588d999 | ||
|
e915c21412 | ||
|
55cfeeb924 | ||
|
c8879e0e59 | ||
|
4f5ac283b7 | ||
|
3058d52551 | ||
|
04699ba074 | ||
|
aa61281c38 | ||
|
261215b1ad | ||
|
1a2f5b4fde | ||
|
8203427808 | ||
|
4e15f2150c | ||
|
82a5fd7df9 | ||
|
386a0b2d46 | ||
|
c6401af7d1 | ||
|
b153a305d6 | ||
|
e61e45d3dd | ||
|
a1f941f965 | ||
|
d1e72b3bd5 | ||
|
032e7f919f | ||
|
b6bc264332 | ||
|
b1cc5eb98a | ||
|
2fe1662d67 | ||
|
ebbc5aae5e | ||
|
209cd3a49c | ||
|
95e5c1dfe5 | ||
|
45a8479061 | ||
|
a6ad381c24 | ||
|
bcf80f851d | ||
|
16304efacd | ||
|
968024ab73 | ||
|
3e60728727 | ||
|
9781ef086b | ||
|
f27f504ea4 | ||
|
2b08a76fbf | ||
|
90655e03b8 | ||
|
8551ff1b68 | ||
|
5ce94e8e49 | ||
|
7ef9c29fa8 | ||
|
fda398046e |
79
README.md
79
README.md
@@ -1,19 +1,13 @@
|
||||
#IMPORTANT INFORMATION
|
||||
----------------------------------------------------------------------------
|
||||
- Beta 0.26 and Beta 0.261, Beta 0.262, Beta 0.27 is complete test
|
||||
- You can download and use it.
|
||||
- A bug was found in version 1.0, When CW Keytype is set to IAMBCA and IAMBCB, there was a problem that switching to RX is not performed well when CAT communication is performed. If CW key type is straight, it works normally. This bug has been fixed and changed to version 1.01.
|
||||
- Now Release Version 1.01 on my blog (http://www.hamskey.com)
|
||||
- You can download and compiled hex file and uBITX Manager application on my blog (http://www.hamskey.com)
|
||||
|
||||
#NOTICE
|
||||
----------------------------------------------------------------------------
|
||||
I received uBITX a month ago and found that many features are required, and began coding with the idea of implementing minimal functionality as a general hf transceiver rather than an experimental device.
|
||||
|
||||
- fixed bugs...
|
||||
- Diallock for uBITX's sensitive encoders
|
||||
- built in softare Memory keyer and cw options control for CW communication
|
||||
- Implementation of CAT communication protocol for Digital Communication (as FT8, JT65, etc)
|
||||
- Delay Options for external Linear.
|
||||
- and more...
|
||||
|
||||
Most of the basic functions of the HF transceiver I thought were implemented.
|
||||
The minimum basic specification for uBITX to operate as a radio, I think it is finished.
|
||||
So I will release the 0.27 version and if I do not see the bug anymore, I will try to change the version name to 1.0.
|
||||
@@ -36,8 +30,6 @@ The copyright information of the original is below.
|
||||
KD8CEC
|
||||
----------------------------------------------------------------------------
|
||||
Prepared or finished tasks for the next version
|
||||
- Most of them are implemented and included in version 0.27.
|
||||
- User Interface on LCD -> Option by user (not need)
|
||||
- Include WSPR Beacone function - (implement other new repository)
|
||||
complete experiment
|
||||
need solve : Big code size (over 100%, then remove some functions for experment)
|
||||
@@ -46,6 +38,71 @@ Prepared or finished tasks for the next version
|
||||
|
||||
----------------------------------------------------------------------------
|
||||
## REVISION RECORD
|
||||
1.04
|
||||
- Optimized from Version1.03
|
||||
- Reduce program size (97% -> 95%)
|
||||
|
||||
1.03
|
||||
- Change eBFO Calibration Step (50 to 5)
|
||||
- Change CW Frequency Display type
|
||||
|
||||
1.02
|
||||
- Applied CW Start Delay to New CW Key logic (This is my mistake when applying the new CW Key Logic.Since uBITX operations are not significantly affected, this does not create a separate Release, It will be reflected in the next release.) - complete
|
||||
- Modified CW Key Logic for Auto Key, (available AutoKey function by any cw keytype) - complete
|
||||
- reduce cpu use usage (working)
|
||||
- reduce (working)
|
||||
|
||||
1.01
|
||||
- Fixed Cat problem with (IAMBIC A or B Selected)
|
||||
1.0
|
||||
- rename 0.30 to 1.0
|
||||
|
||||
0.35
|
||||
- vfo to channel bug fixed (not saved mode -> fixed, channel has frequency and mode)
|
||||
- add Channel tag (ch.1 ~ 10) by uBITX Manager
|
||||
- add VFO to Channel, Channel To VFO
|
||||
|
||||
0.34
|
||||
- TX Status check in auto Keysend logic
|
||||
- optimize codes
|
||||
- change default tune step size, and fixed bug
|
||||
- change IF shift step (1Hz -> 50Hz)
|
||||
|
||||
0.33
|
||||
- Added CWL, CWU Mode, (dont complete test yet)
|
||||
- fixed VFO changed bug.
|
||||
- Added Additional BFO for CWL, CWL
|
||||
- Added IF Shift
|
||||
- Change confirmation key PTT -> function key (not critical menus)
|
||||
- Change CW Key Select type, (toggle -> select by dial)
|
||||
|
||||
0.32
|
||||
- Added function Scroll Frequencty on upper line
|
||||
- Added Example code for Draw meter and remarked (you can see and use this code in source codes)
|
||||
- Added Split function, just toggle VFOs when TX/RX
|
||||
|
||||
0.31
|
||||
- Fixed CW ADC Range error
|
||||
- Display Message on Upper Line (anothor VFO Frequency, Tune Step, Selected Key Type)
|
||||
|
||||
0.30
|
||||
- implemented the function to monitor the value of all analog inputs. This allows you to monitor the status of the CW keys connected to your uBITX.
|
||||
- possible to set the ADC range for CW Keying. If no setting is made, it will have the same range as the original code. If you set the CW Keying ADC Values using uBITX Manager 0.3, you can reduce the key error.
|
||||
- Added the function to select Straight Key, IAMBICA, IAMBICB key from the menu.
|
||||
- default Band select is Ham Band mode, if you want common type, long press function key at band select menu, uBITX Manager can be used to modify frequencies to suit your country.
|
||||
|
||||
0.29
|
||||
- Remove the use of initialization values in BFO settings - using crruent value, if factory reset
|
||||
- Select Tune Step, default 0, 20, 50, 100, 200, Use the uBITX Manager to set the steps value you want. You can select Step by pressing and holding the Function Key (1sec ~ 2sec).
|
||||
- Modify Dial Lock Function, Press the Function key for more than 3 seconds to toggle dial lock.
|
||||
- created a new frequency tune method. remove original source codes, Threshold has been applied to reduce malfunction. checked the continuity of the user operating to make natural tune possible.
|
||||
- stabilize and remove many warning messages - by Pullrequest and merge
|
||||
- Changed cw keying method. removed the original code and applied Ron's code and Improved compatibility with original hardware and CAT commnication. It can be used without modification of hardware.
|
||||
|
||||
0.28
|
||||
- Fixed CAT problem with hamlib on Linux
|
||||
- restore Protocol autorecovery logic
|
||||
|
||||
0.27
|
||||
(First alpha test version, This will be renamed to the major version 1.0)
|
||||
- Dual VFO Dial Lock (vfoA Dial lock)
|
||||
|
@@ -176,6 +176,10 @@ int count = 0; //to generally count ticks, loops, etc
|
||||
#define CW_ADC_BOTH_FROM 356 //CW ADC Range BOTH from (Lower 8 bit)
|
||||
#define CW_ADC_BOTH_TO 357 //CW ADC Range BOTH to (Lower 8 bit)
|
||||
#define CW_KEY_TYPE 358
|
||||
#define CW_DISPLAY_SHIFT 359 //Transmits on CWL, CWU Mode, LCD Frequency shifts Sidetone Frequency.
|
||||
//(7:Enable / Disable //0: enable, 1:disable, (default is applied shift)
|
||||
//6 : 0 : Adjust Pulus, 1 : Adjust Minus
|
||||
//0~5: Adjust Value : * 10 = Adjust Value (0~300)
|
||||
|
||||
#define DISPLAY_OPTION1 361 //Display Option1
|
||||
#define DISPLAY_OPTION2 362 //Display Option2
|
||||
@@ -285,6 +289,9 @@ bool Iambic_Key = true;
|
||||
#define IAMBICB 0x10 // 0 for Iambic A, 1 for Iambic B
|
||||
unsigned char keyerControl = IAMBICB;
|
||||
|
||||
byte isShiftDisplayCWFreq = 1; //Display Frequency
|
||||
int shiftDisplayAdjustVal = 0; //
|
||||
|
||||
//Variables for auto cw mode
|
||||
byte isCWAutoMode = 0; //0 : none, 1 : CW_AutoMode_Menu_Selection, 2 : CW_AutoMode Sending
|
||||
byte cwAutoTextCount = 0; //cwAutoText Count
|
||||
@@ -401,7 +408,6 @@ void saveBandFreqByIndex(unsigned long f, unsigned long mode, char bandIndex) {
|
||||
When the delay is used, the program will generate an error because it is not communicating,
|
||||
so Create a new delay function that can do background processing.
|
||||
*/
|
||||
|
||||
unsigned long delayBeforeTime = 0;
|
||||
byte delay_background(unsigned delayTime, byte fromType){ //fromType : 4 autoCWKey -> Check Paddle
|
||||
delayBeforeTime = millis();
|
||||
@@ -519,7 +525,6 @@ void setFrequency(unsigned long f){
|
||||
* put the uBitx in tx mode. It takes care of rit settings, sideband settings
|
||||
* Note: In cw mode, doesnt key the radio, only puts it in tx mode
|
||||
*/
|
||||
|
||||
void startTx(byte txMode, byte isDisplayUpdate){
|
||||
//Check Hamband only TX //Not found Hamband index by now frequency
|
||||
if (tuneTXType >= 100 && getIndexHambanBbyFreq(ritOn ? ritTxFrequency : frequency) == -1) {
|
||||
@@ -675,7 +680,7 @@ void checkButton(){
|
||||
delay(10);
|
||||
Check_Cat(0);
|
||||
}
|
||||
delay(50);//debounce
|
||||
//delay(50);//debounce
|
||||
}
|
||||
|
||||
|
||||
@@ -690,7 +695,7 @@ int encodedSumValue = 0;
|
||||
unsigned long lastTunetime = 0; //if continous moving, skip threshold processing
|
||||
byte lastMovedirection = 0; //0 : stop, 1 : cw, 2 : ccw
|
||||
|
||||
#define skipThresholdTime 100
|
||||
//#define skipThresholdTime 70
|
||||
#define encodeTimeOut 1000
|
||||
|
||||
void doTuningWithThresHold(){
|
||||
@@ -719,7 +724,9 @@ void doTuningWithThresHold(){
|
||||
encodedSumValue += (s > 0 ? 1 : -1);
|
||||
|
||||
//check threshold and operator actions (hold dial speed = continous moving, skip threshold check)
|
||||
if ((lastTunetime < millis() - skipThresholdTime) && ((encodedSumValue * encodedSumValue) <= (threshold * threshold)))
|
||||
//not use continues changing by Threshold
|
||||
//if ((lastTunetime < (millis() - skipThresholdTime)) && ((encodedSumValue * encodedSumValue) <= (threshold * threshold)))
|
||||
if (((encodedSumValue * encodedSumValue) <= (threshold * threshold)))
|
||||
return;
|
||||
|
||||
lastTunetime = millis();
|
||||
@@ -729,7 +736,8 @@ void doTuningWithThresHold(){
|
||||
|
||||
prev_freq = frequency;
|
||||
//incdecValue = tuningStep * s;
|
||||
frequency += (arTuneStep[tuneStepIndex -1] * s * (s * s < 10 ? 1 : 3)); //appield weight (s is speed)
|
||||
//frequency += (arTuneStep[tuneStepIndex -1] * s * (s * s < 10 ? 1 : 3)); //appield weight (s is speed)
|
||||
frequency += (arTuneStep[tuneStepIndex -1] * s); //appield weight (s is speed) //if want need more increase size, change step size
|
||||
|
||||
if (prev_freq < 10000000l && frequency > 10000000l)
|
||||
isUSB = true;
|
||||
@@ -750,16 +758,15 @@ void doRIT(){
|
||||
|
||||
if (knob < 0)
|
||||
frequency -= (arTuneStep[tuneStepIndex -1]); //
|
||||
//frequency -= 100l;
|
||||
else if (knob > 0)
|
||||
frequency += (arTuneStep[tuneStepIndex -1]); //
|
||||
//frequency += 100;
|
||||
|
||||
if (old_freq != frequency){
|
||||
setFrequency(frequency);
|
||||
updateDisplay();
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
save Frequency and mode to eeprom for Auto Save with protected eeprom cycle, by kd8cec
|
||||
*/
|
||||
@@ -963,6 +970,22 @@ void initSettings(){
|
||||
cwAdcBothFrom = EEPROM.read(CW_ADC_BOTH_FROM) | ((tmpMostBits & 0x30) << 4);
|
||||
cwAdcBothTo = EEPROM.read(CW_ADC_BOTH_TO) | ((tmpMostBits & 0xC0) << 2);
|
||||
|
||||
//Display Type for CW mode
|
||||
isShiftDisplayCWFreq = EEPROM.read(CW_DISPLAY_SHIFT);
|
||||
|
||||
//Adjust CW Mode Freq
|
||||
shiftDisplayAdjustVal = (isShiftDisplayCWFreq & 0x3F) * 10;
|
||||
|
||||
//check Minus
|
||||
if ((isShiftDisplayCWFreq & 0x40) == 0x40)
|
||||
shiftDisplayAdjustVal = shiftDisplayAdjustVal * -1;
|
||||
|
||||
//Shift Display Check (Default : 0)
|
||||
if ((isShiftDisplayCWFreq & 0x80) == 0) //Enabled
|
||||
isShiftDisplayCWFreq = 1;
|
||||
else //Disabled
|
||||
isShiftDisplayCWFreq = 0;
|
||||
|
||||
//default Value (for original hardware)
|
||||
if (cwAdcSTFrom >= cwAdcSTTo)
|
||||
{
|
||||
@@ -1037,7 +1060,6 @@ void initSettings(){
|
||||
}
|
||||
|
||||
void initPorts(){
|
||||
|
||||
analogReference(DEFAULT);
|
||||
|
||||
//??
|
||||
@@ -1087,7 +1109,7 @@ void setup()
|
||||
|
||||
//Serial.begin(9600);
|
||||
lcd.begin(16, 2);
|
||||
printLineF(1, F("CECBT v1.01"));
|
||||
printLineF(1, F("CECBT v1.04"));
|
||||
|
||||
Init_Cat(38400, SERIAL_8N1);
|
||||
initMeter(); //not used in this build
|
||||
|
@@ -31,12 +31,15 @@ void updateLine2Buffer(char isDirectCall)
|
||||
{
|
||||
if (ritOn)
|
||||
{
|
||||
strcpy(line2Buffer, "RitTX:");
|
||||
/*
|
||||
line2Buffer[0] = 'R';
|
||||
line2Buffer[1] = 'i';
|
||||
line2Buffer[2] = 't';
|
||||
line2Buffer[3] = 'T';
|
||||
line2Buffer[4] = 'X';
|
||||
line2Buffer[5] = ':';
|
||||
*/
|
||||
|
||||
//display frequency
|
||||
tmpFreq = ritTxFrequency;
|
||||
@@ -61,12 +64,10 @@ void updateLine2Buffer(char isDirectCall)
|
||||
if (vfoActive == VFO_B)
|
||||
{
|
||||
tmpFreq = vfoA;
|
||||
//line2Buffer[0] = 'A';
|
||||
}
|
||||
else
|
||||
{
|
||||
tmpFreq = vfoB;
|
||||
//line2Buffer[0] = 'B';
|
||||
}
|
||||
|
||||
// EXAMPLE 1 & 2
|
||||
@@ -133,16 +134,18 @@ void updateLine2Buffer(char isDirectCall)
|
||||
line2Buffer[8] = 'I';
|
||||
line2Buffer[9] = 'F';
|
||||
|
||||
if (ifShiftValue == 0)
|
||||
{
|
||||
//if (ifShiftValue == 0)
|
||||
//{
|
||||
/*
|
||||
line2Buffer[10] = 'S';
|
||||
line2Buffer[11] = ':';
|
||||
line2Buffer[12] = 'O';
|
||||
line2Buffer[13] = 'F';
|
||||
line2Buffer[14] = 'F';
|
||||
}
|
||||
else
|
||||
{
|
||||
*/
|
||||
//}
|
||||
//else
|
||||
//{
|
||||
line2Buffer[10] = ifShiftValue >= 0 ? '+' : 0;
|
||||
line2Buffer[11] = 0;
|
||||
line2Buffer[12] = ' ';
|
||||
@@ -151,7 +154,7 @@ void updateLine2Buffer(char isDirectCall)
|
||||
memset(b, 0, sizeof(b));
|
||||
ltoa(ifShiftValue, b, DEC);
|
||||
strncat(line2Buffer, b, 5);
|
||||
}
|
||||
//}
|
||||
|
||||
if (isDirectCall == 1) //if call by encoder (not scheduler), immediate print value
|
||||
printLine2(line2Buffer);
|
||||
|
@@ -56,7 +56,7 @@ void menuBand(int btn){
|
||||
return;
|
||||
}
|
||||
|
||||
printLineF2(F("Press to confirm"));
|
||||
//printLineF2(F("Press to confirm"));
|
||||
//wait for the button menu select button to be lifted)
|
||||
while (btnDown()) {
|
||||
delay_background(50, 0);
|
||||
@@ -72,9 +72,9 @@ void menuBand(int btn){
|
||||
}
|
||||
delay_background(1000, 0);
|
||||
printLine2ClearAndUpdate();
|
||||
}
|
||||
}
|
||||
printLineF2(F("Press to confirm"));
|
||||
}
|
||||
}
|
||||
|
||||
char currentBandIndex = -1;
|
||||
//Save Band Information
|
||||
@@ -92,7 +92,6 @@ void menuBand(int btn){
|
||||
ritDisable();
|
||||
|
||||
while(!btnDown()){
|
||||
|
||||
knob = enc_read();
|
||||
if (knob != 0){
|
||||
if (tuneTXType == 2 || tuneTXType == 3 || tuneTXType == 102 || tuneTXType == 103) { //only ham band move
|
||||
@@ -127,17 +126,7 @@ void menuBand(int btn){
|
||||
delay_background(20, 0);
|
||||
}
|
||||
|
||||
/*
|
||||
while(btnDown()) {
|
||||
delay(50);
|
||||
Check_Cat(0); //To prevent disconnections
|
||||
}
|
||||
*/
|
||||
FrequencyToVFO(1);
|
||||
|
||||
//printLine2ClearAndUpdate();
|
||||
//delay_background(500, 0);
|
||||
//menuOn = 0;
|
||||
menuClearExit(500);
|
||||
}
|
||||
|
||||
@@ -181,25 +170,6 @@ void byteToMode(byte modeValue, byte autoSetModebyFreq){
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
//Convert Number to Mode by KD8CEC
|
||||
void byteWithFreqToMode(byte modeValue){
|
||||
if (modeValue == 4)
|
||||
cwMode = 1;
|
||||
else if (modeValue == 5)
|
||||
cwMode = 2;
|
||||
else {
|
||||
cwMode = 0;
|
||||
if (modeValue == 3)
|
||||
isUSB = 1;
|
||||
else if (modeValue == 0) //Not Set
|
||||
isUSB = (frequency > 10000000l) ? true : false;
|
||||
else
|
||||
isUSB = 0;
|
||||
}
|
||||
}
|
||||
*/
|
||||
|
||||
//IF Shift function, BFO Change like RIT, by KD8CEC
|
||||
void menuIFSSetup(int btn){
|
||||
int knob = 0;
|
||||
@@ -212,11 +182,7 @@ void menuIFSSetup(int btn){
|
||||
printLineF2(F("IF Shift:Off, On?"));
|
||||
}
|
||||
else {
|
||||
//if (isIFShift == 0){
|
||||
//printLineF2(F("IF Shift is ON"));
|
||||
//delay_background(500, 0);
|
||||
isIFShift = 1;
|
||||
//}
|
||||
|
||||
delay_background(500, 0);
|
||||
updateLine2Buffer(1);
|
||||
@@ -255,7 +221,7 @@ void menuIFSSetup(int btn){
|
||||
isIFShift = 0;
|
||||
printLineF2(F("IF Shift is OFF"));
|
||||
setFrequency(frequency);
|
||||
delay_background(500, 0);
|
||||
delay_background(1500, 0);
|
||||
}
|
||||
|
||||
//menuOn = 0;
|
||||
@@ -343,17 +309,12 @@ void menuSelectMode(int btn){
|
||||
si5351bx_setfreq(0, cwmCarrier + (isIFShift ? ifShiftValue : 0)); //set back the carrier oscillator anyway, cw tx switches it off
|
||||
|
||||
setFrequency(frequency);
|
||||
|
||||
//delay_background(500, 0);
|
||||
//printLine2ClearAndUpdate();
|
||||
//menuOn = 0;
|
||||
menuClearExit(500);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
//Memory to VFO, VFO to Memory by KD8CEC
|
||||
//select between MtoV and VtoM by isMemoryToVfo
|
||||
void menuCHMemory(int btn, byte isMemoryToVfo){
|
||||
int knob = 0;
|
||||
int selectChannel = 0;
|
||||
@@ -407,10 +368,6 @@ void menuCHMemory(int btn, byte isMemoryToVfo){
|
||||
strcat(c, b); //append channel Number;
|
||||
strcat(c, " :"); //append channel Number;
|
||||
}
|
||||
/*
|
||||
if (selectChannel < 10)
|
||||
printLineFromEEPRom(0, 4, 0, userCallsignLength -1); //eeprom to lcd use offset (USER_CALLSIGN_DAT)
|
||||
*/
|
||||
|
||||
//display frequency
|
||||
tmpFreq = resultFreq;
|
||||
@@ -624,25 +581,16 @@ void menuVfoToggle(int btn)
|
||||
FrequencyToVFO(1);
|
||||
|
||||
if (vfoActive == VFO_B){
|
||||
//vfoB = frequency;
|
||||
//vfoB_mode = modeToByte();
|
||||
//storeFrequencyAndMode(2); //vfoB -> eeprom
|
||||
|
||||
vfoActive = VFO_A;
|
||||
frequency = vfoA;
|
||||
saveCheckFreq = frequency;
|
||||
byteToMode(vfoA_mode, 0);
|
||||
}
|
||||
else {
|
||||
//vfoA = frequency;
|
||||
//vfoA_mode = modeToByte();
|
||||
//storeFrequencyAndMode(1); //vfoA -> eeprom
|
||||
|
||||
vfoActive = VFO_B;
|
||||
frequency = vfoB;
|
||||
saveCheckFreq = frequency;
|
||||
byteToMode(vfoB_mode, 0);
|
||||
//printLineF2(F("Selected VFO B"));
|
||||
}
|
||||
|
||||
ritDisable();
|
||||
@@ -661,12 +609,12 @@ void menuRitToggle(int btn){
|
||||
}
|
||||
else {
|
||||
if (ritOn == 0){
|
||||
printLineF2(F("RIT is ON"));
|
||||
//printLineF2(F("RIT is ON"));
|
||||
//enable RIT so the current frequency is used at transmit
|
||||
ritEnable(frequency);
|
||||
}
|
||||
else{
|
||||
printLineF2(F("RIT is OFF"));
|
||||
//printLineF2(F("RIT is OFF"));
|
||||
ritDisable();
|
||||
}
|
||||
|
||||
@@ -694,9 +642,6 @@ void menuSplitOnOff(int btn){
|
||||
printLineF2(F("Split On!"));
|
||||
}
|
||||
|
||||
//delay_background(500, 0);
|
||||
//printLine2ClearAndUpdate();
|
||||
//menuOn = 0;
|
||||
menuClearExit(500);
|
||||
}
|
||||
}
|
||||
@@ -721,9 +666,6 @@ void menuTxOnOff(int btn, byte optionType){
|
||||
printLineF2(F("TX ON!"));
|
||||
}
|
||||
|
||||
//delay_background(500, 0);
|
||||
//printLine2ClearAndUpdate();
|
||||
//menuOn = 0;
|
||||
menuClearExit(500);
|
||||
}
|
||||
}
|
||||
@@ -751,9 +693,6 @@ void menuSetup(int btn){
|
||||
}
|
||||
*/
|
||||
|
||||
//delay_background(2000, 0);
|
||||
//printLine2Clear();
|
||||
//menuOn = 0;
|
||||
menuClearExit(1000);
|
||||
}
|
||||
}
|
||||
@@ -803,22 +742,17 @@ void menuCWSpeed(int btn){
|
||||
printLine2(b);
|
||||
}
|
||||
//abort if this button is down
|
||||
if (btnDown())
|
||||
//if (btnDown())
|
||||
//re-enable the clock1 and clock 2
|
||||
break;
|
||||
// break;
|
||||
|
||||
Check_Cat(0); //To prevent disconnections
|
||||
}
|
||||
|
||||
//save the setting
|
||||
//if (digitalRead(PTT) == LOW){
|
||||
printLineF2(F("CW Speed set!"));
|
||||
cwSpeed = 1200/wpm;
|
||||
//printLineF2(F("CW Speed set!"));
|
||||
cwSpeed = 1200 / wpm;
|
||||
EEPROM.put(CW_SPEED, cwSpeed);
|
||||
//}
|
||||
//delay_background(2000, 0);
|
||||
//printLine2ClearAndUpdate();
|
||||
//menuOn = 0;
|
||||
menuClearExit(1000);
|
||||
}
|
||||
|
||||
@@ -884,14 +818,9 @@ void menuSetupCwDelay(int btn){
|
||||
}
|
||||
|
||||
//save the setting
|
||||
//if (digitalRead(PTT) == LOW){
|
||||
printLineF2(F("CW Delay set!"));
|
||||
//printLineF2(F("CW Delay set!"));
|
||||
cwDelayTime = tmpCWDelay / 10;
|
||||
EEPROM.put(CW_DELAY, cwDelayTime);
|
||||
//delay_background(2000, 0);
|
||||
//}
|
||||
//printLine2ClearAndUpdate();
|
||||
//menuOn = 0;
|
||||
menuClearExit(1000);
|
||||
}
|
||||
|
||||
@@ -940,21 +869,17 @@ void menuSetupTXCWInterval(int btn){
|
||||
needDisplayInformation = 1;
|
||||
}
|
||||
//abort if this button is down
|
||||
if (btnDown())
|
||||
break;
|
||||
//if (btnDown())
|
||||
// break;
|
||||
|
||||
Check_Cat(0); //To prevent disconnections
|
||||
}
|
||||
|
||||
//save the setting
|
||||
//if (digitalRead(PTT) == LOW){
|
||||
printLineF2(F("CW Start set!"));
|
||||
//printLineF2(F("CW Start set!"));
|
||||
delayBeforeCWStartTime = tmpTXCWInterval / 2;
|
||||
EEPROM.put(CW_START, delayBeforeCWStartTime);
|
||||
//delay_background(2000, 0);
|
||||
//}
|
||||
//printLine2ClearAndUpdate();
|
||||
//menuOn = 0;
|
||||
|
||||
menuClearExit(1000);
|
||||
}
|
||||
|
||||
@@ -1149,9 +1074,9 @@ void menuSetupCarrier(int btn){
|
||||
knob = enc_read();
|
||||
|
||||
if (knob > 0)
|
||||
usbCarrier -= 50;
|
||||
usbCarrier -= 5;
|
||||
else if (knob < 0)
|
||||
usbCarrier += 50;
|
||||
usbCarrier += 5;
|
||||
else
|
||||
continue; //don't update the frequency or the display
|
||||
|
||||
@@ -1215,8 +1140,6 @@ void menuSetupCWCarrier(int btn){
|
||||
si5351bx_setfreq(0, cwmCarrier);
|
||||
printCarrierFreq(cwmCarrier);
|
||||
|
||||
//Check_Cat(0); //To prevent disconnections
|
||||
//delay(100);
|
||||
delay_background(100, 0);
|
||||
}
|
||||
|
||||
@@ -1235,8 +1158,6 @@ void menuSetupCWCarrier(int btn){
|
||||
si5351bx_setfreq(0, cwmCarrier); //set back the carrier oscillator anyway, cw tx switches it off
|
||||
|
||||
setFrequency(frequency);
|
||||
//printLine2ClearAndUpdate();
|
||||
//menuOn = 0;
|
||||
menuClearExit(0);
|
||||
}
|
||||
|
||||
@@ -1284,8 +1205,6 @@ void menuSetupCwTone(int btn){
|
||||
else
|
||||
sideTone = prev_sideTone;
|
||||
|
||||
//printLine2ClearAndUpdate();
|
||||
//menuOn = 0;
|
||||
menuClearExit(0);
|
||||
}
|
||||
|
||||
@@ -1298,15 +1217,7 @@ void setDialLock(byte tmpLock, byte fromMode) {
|
||||
|
||||
if (fromMode == 2 || fromMode == 3) return;
|
||||
|
||||
//for reduce using flash memory
|
||||
/*
|
||||
if (tmpLock == 1)
|
||||
printLineF2(F("Dial Lock ON"));
|
||||
else
|
||||
printLineF2(F("Dial Lock OFF"));
|
||||
*/
|
||||
|
||||
delay_background(1000, 0);
|
||||
//delay_background(1000, 0);
|
||||
printLine2ClearAndUpdate();
|
||||
}
|
||||
|
||||
@@ -1382,8 +1293,6 @@ void doMenu(){
|
||||
}
|
||||
} //end of while
|
||||
|
||||
//printLineF2(F("Changed Step!")); //remarked for reduce program memory by KD8CEC
|
||||
//SAVE EEPROM
|
||||
EEPROM.put(TUNING_STEP, tuneStepIndex);
|
||||
delay_background(500, 0);
|
||||
printLine2ClearAndUpdate();
|
||||
@@ -1433,6 +1342,8 @@ void doMenu(){
|
||||
menuSetup(btnState);
|
||||
else if (select < 120)
|
||||
menuExit(btnState);
|
||||
|
||||
/*
|
||||
else if (select < 130 && modeCalibrate)
|
||||
menuSetupCalibration(btnState); //crystal
|
||||
else if (select < 140 && modeCalibrate)
|
||||
@@ -1453,14 +1364,40 @@ void doMenu(){
|
||||
menuTxOnOff(btnState, 0x01); //TX OFF / ON
|
||||
else if (select < 220 && modeCalibrate)
|
||||
menuExit(btnState);
|
||||
*/
|
||||
|
||||
else if (modeCalibrate)
|
||||
{
|
||||
if (select < 130)
|
||||
menuSetupCalibration(btnState); //crystal
|
||||
else if (select < 140)
|
||||
menuSetupCarrier(btnState); //lsb
|
||||
else if (select < 150)
|
||||
menuSetupCWCarrier(btnState); //lsb
|
||||
else if (select < 160)
|
||||
menuSetupCwTone(btnState);
|
||||
else if (select < 170)
|
||||
menuSetupCwDelay(btnState);
|
||||
else if (select < 180)
|
||||
menuSetupTXCWInterval(btnState);
|
||||
else if (select < 190)
|
||||
menuSetupKeyType(btnState);
|
||||
else if (select < 200)
|
||||
menuADCMonitor(btnState);
|
||||
else if (select < 210)
|
||||
menuTxOnOff(btnState, 0x01); //TX OFF / ON
|
||||
else if (select < 220)
|
||||
menuExit(btnState);
|
||||
}
|
||||
|
||||
Check_Cat(0); //To prevent disconnections
|
||||
}
|
||||
|
||||
/*
|
||||
//debounce the button
|
||||
while(btnDown()){
|
||||
delay_background(50, 0); //To prevent disconnections
|
||||
}
|
||||
//delay(50);
|
||||
*/
|
||||
}
|
||||
|
||||
|
@@ -60,6 +60,7 @@ void i2cWriten(uint8_t reg, uint8_t *vals, uint8_t vcnt) { // write array
|
||||
Wire.endTransmission();
|
||||
}
|
||||
|
||||
uint8_t si5351Val[8] = {0, 1, 0, 0, 0, 0, 0, 0}; //for reduce program memory size
|
||||
|
||||
void si5351bx_init() { // Call once at power-up, start PLLA
|
||||
uint32_t msxp1;
|
||||
@@ -68,11 +69,13 @@ void si5351bx_init() { // Call once at power-up, start PLLA
|
||||
i2cWrite(3, si5351bx_clken); // Disable all CLK output drivers
|
||||
i2cWrite(183, SI5351BX_XTALPF << 6); // Set 25mhz crystal load capacitance
|
||||
msxp1 = 128 * SI5351BX_MSA - 512; // and msxp2=0, msxp3=1, not fractional
|
||||
uint8_t vals[8] = {0, 1, BB2(msxp1), BB1(msxp1), BB0(msxp1), 0, 0, 0};
|
||||
i2cWriten(26, vals, 8); // Write to 8 PLLA msynth regs
|
||||
//uint8_t vals[8] = {0, 1, BB2(msxp1), BB1(msxp1), BB0(msxp1), 0, 0, 0};
|
||||
si5351Val[2] = BB2(msxp1);
|
||||
si5351Val[3] = BB1(msxp1);
|
||||
si5351Val[4] = BB0(msxp1);
|
||||
|
||||
i2cWriten(26, si5351Val, 8); // Write to 8 PLLA msynth regs
|
||||
i2cWrite(177, 0x20); // Reset PLLA (0x80 resets PLLB)
|
||||
// for (reg=16; reg<=23; reg++) i2cWrite(reg, 0x80); // Powerdown CLK's
|
||||
// i2cWrite(187, 0); // No fannout of clkin, xtal, ms0, ms4
|
||||
}
|
||||
|
||||
void si5351bx_setfreq(uint8_t clknum, uint32_t fout) { // Set a CLK to fout Hz
|
||||
|
@@ -281,6 +281,15 @@ void updateDisplay() {
|
||||
strcat(c, "B:");
|
||||
}
|
||||
|
||||
//Fixed by Mitani Massaru (JE4SMQ)
|
||||
if (isShiftDisplayCWFreq == 1)
|
||||
{
|
||||
if (cwMode == 1) //CWL
|
||||
tmpFreq = tmpFreq - sideTone + shiftDisplayAdjustVal;
|
||||
else if (cwMode == 2) //CWU
|
||||
tmpFreq = tmpFreq + sideTone + shiftDisplayAdjustVal;
|
||||
}
|
||||
|
||||
//display frequency
|
||||
for (int i = 15; i >= 6; i--) {
|
||||
if (tmpFreq > 0) {
|
||||
@@ -318,22 +327,6 @@ void updateDisplay() {
|
||||
lcd.setCursor(5,diplayVFOLine);
|
||||
lcd.write(":");
|
||||
}
|
||||
|
||||
/*
|
||||
//now, the second line
|
||||
memset(c, 0, sizeof(c));
|
||||
memset(b, 0, sizeof(b));
|
||||
|
||||
if (inTx)
|
||||
strcat(c, "TX ");
|
||||
else if (ritOn)
|
||||
strcpy(c, "RIT");
|
||||
|
||||
strcpy(c, " \xff");
|
||||
drawMeter(meter_reading);
|
||||
strcat(c, meter);
|
||||
strcat(c, "\xff");
|
||||
printLine2(c);*/
|
||||
}
|
||||
|
||||
int enc_prev_state = 3;
|
||||
|
BIN
ubitxmanager ubuntu.odt
Normal file
BIN
ubitxmanager ubuntu.odt
Normal file
Binary file not shown.
Reference in New Issue
Block a user