Compare commits

...

140 Commits

Author SHA1 Message Date
Rob French 295c49969f Updated the README.md with a KC4UPR note. I will now be creating a kc4upr branch. 2020-10-28 13:50:39 -05:00
phdlee 262ef3947a
Merge pull request #46 from phdlee/version1.20
changed version number for nextion lcd protocol
2019-04-06 16:38:44 +09:00
phdlee a4d9f6e6c5 changed version number for nextion lcd protocol 2019-04-06 16:35:46 +09:00
phdlee 395dd42459
Update README.md 2019-04-02 23:20:04 +09:00
phdlee f25bf57556
Update README.md 2019-04-02 23:18:54 +09:00
phdlee 171f889f4a
Merge pull request #45 from phdlee/version1.20
Version1.20
2019-04-02 23:16:03 +09:00
phdlee 05de66a038 uBITX V5 suppoort and SDR Frequency Change 2019-04-02 23:09:18 +09:00
phdlee 2c075d5236 for uBITX v5 2019-02-15 19:32:07 +09:00
phdlee 37fcc5975a
Merge pull request #44 from phdlee/version1.11
Added Custom LPF Control
2018-09-22 19:14:22 +09:00
phdlee 450f57ae0f Added Custom LPF Control 2018-09-22 18:56:23 +09:00
phdlee c34e798313
Update README.md 2018-09-11 18:09:22 +09:00
phdlee df2c493700
Merge pull request #43 from phdlee/version1.1
Add Custom LPF Filter and Changed Version Number
2018-09-07 23:39:25 +09:00
phdlee 9ff8365c3f Add Custom LPF Filter and Changed Version Number 2018-09-07 23:37:23 +09:00
phdlee 948267bb39
Merge pull request #40 from phdlee/version1.098
Version1.098
2018-08-10 16:08:13 +09:00
phdlee e79dbdbbe7 for Release Version 1.097 2018-08-06 13:59:55 +09:00
phdlee 7c1ee29500 Before Release V1.096 2018-07-28 18:53:28 +09:00
phdlee 4ee3631db0 Change menu type (selectable functions) 2018-07-17 21:10:45 +09:00
phdlee c27bbf1b6b Apply DSP meter to all lcd types 2018-07-17 20:41:17 +09:00
phdlee b984f62dfd Add I2C Scan, Change DSP Meter I2C 2018-07-17 20:13:06 +09:00
phdlee 41548163cf Support I2C S-Meter 2018-07-17 11:21:24 +09:00
phdlee 1ce889eef0 Release v1.095 Beta 2018-07-05 19:18:22 +09:00
phdlee dd43ba4c33 Modified about Loopback protocol 2018-06-28 23:29:06 +09:00
phdlee fe44c703c5 define eeprom map for external device and send eeprom data to nextion lcd 2018-06-19 11:17:58 +09:00
phdlee 22bb9ee112 Release 1.093Beta 2018-06-17 01:19:37 +09:00
phdlee c73fffb25b Modified Spectrum Protocol 2018-06-16 23:03:47 +09:00
phdlee 82177199c4 Increase Buffer for SW Serial and Modified Protocol for EEProm 2018-06-16 21:45:55 +09:00
phdlee 0e13dd0267 modified Checksum logic for Nextion LCD 2018-06-15 21:43:56 +09:00
phdlee c602fdde7c Add EEProm Read by Nextion LCD Reversed order 2018-06-15 20:48:51 +09:00
phdlee edadce7d89 add protocol about eeprom 2018-06-15 10:34:52 +09:00
phdlee 9da71429cb added protocol 2018-06-13 23:15:58 +09:00
phdlee 3050374504 Second Deploy for Nextion LCD 2018-06-12 00:30:50 +09:00
phdlee 152b63a9ed Added SW Trigger, Spectrum Protocol, Get ADC Protocol 2018-06-11 22:06:42 +09:00
phdlee 72ccd3b0e4 modified protocol for nextion lcd 2018-06-09 18:26:11 +09:00
phdlee e81413fa02 Support Nextion LCD 2018-06-09 17:13:26 +09:00
phdlee c6b020fa70
Update README.md 2018-05-23 18:32:55 +09:00
phdlee 2e8c97f19b
Update README.md 2018-05-23 18:32:01 +09:00
phdlee 337320b433
Merge pull request #37 from phdlee/version1.080
add comment
2018-05-23 16:00:25 +09:00
phdlee 7c8088f753 add comment 2018-05-23 15:58:50 +09:00
phdlee b172527d00
Merge pull request #36 from phdlee/version1.080
Version1.080
2018-05-23 15:46:01 +09:00
phdlee 67cdd14945 modified comments 2018-05-23 15:28:00 +09:00
phdlee b375b7e9e4 modified some comments 2018-05-23 15:20:10 +09:00
phdlee 27092d23e0
Merge pull request #35 from phdlee/version1.080
Version1.080
2018-05-23 15:09:43 +09:00
phdlee 8a6e01e289 improve external switch check routine 2018-05-23 15:07:37 +09:00
phdlee 83dc1de18e fixed mode change 2018-05-22 11:37:10 +09:00
phdlee 2de1c873a1
Merge pull request #34 from phdlee/version1.075
Version1.075
2018-05-09 16:55:47 +09:00
phdlee 4d97ac2283
Merge pull request #33 from phdlee/version1.074
Version1.074
2018-05-09 16:54:51 +09:00
phdlee 65d21aba77 Fixed Band Select Bug 2018-05-09 16:53:49 +09:00
phdlee 6a2369bc27 Fixed Band Select Bug 2018-05-09 16:53:40 +09:00
phdlee 76d5c362d0 complete test for Factory Recovery 2018-05-07 14:08:22 +09:00
phdlee 70fc6aeba8 Add Factory Recovery function 2018-05-07 13:56:46 +09:00
phdlee 75d952718b
Merge pull request #32 from phdlee/version1.073
reduce compiller warning
2018-05-06 22:34:15 +09:00
phdlee 1d28f3e7e9 update versioninfo.txt 2018-05-03 21:23:10 +09:00
phdlee 51f690ef85 change frequency display in WSPR Menu 2018-05-03 17:57:06 +09:00
phdlee 12984486a6 Modfied SMeter and CAT 2018-05-03 16:20:09 +09:00
phdlee e961cd8ac9 reduce compiller warning 2018-04-24 18:00:41 +09:00
phdlee 5c40718bec
Merge pull request #31 from phdlee/version1.073
Version1.073
2018-04-24 17:33:58 +09:00
phdlee 6add092391 Extended key (select key type) 2018-04-24 17:26:34 +09:00
phdlee 3b4bdafacc
Merge pull request #30 from phdlee/version1.072
Version1.072
2018-04-23 21:43:56 +09:00
phdlee 82d9682ee9
Merge branch 'master' into version1.072 2018-04-23 21:43:50 +09:00
phdlee 6be127d811 test lcd 2018-04-23 21:40:45 +09:00
phdlee 5b13ede65b test of extended key and dual lcd 2018-04-23 08:29:19 +09:00
phdlee 0aafe32e27 Added Dual LCD 2018-04-21 16:09:21 +09:00
phdlee 289ae1bd77
Merge pull request #29 from phdlee/version1.071
Improve receive perforamnce for USB, CWU, custom uBITX
2018-04-18 20:25:32 +09:00
phdlee 5611e1c0ff lcdtest and extended ubutton tested 2018-04-18 20:22:52 +09:00
phdlee 86797181cf
Merge pull request #28 from RichNeese/master
Tuning step change
2018-04-18 08:32:53 +09:00
phdlee f600c18541 add extended Keys (mode, band, tunestep) and i2clcd working 2018-04-17 21:26:29 +09:00
Richard Neese 11b6fbc1f4 Tuning step change
changed tuning steps to 10/50/100/500/1000
2018-04-16 21:56:20 -04:00
phdlee 0e245fc488 Add 20x04LCD and S.Meter 2018-04-16 23:56:32 +09:00
phdlee d721816039 LCD Work step1 2018-04-12 22:08:43 +09:00
phdlee 34be2d0845 Improve receive perforamnce for USB, CWU, custom uBITX 2018-04-09 23:35:13 +09:00
phdlee 0996870154
Merge pull request #27 from phdlee/version1.07
Version1.07
2018-04-07 21:33:30 +09:00
phdlee 689cfda09e Add Support SDR Receiver and improve ATT 2018-04-07 21:32:01 +09:00
phdlee 23f1b7cd5c Added IF Tune, ATT, SDR Functions 2018-04-06 21:43:36 +09:00
phdlee d4ed0589e5 Applied 1602 Tiny LCD Library for reduce program Memory 2018-04-05 22:57:07 +09:00
phdlee 5f906a4497 To Support various LCD Type 2018-04-05 22:16:54 +09:00
phdlee 1210f56cd1 move display routine ui to idle 2018-04-05 21:30:35 +09:00
phdlee e8d6792073 complete setup menu ui for reduce program memory 2018-04-05 17:36:16 +09:00
phdlee 9c4b694ce2
Update README.md 2018-04-05 10:19:38 +09:00
phdlee 02f22d66e5 Change Menu codes 2018-04-05 09:50:29 +09:00
phdlee 11e47fdccc Added Version Info at top of ubitx_20.ino 2018-04-04 22:20:04 +09:00
phdlee 7aafed9e95 rename ubitx_wspr.cpp to ubitx_wspr.ino 2018-04-04 20:29:27 +09:00
phdlee 5afcdf2583
Update README.md 2018-04-04 20:22:42 +09:00
phdlee 075f585a1e
Update README.md 2018-03-29 22:31:36 +09:00
phdlee d0c04df9d8
Merge pull request #26 from phdlee/version1.06
Version1.06
2018-03-25 03:22:29 +09:00
phdlee dd6d4555a8
Update ubitx_20.ino 2018-03-25 03:21:31 +09:00
phdlee 8f8850f4da
Update ubitx_wspr.cpp 2018-03-25 03:17:04 +09:00
phdlee 4e9437a735
Merge pull request #25 from phdlee/version1.06
Change Version Name
2018-03-24 21:34:17 +09:00
phdlee bad62ef728 Change Version Name 2018-03-24 21:33:01 +09:00
phdlee 384c3c41b2
Merge pull request #24 from phdlee/version1.05
Version1.05
2018-03-21 14:21:28 +09:00
phdlee a21dbe2fa5
Update README.md 2018-03-05 13:03:05 +09:00
phdlee 9faa8bb44c
Merge pull request #23 from phdlee/version1.04
Optimized from Version1.03
2018-03-05 12:56:55 +09:00
phdlee d926b15e3d
Merge pull request #22 from phdlee/version1.03
Version1.03
2018-03-05 12:55:41 +09:00
phdlee c911d26163
Merge pull request #21 from phdlee/version1.02
Version1.02
2018-02-14 12:11:38 +09:00
phdlee 98e3b41f5a
Merge pull request #20 from phdlee/version1.0
Version1.0
2018-02-14 12:10:38 +09:00
phdlee 277666f82f
Konstantinos (SV1ONW) shared the usage of uBITX Manager on Linux.
Konstantinos (SV1ONW) shared the usage of uBITX Manager on Linux.
2018-02-10 18:34:21 +09:00
phdlee e532dccce7
Update README.md 2018-02-10 15:10:55 +09:00
phdlee 04949cdb93
Update README.md 2018-02-10 13:41:12 +09:00
phdlee bbdd0947d3
Update README.md 2018-02-10 13:31:51 +09:00
phdlee a374297d49
Update README.md 2018-02-09 13:42:36 +09:00
phdlee c1d81d9d5b
Update README.md 2018-02-08 01:15:39 +09:00
phdlee d69588d999
Merge pull request #19 from phdlee/version0.35
Version0.35
2018-02-05 16:48:56 +09:00
phdlee e915c21412
Merge pull request #18 from phdlee/version0.34
Version0.34
2018-02-03 17:17:43 +09:00
phdlee 55cfeeb924
Update README.md 2018-01-31 12:13:44 +09:00
phdlee c8879e0e59
Update README.md 2018-01-31 12:12:58 +09:00
phdlee 4f5ac283b7
Merge pull request #17 from phdlee/version0.33
Version0.33
2018-01-31 10:47:20 +09:00
phdlee 3058d52551
Merge pull request #16 from phdlee/version0.32
Version0.32
2018-01-30 12:20:18 +09:00
phdlee 04699ba074
Merge pull request #15 from phdlee/version0.31
Fixed Bug CW Key Range
Append Feature : Display Line Toggle, (Between line1 and line2)
 Append function : for other users / using s.meter, p.meter ... (when idle time execute function)
2018-01-29 18:44:05 +09:00
phdlee aa61281c38
Merge pull request #14 from phdlee/version0.296
rename version to 0.30
2018-01-27 18:39:22 +09:00
phdlee 261215b1ad
Merge pull request #13 from phdlee/version0.296
Version0.296 => Version 0.30
2018-01-27 18:36:07 +09:00
phdlee 1a2f5b4fde
Update README.md 2018-01-27 18:33:51 +09:00
phdlee 8203427808
Merge pull request #12 from phdlee/version0.296
Add Comment
2018-01-26 18:25:48 +09:00
phdlee 4e15f2150c
Update README.md 2018-01-25 23:39:33 +09:00
phdlee 82a5fd7df9
Merge pull request #11 from phdlee/version0.296
Version0.296
2018-01-25 23:33:04 +09:00
phdlee 386a0b2d46
Update README.md 2018-01-25 22:33:20 +09:00
phdlee c6401af7d1
Merge pull request #10 from phdlee/version0.29
Version0.29
2018-01-25 22:26:19 +09:00
phdlee b153a305d6
Merge branch 'master' into version0.29 2018-01-25 22:25:35 +09:00
phdlee e61e45d3dd
Update README.md 2018-01-22 18:26:22 +09:00
phdlee a1f941f965
Update README.md 2018-01-22 18:25:41 +09:00
phdlee d1e72b3bd5
Update README.md 2018-01-22 18:24:29 +09:00
phdlee 032e7f919f
Update README.md 2018-01-22 18:21:55 +09:00
phdlee b6bc264332
Update README.md 2018-01-22 18:11:15 +09:00
phdlee b1cc5eb98a
Update README.md 2018-01-22 02:11:35 +09:00
phdlee 2fe1662d67
Merge pull request #8 from qiwenmin/master
Fixed most compilation warnings and a delay issue
2018-01-20 21:24:15 +09:00
phdlee ebbc5aae5e
Merge pull request #9 from phdlee/version0.28
change delaytimes via cat
2018-01-18 11:47:21 +09:00
Qi Wenmin 209cd3a49c Fixed most compilation warnings and a delay issue
* Fixed most compilation warnings (Compiler warning level: All)
* Fixed a delay issue in enc_read function.
2018-01-17 14:42:15 +08:00
phdlee 95e5c1dfe5
Update README.md 2018-01-14 14:53:28 +09:00
phdlee 45a8479061
Update README.md 2018-01-14 14:52:58 +09:00
phdlee a6ad381c24
Update README.md 2018-01-14 14:52:22 +09:00
phdlee bcf80f851d
Update README.md 2018-01-14 14:51:46 +09:00
phdlee 16304efacd
Update README.md 2018-01-14 14:51:23 +09:00
phdlee 968024ab73
Merge pull request #7 from phdlee/beta0.26
Beta0.26
2018-01-14 14:19:53 +09:00
phdlee 3e60728727
Update README.md 2018-01-13 22:27:23 +09:00
phdlee 9781ef086b
Update README.md 2018-01-13 10:58:47 +09:00
phdlee f27f504ea4
Merge pull request #6 from phdlee/beta0.26
Beta0.26
2018-01-12 20:19:09 +09:00
phdlee 2b08a76fbf
Update README.md 2018-01-12 10:16:59 +09:00
phdlee 90655e03b8
Update README.md
add status of project
2018-01-12 09:51:58 +09:00
phdlee 8551ff1b68
Update README.md 2018-01-11 17:40:00 +09:00
phdlee 5ce94e8e49
Merge pull request #5 from qiwenmin/master
Fix the delay condition bug when overflow
2018-01-10 13:51:59 +09:00
Qi Wenmin 7ef9c29fa8 Fix the delay condition bug when overflow
The original expression will cause bug when overflow.
2018-01-10 12:00:53 +08:00
phdlee fda398046e
Merge pull request #4 from phdlee/beta0.25
beta 0.25 commit
2018-01-10 11:39:15 +09:00
20 changed files with 6203 additions and 1593 deletions

175
README.md
View File

@ -1,31 +1,21 @@
#IMPORTANT INFORMATION
#KC4UPR'S NOTE
----------------------------------------------------------------------------
- Beta 0.26 and Beta 0.261, Beta 0.262, Beta 0.27 is complete test
- You can download and use it.
This is a fork of the KD8CEC firmware that will be specific to my uBITX V5
installation. My intent is to remove unnecessary code, as well as make some
GPIO changes based on my use of the Nextion LCD. Specifically, I'd like to
eliminate the use of analog I/O for reading the CW keys, and possibly enable
control of accessories such as filters using the extra GPIO pins that are
now available.
#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.
Now uBITX is an HF radio and will be able to join you in your happy hams life.
Based on this source, you can use it by adding functions.
I am going to do a new project based on this source, linking with WSPR, WSJT-X and so on.
Of course, this repository is still running. If you have any bugs or ideas, please feel free to email me.
- Now Release Version 1.20 on my blog (http://www.hamskey.com)
- You can download and compiled hex file and uBITX Manager application on release section (https://github.com/phdlee/ubitx/releases)
- For more information, see my blog (http://www.hamskey.com)
http://www.hamskey.com
DE KD8CEC
Ian KD8CEC
kd8cec@gmail.com
#uBITX
@ -36,16 +26,143 @@ 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)
need replace Si5351 Library (increase risk and need more beta tester)
W3PM sent me his wonderful source - using BITX, GPS
- Add TTS module
- Direct control for Student
----------------------------------------------------------------------------
## REVISION RECORD
1.20
- Support uBITX V5
- Change to SDR Frequency (Remove just RTL-SDR's error Frequency (2390Hz))
1.12
- Support Custom LPF Control
- Other Minor Bugs
1.1
- Support Nextion LCD, TJC LCD
- Read & Backup uBITX, ADC Monitoring, ATT, IF-Shift and more on Nextion LCD (TJC LCD)
- Factory Reset (Both Character LCD and Nextion LCD are applicable)
- Support Signal Meter using ADC (A7 Port)
- Supoort I2C Signal Meter
- Spectrum
- Band Scan
- Memory Control on Nextion LCD (TJC LCD)
- Speed Change CW-Option on Nextion LCD
- Fixed Band Change Bug (Both Character LCD and Nextion LCD are applicable)
- uBITX Manager removed the Encode and Decode buttons. The procedure has become a bit easier.
- I2C Device Scan on uBITX Manager ( Both Character LCD and Nextion LCD are applicable)
- Si5351 I2C Address can be changed
- Recovery using QR-Code Data from Server
- Nextion LCD and TJC LCD can display Spectrum and CW Decode (using Stand alone S-Meter)
- Other Minor Bugs
1.09 (Beta)
- include 1.094 beta, 1.095 beta, 1.097 beta
1.08
- Receive performance is improved compared to the original firmware or version 1.061
- ATT function has been added to reduce RF gain (Shift 45Mhz IF)
- Added the ability to connect SDR. (Low cost RTL-SDR available)
- Added a protocol to ADC Monitoring in CAT communications
- Various LCD support, 16x02 Parallel LCD - It is the LCD equipped with uBITX, 16x02 I2C LCD, 20x04 Parallel LCD, 20x04 I2C LCD, 16x02 I2C Dual LCD
- Added Extended Switch Support
- Support S Meter
- Added S-Meter setting assistant to uBITX Manager
- Add recovery mode (such as Factory Reset)
- There have been many other improvements and fixes. More information is available on the blog. (http://www.hamskey.com)
1.07 (Beta)
- include 1.071 beta, 1.073 beta, 1.075 beta
- Features implemented in the beta version have been applied to Version 1.08 above.
1.061
- Added WSPR
You only need uBITX to use WSPR. No external devices are required.
Added Si5351 module for WSPR
- Update uBITX Manager to Version 1.0
- Reduce program size
for WSPR
for other Module
- Fixed IF Shift Bug
Disable IF Shift on TX
IF shift available in USB mode
Fixed cat routine in IF Shift setup
- Bugs fixed
cw start delay option
Auto key Bug
(found bug : LZ1LDO)
Message selection when Auto Key is used in RIT mode
(found bug : gerald)
- Improve CW Keying (start TX)
1.05
- include 1.05W, 1.051, 1.051W
- for WSPR Beta Test Version
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)

30
VersionInfo.txt Normal file
View File

@ -0,0 +1,30 @@
This file will guide you to change the source code file.
For Windows-based Arduino IDE users, the directory name and the Main source file name must be the same.
You do not need to learn github to download .hex files or source code that I release.
However, if you want to see what I'm doing right now, you should use the github homepage.
You do not need to learn git to suggest source code. If you give me an e-mail, I will correct it at any time.
If you have not joined the BITX Group, join group. There will be discussions on various topics every day.
I am getting a lot of hints from the group.
Ian KD8CEC
kd8cec@gmail.com
==================================================================
Files modified in Version1.08 Beta
1.Delted Files.
2.Added Files
3.Modified Files
- ubitx_20.ino
- ubitx_ui.ino
- cat_libs.ino
- ubitx.h
- ubitx_eemap.h
- ubitx_lcd_1602.ino
- ubitx_lcd_1602Dual.ino
- ubitx_lcd_2004.ino
- ubitx_wspr.ino

View File

@ -31,8 +31,8 @@
along with this program. If not, see <http://www.gnu.org/licenses/>.
**************************************************************************/
#define printLineF1(x) (printLineF(1, x))
#define printLineF2(x) (printLineF(0, x))
#include "ubitx.h"
//for broken protocol
#define CAT_RECEIVE_TIMEOUT 500
@ -252,12 +252,35 @@ void ReadEEPRom() //for remove warnings.
Serial.write(0x02); //STX
checkSum = 0x02;
for (uint16_t i = 0; i < eepromReadLength; i++)
//I2C Scanner
//Magic Key Start 59414, Length : 48583
//if (eepromStartIndex == 59414 && eepromReadLength == 48583)
if (CAT_BUFF[0] == 0x16 && CAT_BUFF[1] == 0xe8)
{
read1Byte = EEPROM.read(eepromStartIndex + i);
checkSum += read1Byte;
Serial.write(read1Byte);
for (uint8_t i = 1; i < 127; i++)
{
Wire.beginTransmission(i);
read1Byte = Wire.endTransmission();
if (read1Byte == 0)
{
Serial.write(i);
}
else
{
Serial.write(0);
}
}
}
else
{
for (uint16_t i = 0; i < eepromReadLength; i++)
{
read1Byte = EEPROM.read(eepromStartIndex + i);
checkSum += read1Byte;
Serial.write(read1Byte);
}
}
Serial.write(checkSum);
Serial.write(ACK);
}
@ -278,7 +301,19 @@ void WriteEEPRom(void) //for remove warning
}
else
{
EEPROM.write(eepromStartIndex, write1Byte);
//Special Command
if (eepromStartIndex == 13131) //Magic Key
{
if (write1Byte == 0x51) //Restart
{
asm volatile (" jmp 0");
}
}
else
{
EEPROM.write(eepromStartIndex, write1Byte);
}
Serial.write(0x77); //OK
Serial.write(ACK);
}
@ -611,10 +646,38 @@ void WriteEEPRom_FT817(byte fromType)
Serial.write(ACK);
}
const byte anlogPinIndex[6] = {A0, A1, A2, A3, A6, A7};
//Read ADC Value by uBITX Manager Software
void ReadADCValue(void)
{
//ADC MAP for uBITX
int readedADCValue;
//5BYTES
//CAT_BUFF[0] [1] [2] [3] [4] //4 COMMAND
//0 READ ADDRESS
readedADCValue = analogRead(anlogPinIndex[CAT_BUFF[0]]);
CAT_BUFF[0] = readedADCValue >> 8;
CAT_BUFF[1] = readedADCValue;
SendCatData(2);
Serial.write(ACK);
}
void SetIFSValue(void)
{
//Set IFShift Value
isIFShift = CAT_BUFF[0];
ifShiftValue = CAT_BUFF[1] + CAT_BUFF[2] * 256;
setFrequency(frequency);
SetCarrierFreq();
updateLine2Buffer(1); //option, perhap not need
Serial.write(ACK);
}
//void CatRxStatus(byte fromType)
void CatRxStatus(void) //for remove warning
{
byte sMeterValue = 1;
byte sMeterValue = 0;
/*
http://www.ka7oei.com/ft817_meow.html
@ -627,6 +690,33 @@ void CatRxStatus(void) //for remove warning
Bit 7 is 0 if there is a signal present, or 1 if the receiver is squelched.
*/
// The lower 4 bits (0-3) of this byte indicate the current S-meter reading. 00 refers to an S-Zero reading, 04 = S4, 09 = S9, 0A = "10 over," 0B = "20 over" and so on up to 0F.
//0~8
switch (scaledSMeter)
{
case 8 : sMeterValue = 0x0B;
break;
case 7 : sMeterValue = 0x0A;
break;
case 6 : sMeterValue = 0x09;
break;
case 5 : sMeterValue = 0x07;
break;
case 4 : sMeterValue = 0x05;
break;
case 3 : sMeterValue = 0x04;
break;
case 2 : sMeterValue = 0x02;
break;
case 1 : sMeterValue = 0x01;
break;
}
/*
sMeterValue = (scaledSMeter * 2) -1;
if (sMeterValue > 0)
sMeterValue--;
*/
CAT_BUFF[0] = sMeterValue & 0b00001111;
SendCatData(1);
}
@ -768,6 +858,14 @@ void Check_Cat(byte fromType)
WriteEEPRom_FT817(fromType);
break;
case 0xDD: //Read uBITX ADC Data
ReadADCValue(); //Call by uBITX Manager Program
break;
case 0xDE: //IF-Shift Control by CAT
SetIFSValue(); //
break;
case 0xE7 : //Read RX Status
CatRxStatus();
break;

View File

@ -235,30 +235,6 @@ void sendCWChar(char cwKeyChar)
}
}
/*
void sendAutoCW(int cwSendLength, char *sendString)
{
byte i;
if (!inTx){
keyDown = 0;
cwTimeout = millis() + cwDelayTime * 10;
startTx(TX_CW, 0); //disable updateDisplay Command for reduce latency time
updateDisplay();
delay_background(delayBeforeCWStartTime * 2, 2);
}
for (i = 0; i < cwSendLength; i++)
{
sendCWChar(sendString[i]);
if (i != cwSendLength -1) delay_background(cwSpeed * 3, 3);
}
delay_background(cwDelayTime * 10, 2);
stopTx();
}
*/
byte isNeedScroll = 0;
unsigned long scrollDispayTime = 0;
#define scrollSpeed 500
@ -296,17 +272,19 @@ void controlAutoCW(){
{
displayScrolStep = 0;
}
printLineFromEEPRom(0, 2, cwStartIndex + displayScrolStep + CW_DATA_OFSTADJ, cwEndIndex + CW_DATA_OFSTADJ, 0);
byte diplayAutoCWLine = 0;
if ((displayOption1 & 0x01) == 0x01)
diplayAutoCWLine = 1;
lcd.setCursor(0, diplayAutoCWLine);
lcd.write(byteToChar(selectedCWTextIndex));
lcd.write(':');
#ifdef USE_SW_SERIAL
//Not need Scroll
//Display_AutoKeyTextIndex(selectedCWTextIndex);
SendCommand1Num('w', selectedCWTextIndex); //Index
SendEEPromData('a', cwStartIndex + CW_DATA_OFSTADJ, cwEndIndex + CW_DATA_OFSTADJ, 0) ; //Data
SendCommand1Num('y', 1); //Send YN
isNeedScroll = 0;
#else
printLineFromEEPRom(0, 2, cwStartIndex + displayScrolStep + CW_DATA_OFSTADJ, cwEndIndex + CW_DATA_OFSTADJ, 0);
isNeedScroll = (cwEndIndex - cwStartIndex) > 14 ? 1 : 0;
Display_AutoKeyTextIndex(selectedCWTextIndex);
#endif
scrollDispayTime = millis() + scrollSpeed;
beforeCWTextIndex = selectedCWTextIndex;
}

View File

@ -0,0 +1,334 @@
/*
Softserial for Nextion LCD and Control MCU
KD8CEC, Ian Lee
-----------------------------------------------------------------------
It is a library rewritten in C format based on SoftwareSerial.c.
I tried to use as much as possible without modifying the SoftwareSerial.
But eventually I had to modify the code.
I rewrote it in C for the following reasons.
- Problems occurred when increasing Program Size and Program Memory
- We had to reduce the program size.
Of course, Software Serial is limited to one.
- reduce the steps for transmitting and receiving
useage
extern void SWSerial_Begin(long speedBaud);
extern void SWSerial_Write(uint8_t b);
extern int SWSerial_Available(void);
extern int SWSerial_Read(void);
extern void SWSerial_Print(uint8_t *b);
If you use Softwreserial library instead of this library, you can modify the code as shown below.
I kept the function name of SoftwareSerial so you only need to modify a few lines of code.
define top of source code
#include <SoftwareSerial.h>
SoftwareSerial sSerial(10, 11); // RX, TX
replace source code
SWSerial_Begin to sSerial.begin
SWSerial_Write to sSerial.write
SWSerial_Available to sSerial.available
SWSerial_Read to sSerial.read
KD8CEC, Ian Lee
-----------------------------------------------------------------------
License
All licenses for the source code are subject to the license of the original source SoftwareSerial Library.
However, if you use or modify this code, please keep the all comments in this source code.
KD8CEC
-----------------------------------------------------------------------
License from SoftwareSerial
-----------------------------------------------------------------------
SoftwareSerial.cpp (formerly NewSoftSerial.cpp) -
Multi-instance software serial library for Arduino/Wiring
-- Interrupt-driven receive and other improvements by ladyada
(http://ladyada.net)
-- Tuning, circular buffer, derivation from class Print/Stream,
multi-instance support, porting to 8MHz processors,
various optimizations, PROGMEM delay tables, inverse logic and
direct port writing by Mikal Hart (http://www.arduiniana.org)
-- Pin change interrupt macros by Paul Stoffregen (http://www.pjrc.com)
-- 20MHz processor support by Garrett Mace (http://www.macetech.com)
-- ATmega1280/2560 support by Brett Hagman (http://www.roguerobotics.com/)
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) any later version.
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public
License along with this library; if not, write to the Free Software
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
The latest version of this library can always be found at
http://arduiniana.org.
*/
#include <Arduino.h>
//================================================================
//Public Variable
//================================================================
#define TX_PIN 9
#define RX_PIN 8
#define _SS_MAX_RX_BUFF 35 // RX buffer size
#define PRINT_MAX_LENGTH 30
//================================================================
//Internal Variable from SoftwareSerial.c and SoftwareSerial.h
//================================================================
//variable from softwareserial.c and softwareserial.h
static uint8_t swr_receive_buffer[_SS_MAX_RX_BUFF];
volatile uint8_t *_transmitPortRegister; //Write Port Register
uint8_t transmit_RegMask; //use Mask bit 1
uint8_t transmit_InvMask; //use mask bit 0
volatile uint8_t *_receivePortRegister; //Read Port Register
uint8_t _receiveBitMask;
//delay value for Bit
uint16_t _tx_delay;
//delay value for Receive
uint16_t _rx_delay_stopbit;
uint16_t _rx_delay_centering;
uint16_t _rx_delay_intrabit;
//Customize for uBITX Protocol
int8_t receiveIndex = 0;
uint8_t receivedCommandLength = 0;
int8_t ffCount = 0;
//Values for Receive Buffer
//uint16_t _buffer_overflow;
//static volatile uint8_t _receive_buffer_head;
//static volatile uint8_t _receive_buffer_tail;
//Values for Interrupt (check Start Bit)
volatile uint8_t *_pcint_maskreg;
uint8_t _pcint_maskvalue;
//================================================================
//Internal Function from SoftwareSerial.c
//================================================================
uint16_t subtract_cap(uint16_t num, uint16_t sub)
{
if (num > sub)
return num - sub;
else
return 1;
}
inline void tunedDelay(uint16_t delay)
{
_delay_loop_2(delay);
}
void setRxIntMsk(bool enable)
{
if (enable)
*_pcint_maskreg |= _pcint_maskvalue;
else
*_pcint_maskreg &= ~_pcint_maskvalue;
}
uint8_t rx_pin_read()
{
return *_receivePortRegister & _receiveBitMask;
}
//
// The receive routine called by the interrupt handler
//
void softSerail_Recv()
{
#if GCC_VERSION < 40302
// Work-around for avr-gcc 4.3.0 OSX version bug
// Preserve the registers that the compiler misses
// (courtesy of Arduino forum user *etracer*)
asm volatile(
"push r18 \n\t"
"push r19 \n\t"
"push r20 \n\t"
"push r21 \n\t"
"push r22 \n\t"
"push r23 \n\t"
"push r26 \n\t"
"push r27 \n\t"
::);
#endif
uint8_t d = 0;
// If RX line is high, then we don't see any start bit
// so interrupt is probably not for us
if (!rx_pin_read()) //Start Bit
{
// Disable further interrupts during reception, this prevents
// triggering another interrupt directly after we return, which can
// cause problems at higher baudrates.
setRxIntMsk(false);
// Wait approximately 1/2 of a bit width to "center" the sample
tunedDelay(_rx_delay_centering);
// Read each of the 8 bits
for (uint8_t i=8; i > 0; --i)
{
tunedDelay(_rx_delay_intrabit);
d >>= 1;
if (rx_pin_read())
d |= 0x80;
}
if (receivedCommandLength == 0) //check Already Command
{
//Set Received Data
swr_receive_buffer[receiveIndex++] = d;
//Finded Command
if (d == 0x73 && ffCount > 1 && receiveIndex > 6)
{
receivedCommandLength = receiveIndex;
receiveIndex = 0;
ffCount = 0;
}
else if (receiveIndex > _SS_MAX_RX_BUFF)
{
//Buffer Overflow
receiveIndex = 0;
ffCount = 0;
}
else if (d == 0xFF)
{
ffCount++;
}
else
{
ffCount = 0;
}
}
// skip the stop bit
tunedDelay(_rx_delay_stopbit);
// Re-enable interrupts when we're sure to be inside the stop bit
setRxIntMsk(true);
}
#if GCC_VERSION < 40302
// Work-around for avr-gcc 4.3.0 OSX version bug
// Restore the registers that the compiler misses
asm volatile(
"pop r27 \n\t"
"pop r26 \n\t"
"pop r23 \n\t"
"pop r22 \n\t"
"pop r21 \n\t"
"pop r20 \n\t"
"pop r19 \n\t"
"pop r18 \n\t"
::);
#endif
}
ISR(PCINT0_vect)
{
softSerail_Recv();
}
//================================================================
//Public Function from SoftwareSerial.c and modified and create
//================================================================
// Read data from buffer
void SWSerial_Read(uint8_t * receive_cmdBuffer)
{
for (int i = 0; i < receivedCommandLength; i++)
receive_cmdBuffer[i] = swr_receive_buffer[i];
}
void SWSerial_Write(uint8_t b)
{
volatile uint8_t *reg = _transmitPortRegister;
uint8_t oldSREG = SREG;
uint16_t delay = _tx_delay;
cli(); // turn off interrupts for a clean txmit
// Write the start bit
*reg &= transmit_InvMask;
tunedDelay(delay);
// Write each of the 8 bits
for (uint8_t i = 8; i > 0; --i)
{
if (b & 1) // choose bit
*reg |= transmit_RegMask; // send 1
else
*reg &= transmit_InvMask; // send 0
tunedDelay(delay);
b >>= 1;
}
// restore pin to natural state
*reg |= transmit_RegMask;
SREG = oldSREG; // turn interrupts back on
tunedDelay(_tx_delay);
}
void SWSerial_Print(uint8_t *b)
{
for (int i = 0; i < PRINT_MAX_LENGTH; i++)
{
if (b[i] == 0x00)
break;
else
SWSerial_Write(b[i]);
}
}
void SWSerial_Begin(long speedBaud)
{
//INT TX_PIN
digitalWrite(TX_PIN, HIGH);
pinMode(TX_PIN, OUTPUT);
transmit_RegMask = digitalPinToBitMask(TX_PIN); //use Bit 1
transmit_InvMask = ~digitalPinToBitMask(TX_PIN); //use Bit 0
_transmitPortRegister = portOutputRegister(digitalPinToPort(TX_PIN));
//INIT RX_PIN
pinMode(RX_PIN, INPUT);
digitalWrite(RX_PIN, HIGH); // pullup for normal logic!
_receiveBitMask = digitalPinToBitMask(RX_PIN);
_receivePortRegister = portInputRegister(digitalPinToPort(RX_PIN));
//Set Values
uint16_t bit_delay = (F_CPU / speedBaud) / 4;
_tx_delay = subtract_cap(bit_delay, 15 / 4);
if (digitalPinToPCICR(RX_PIN))
{
_rx_delay_centering = subtract_cap(bit_delay / 2, (4 + 4 + 75 + 17 - 23) / 4);
_rx_delay_intrabit = subtract_cap(bit_delay, 23 / 4);
_rx_delay_stopbit = subtract_cap(bit_delay * 3 / 4, (37 + 11) / 4);
*digitalPinToPCICR(RX_PIN) |= _BV(digitalPinToPCICRbit(RX_PIN));
_pcint_maskreg = digitalPinToPCMSK(RX_PIN);
_pcint_maskvalue = _BV(digitalPinToPCMSKbit(RX_PIN));
tunedDelay(_tx_delay); // if we were low this establishes the end
}
//Start Listen
setRxIntMsk(true);
}

View File

@ -14,17 +14,295 @@
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
**************************************************************************/
#define WSPR_COUNT 443 //WSPR_MESSAGE_COUNT
#define WSPR_MESSAGE1 444 //
#define WSPR_MESSAGE2 490 //
#define WSPR_MESSAGE3 536 //
#define WSPR_MESSAGE4 582 //
#ifndef _UBITX_HEADER__
#define _UBITX_HEADER__
#include <Arduino.h> //for Linux, On Linux it is case sensitive.
//==============================================================================
// Compile Option
//==============================================================================
//Ubitx Board Version
#define UBITX_BOARD_VERSION 2 //v1 ~ v4 : 4, v5: 5
//Depending on the type of LCD mounted on the uBITX, uncomment one of the options below.
//You must select only one.
//#define UBITX_DISPLAY_LCD1602P //LCD mounted on unmodified uBITX (Parallel)
//#define UBITX_DISPLAY_LCD1602I //I2C type 16 x 02 LCD
//#define UBITX_DISPLAY_LCD1602I_DUAL //I2C type 16 x02 LCD Dual
//#define UBITX_DISPLAY_LCD2004P //24 x 04 LCD (Parallel)
//#define UBITX_DISPLAY_LCD2004I //I2C type 24 x 04 LCD
#define UBITX_DISPLAY_NEXTION //NEXTION LCD
//#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_SECOND_ADDRESS_DEFAULT 0x3F //0x27 //only using Dual LCD Mode
//Select betwen Analog S-Meter and DSP (I2C) Meter
#define USE_I2CSMETER
#define EXTEND_KEY_GROUP1 //MODE, BAND(-), BAND(+), STEP
//#define EXTEND_KEY_GROUP2 //Numeric (0~9), Point(.), Enter //Not supported in Version 1.0x
//Custom LPF Filter Mod
//#define USE_CUSTOM_LPF_FILTER //LPF FILTER MOD
//#define ENABLE_FACTORYALIGN
#define FACTORY_RECOVERY_BOOTUP //Whether to enter Factory Recovery mode by pressing FKey and turning on power
#define ENABLE_ADCMONITOR //Starting with Version 1.07, you can read ADC values directly from uBITX Manager. So this function is not necessary.
extern byte I2C_LCD_MASTER_ADDRESS; //0x27 //if Set I2C Address by uBITX Manager, read from EEProm
extern byte I2C_LCD_SECOND_ADDRESS; //only using Dual LCD Mode
#define SMeterLatency 3 //1 is 0.25 sec
//==============================================================================
// User Select feather list
//==============================================================================
//Enable all features
#define FN_BAND 1 //592
#define FN_VFO_TOGGLE 1 //78
#define FN_MODE 1 //20
#define FN_RIT 1 //58
#define FN_SPLIT 1 //62
#define FN_IFSHIFT 1 //238
#define FN_ATT 1 //128
#define FN_CW_SPEED 1 //152
#define FN_VFOTOMEM 1 //254
#define FN_MEMTOVFO 1 //188
#define FN_MEMORYKEYER 1 //156
#define FN_WSPR 1 //1044
#define FN_SDRMODE 1 //68
#define FN_CALIBRATION 1 //666
#define FN_CARRIER 1 //382
#define FN_CWCARRIER 1 //346
#define FN_CWTONE 1 //148
#define FN_CWDELAY 1 //98
#define FN_TXCWDELAY 1 //94
#define FN_KEYTYPE 1 //168
#define FN_ADCMONITOR 1 //516
#define FN_TXONOFF 1 //58
/*
//Test Configuration (88%)
#define FN_BAND 0 //592
#define FN_VFO_TOGGLE 0 //78
#define FN_MODE 0 //20
#define FN_RIT 0 //58
#define FN_SPLIT 0 //62
#define FN_IFSHIFT 0 //238
#define FN_ATT 0 //128
#define FN_CW_SPEED 1 //152
#define FN_VFOTOMEM 0 //254
#define FN_MEMTOVFO 0 //188
#define FN_MEMORYKEYER 1 //156
#define FN_WSPR 0 //1044
#define FN_SDRMODE 1 //68
#define FN_CALIBRATION 1 //666
#define FN_CARRIER 1 //382
#define FN_CWCARRIER 1 //346
#define FN_CWTONE 1 //148
#define FN_CWDELAY 1 //98
#define FN_TXCWDELAY 1 //94
#define FN_KEYTYPE 1 //168
#define FN_ADCMONITOR 1 //516
#define FN_TXONOFF 1 //58
*/
/*
//Recommended Character LCD Developer 87%
#define FN_BAND 1 //592
#define FN_VFO_TOGGLE 1 //78
#define FN_MODE 1 //20
#define FN_RIT 1 //58
#define FN_SPLIT 1 //62
#define FN_IFSHIFT 1 //238
#define FN_ATT 0 //128
#define FN_CW_SPEED 0 //152 //using MM
#define FN_VFOTOMEM 1 //254
#define FN_MEMTOVFO 1 //188
#define FN_MEMORYKEYER 1 //156
#define FN_WSPR 1 //1044
#define FN_SDRMODE 1 //68
#define FN_CALIBRATION 0 //667 //using MM
#define FN_CARRIER 0 //382 //using MM
#define FN_CWCARRIER 0 //346 //using MM
#define FN_CWTONE 0 //148 //using MM
#define FN_CWDELAY 0 //98 //using MM
#define FN_TXCWDELAY 0 //94 //using MM
#define FN_KEYTYPE 0 //168 //using MM
#define FN_ADCMONITOR 0 //516 //using MM
#define FN_TXONOFF 1 //58
*/
/*
//Recommended for Nextion, TJC LCD 88%
#define FN_BAND 1 //600
#define FN_VFO_TOGGLE 1 //90
#define FN_MODE 1 //318
#define FN_RIT 1 //62
#define FN_SPLIT 1 //2
#define FN_IFSHIFT 1 //358
#define FN_ATT 1 //250
#define FN_CW_SPEED 0 //286
#define FN_VFOTOMEM 0 //276
#define FN_MEMTOVFO 0 //234
#define FN_MEMORYKEYER 1 //168
#define FN_WSPR 1 //1130
#define FN_SDRMODE 1 //70
#define FN_CALIBRATION 0 //790
#define FN_CARRIER 0 //500
#define FN_CWCARRIER 0 //464
#define FN_CWTONE 0 //158
#define FN_CWDELAY 0 //108
#define FN_TXCWDELAY 0 //106
#define FN_KEYTYPE 0 //294
#define FN_ADCMONITOR 0 //526 //not available with Nextion or Serial UI
#define FN_TXONOFF 1 //70
*/
//==============================================================================
// End of User Select Mode and Compil options
//==============================================================================
#ifdef UBITX_DISPLAY_LCD1602I
#define USE_I2C_LCD
#elif defined(UBITX_DISPLAY_LCD1602I_DUAL)
#define USE_I2C_LCD
#elif defined(UBITX_DISPLAY_LCD2004I)
#define USE_I2C_LCD
#endif
#ifdef UBITX_DISPLAY_NEXTION
#define USE_SW_SERIAL
#undef ENABLE_ADCMONITOR
#undef FACTORY_RECOVERY_BOOTUP
#elif defined(UBITX_CONTROL_MCU)
#define USE_SW_SERIAL
#undef ENABLE_ADCMONITOR
#undef FACTORY_RECOVERY_BOOTUP
#endif
//==============================================================================
// Hardware, Define PIN Usage
//==============================================================================
/**
* We need to carefully pick assignment of pin for various purposes.
* There are two sets of completely programmable pins on the Raduino.
* First, on the top of the board, in line with the LCD connector is an 8-pin connector
* that is largely meant for analog inputs and front-panel control. It has a regulated 5v output,
* ground and six pins. Each of these six pins can be individually programmed
* either as an analog input, a digital input or a digital output.
* The pins are assigned as follows (left to right, display facing you):
* Pin 1 (Violet), A7, SPARE => Analog S-Meter
* Pin 2 (Blue), A6, KEYER (DATA)
* Pin 3 (Green), +5v
* Pin 4 (Yellow), Gnd
* Pin 5 (Orange), A3, PTT
* Pin 6 (Red), A2, F BUTTON
* Pin 7 (Brown), A1, ENC B
* Pin 8 (Black), A0, ENC A
*Note: A5, A4 are wired to the Si5351 as I2C interface
* *
* Though, this can be assigned anyway, for this application of the Arduino, we will make the following
* assignment
* A2 will connect to the PTT line, which is the usually a part of the mic connector
* A3 is connected to a push button that can momentarily ground this line. This will be used for RIT/Bandswitching, etc.
* A6 is to implement a keyer, it is reserved and not yet implemented
* A7 is connected to a center pin of good quality 100K or 10K linear potentiometer with the two other ends connected to
* ground and +5v lines available on the connector. This implments the tuning mechanism
*/
#define ENC_A (A0)
#define ENC_B (A1)
#define FBUTTON (A2)
#define PTT (A3)
#define ANALOG_KEYER (A6)
#define ANALOG_SPARE (A7)
#define ANALOG_SMETER (A7) //by KD8CEC
/**
* The second set of 16 pins on the Raduino's bottom connector are have the three clock outputs and the digital lines to control the rig.
* This assignment is as follows :
* Pin 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16
* GND +5V CLK2 GND GND CLK1 GND GND CLK0 GND D2 D3 D4 D5 D6 D7
* These too are flexible with what you may do with them, for the Raduino, we use them to :
* - TX_RX line : Switches between Transmit and Receive after sensing the PTT or the morse keyer
* - CW_KEY line : turns on the carrier for CW
*/
#define TX_RX (7) //Relay
#define CW_TONE (6)
#define TX_LPF_A (5) //Relay
#define TX_LPF_B (4) //Relay
#define TX_LPF_C (3) //Relay
#define CW_KEY (2)
//******************************************************
//DSP (I2C) Meter
//******************************************************
//S-Meter Address
#define I2CMETER_ADDR 0x58
//VALUE TYPE============================================
//Signal
#define I2CMETER_CALCS 0x59 //Calculated Signal Meter
#define I2CMETER_UNCALCS 0x58 //Uncalculated Signal Meter
//Power
#define I2CMETER_CALCP 0x57 //Calculated Power Meter
#define I2CMETER_UNCALCP 0x56 //UnCalculated Power Meter
//SWR
#define I2CMETER_CALCR 0x55 //Calculated SWR Meter
#define I2CMETER_UNCALCR 0x54 //Uncalculated SWR Meter
//==============================================================================
// for public, Variable, functions
//==============================================================================
#define WSPR_BAND_COUNT 3
#define TX_SSB 0
#define TX_CW 1
#define printLineF1(x) (printLineF(1, x))
#define printLineF2(x) (printLineF(0, x))
#define TX_SSB 0
#define TX_CW 1
//0x00 : None, 0x01 : MODE, 0x02:BAND+, 0x03:BAND-, 0x04:TUNE_STEP, 0x05:VFO Toggle, 0x06:SplitOn/Off, 0x07:TX/ON-OFF, 0x08:SDR Mode On / Off, 0x09:Rit Toggle
#define FUNCTION_KEY_ADC 80 //MODE, BAND(-), BAND(+), STEP
#define FKEY_PRESS 0x78
#define FKEY_MODE 0x01
#define FKEY_BANDUP 0x02
#define FKEY_BANDDOWN 0x03
#define FKEY_STEP 0x04
#define FKEY_VFOCHANGE 0x05
#define FKEY_SPLIT 0x06
#define FKEY_TXOFF 0x07
#define FKEY_SDRMODE 0x08