diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..082d17a --- /dev/null +++ b/.gitignore @@ -0,0 +1,6 @@ + +*.o + +bin/ + +GitVersion\.h diff --git a/BUILD.txt b/BUILD.txt index e802c56..4d749f0 100644 --- a/BUILD.txt +++ b/BUILD.txt @@ -57,6 +57,8 @@ git clone https://github.com/juribeparada/MMDVM_HS cd MMDVM_HS/ git clone https://github.com/juribeparada/STM32F10X_Lib +(Please do not download any different code inside MMDVM_HS folder) + - Edit Config.h nano Config.h (and enable): @@ -87,16 +89,19 @@ nano MMDVM.ini - Execute MMDVMHost: ./MMDVMHost MMDVM.ini -2) ZUMSpot USB: +2) ZUMSpot Libre Kit and ZUMSpot USB: * Windows: -- Download and install the version 1.6.9 of the Arduino IDE: -https://www.arduino.cc/en/Main/OldSoftwareReleases#previous +- Download and install the Arduino IDE: +https://www.arduino.cc/en/Main/Software + +- Run Arduino IDE. On the Tools menu, select the Boards manager, and install the "Arduino SAM" +Boards from the list of available boards. - Download STM32duino (Arduino for STM32) from this URL: https://github.com/rogerclarkmelbourne/Arduino_STM32/tree/ZUMspot -- Unzip to create the Arduino_STM32 folder +- Unzip and change the main folder "Arduino_STM32-ZUMSpot" to "Arduino_STM32" - Copy Arduino_STM32 folder in: My Documents/Arduino/hardware @@ -104,11 +109,19 @@ My Documents/Arduino/hardware - Install the USB bootloader to STM32F103. Follow the instructions: https://github.com/rogerclarkmelbourne/Arduino_STM32/wiki/stm32duino-bootloader +- Connect the ZUMSpot USB to your PC. Install the USB Mapple driver using the bat file: +My Documents/Arduino/hardware/Arduino_STM32/drivers/win/install_drivers.bat +(you may also check: http://wiki.stm32duino.com/index.php?title=Windows_driver_installation) + +- You have to be sure that Windows detect your ZUMSpot as an USB serial device COMx (please +see Windows Device Manager) + - Download the source (zip file) of MMDVM_HS from https://github.com/juribeparada/MMDVM_HS -(Do not download or install the STM32F103 libraries, STM32F10X_Lib, they are not necessary +(Do not download or install the STM32F103 library, STM32F10X_Lib, this is not necessary under STM32duino). -- Unzip MMDVM_HS-master.zip in a local folder. +- Unzip MMDVM_HS-master.zip and change the folder name to "MMDVM_HS". The path name to this +folder can't have spaces. - Start the Arduino IDE. Open the MMDVM_HS.ino file in the MMDVM_HS folder. @@ -131,8 +144,9 @@ Serial port: COMx (Maple Mini) - Click the Upload button in the IDE and wait for the transfer. -- Once the transfer is completed, press the RESET button of the board. In the case of -ZUMSpot Libre Kit, you will see the LED (PC13) of the blue pill blinking. +- Once the transfer is completed, press the RESET button of the board or disconnect and +connect the USB cable. In the case of ZUMSpot Libre Kit, you will see the LED (PC13) of +the blue pill blinking. - Once you connect with MMDVMHost, the LED will blink fast in the ZUMSpot Libre Kit. @@ -147,6 +161,8 @@ git clone https://github.com/juribeparada/MMDVM_HS cd MMDVM_HS/ git clone https://github.com/juribeparada/STM32F10X_Lib +(Please do not download any different code inside MMDVM_HS folder) + - Edit Config.h nano Config.h (and enable): @@ -296,7 +312,7 @@ SDATA PB6 SCLK PB5 DATA PB4 (TxRxData)* DCLK PB3 (TxRxCLK)* -CLKOUT PA15 (jumper wire in RF7021SE) +CLKOUT PA15 (jumper wire in RF7021SE, not needed with BIDIR_DATA_PIN enabled) PAC PB14 (PTT LED) VCC 3.3 V GND Ground @@ -335,7 +351,7 @@ reducing EMI. Pinout definitions for Arduino Due/Zero + RF7021SE: =================================================== -Use STM32duino + Arduino IDE for building the code +Use Arduino IDE for building the code - Main RF7021SE board: CE 12 @@ -345,7 +361,7 @@ SDATA 4 // 2 in Arduino Zero Pro SCLK 3 DATA 7 (TxRxData)* DCLK 8 (TxRxCLK)* -CLKOUT 2 // 4 in Arduino Zero Pro (jumper wire in RF7021SE) +CLKOUT 2 // 4 in Arduino Zero Pro (jumper wire in RF7021SE, not needed with BIDIR_DATA_PIN enabled) PAC 9 (PTT LED) VCC 3.3 V GND Ground @@ -368,3 +384,39 @@ PIN_DEB 11 * You could install a serie resistor (10 - 100 ohms) in each TxRxData and TxRxCLK lines, for reducing EMI. +Pinout definitions for Teensy (3.1, 3.2, 3.5 or 3.6) + RF7021SE: +=================================================== +Use Teensyduino + Arduino IDE for building the code + +- Main RF7021SE board: +CE 6 +SLE 5 +SREAD 4 +SDATA 3 +SCLK 2 +DATA 7 (TxRxData)* +DCLK 8 (TxRxCLK)* +CLKOUT 22 (jumper wire in RF7021SE, not needed with BIDIR_DATA_PIN enabled) +PAC 14 (PTT LED) +VCC 3.3 V +GND Ground + +- Serial ports: +Teensy USB Port (host communication) +DISP_TXD 1 (Nextion LCD serial repeater) +DISP_RXD 0 (Nextion LCD serial repeater) + +- Status LEDs: +COS_LED 15 +PTT_LED 14 +P25_LED 19 +YSF_LED 18 +DMR_LED 17 +DSTAR_LED 16 + +- Misc pins: +PIN_LED 13 +PIN_DEB 23 + +* You could install a serie resistor (10 - 100 ohms) in each TxRxData and TxRxCLK lines, for +reducing EMI. diff --git a/Config.h b/Config.h index bf9e307..d0acf9f 100644 --- a/Config.h +++ b/Config.h @@ -19,7 +19,7 @@ #if !defined(CONFIG_H) #define CONFIG_H -// Select one board: +// Select one board (STM32F103 based boards): // 1) Initial release of ZUM-Spot Pi: // #define PI_HAT_7021_REV_02 // 2) ZUM-Spot USB and ZUM-Spot Pi HAT: diff --git a/IOArduino.cpp b/IOArduino.cpp index deb5de9..9eea31b 100644 --- a/IOArduino.cpp +++ b/IOArduino.cpp @@ -94,6 +94,26 @@ #error "Either PI_HAT_7021_REV_02, PI_HAT_7021_REV_03, or ADF7021_CARRIER_BOARD need to be defined" #endif +#elif defined(__MK20DX256__) || defined(__MK64FX512__) || defined(__MK66FX1M0__) + +// Teensy pin definitions +#define PIN_SCLK 2 +#define PIN_SDATA 3 +#define PIN_SREAD 4 +#define PIN_SLE 5 +#define PIN_CE 6 +#define PIN_RXD 7 +#define PIN_TXD 8 +#define PIN_CLKOUT 22 +#define PIN_LED 13 +#define PIN_DEB 23 +#define PIN_DSTAR_LED 16 +#define PIN_DMR_LED 17 +#define PIN_YSF_LED 18 +#define PIN_P25_LED 19 +#define PIN_PTT_LED 14 +#define PIN_COS_LED 15 + #else // Arduino pin definitions (Due and Zero) diff --git a/README.md b/README.md index 65cbe9d..17fe0ae 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,5 @@ -This is the source code of ZUMSpot, personal hotspot (ADF7021 version of the MMDVM firmware), based on Jonathan G4KLX's MMDVM software. This firmware supports D-Star, DMR, System Fusion and P25 digital modes. +This is the source code of ZUMSpot, personal hotspot (ADF7021 version of the MMDVM firmware), based on Jonathan G4KLX's MMDVM software. This firmware supports D-Star, DMR, System Fusion and P25 digital modes. -This software is intended to be run on STM32F103 microcontroller. You can build this code using Arduino IDE with STM32duino package, and using "make" with ARM GCC tools. Also, Arduino with 3.3 V I/O is supported, this firmware works on Arduino Due and Arduino Zero. Please see BUILD.txt for more details, and also MMDVM Yahoo Groups. +This software is intended to be run on STM32F103 microcontroller. You can build this code using Arduino IDE with STM32duino package, or using "make" with ARM GCC tools. Also, Arduino with 3.3 V I/O (Arduino Due and Zero) and Teensy (3.1, 3.2, 3.5 or 3.6) are supported. Please see BUILD.txt for more details, and also MMDVM Yahoo Groups. This software is licenced under the GPL v2 and is intended for amateur and educational use only. Use of this software for commercial purposes is strictly forbidden. diff --git a/SerialArduino.cpp b/SerialArduino.cpp index c2c4c8d..021bfbc 100644 --- a/SerialArduino.cpp +++ b/SerialArduino.cpp @@ -37,6 +37,8 @@ void CSerialPort::beginInt(uint8_t n, int speed) case 3U: #if defined(SERIAL_REPEATER) && defined(__STM32F1__) Serial2.begin(speed); + #elif defined(SERIAL_REPEATER) && (defined(__MK20DX256__) || defined(__MK64FX512__) || defined(__MK66FX1M0__)) + Serial1.begin(speed); #endif break; default: @@ -56,6 +58,8 @@ int CSerialPort::availableInt(uint8_t n) case 3U: #if defined(SERIAL_REPEATER) && defined(__STM32F1__) return Serial2.available(); + #elif defined(SERIAL_REPEATER) && (defined(__MK20DX256__) || defined(__MK64FX512__) || defined(__MK66FX1M0__)) + return Serial1.available(); #endif default: return false; @@ -74,6 +78,8 @@ uint8_t CSerialPort::readInt(uint8_t n) case 3U: #if defined(SERIAL_REPEATER) && defined(__STM32F1__) return Serial2.read(); + #elif defined(SERIAL_REPEATER) && (defined(__MK20DX256__) || defined(__MK64FX512__) || defined(__MK66FX1M0__)) + return Serial1.read(); #endif default: return 0U; @@ -97,6 +103,9 @@ void CSerialPort::writeInt(uint8_t n, const uint8_t* data, uint16_t length, bool #if defined(SERIAL_REPEATER) && defined(__STM32F1__) Serial2.write(data, length); break; + #elif defined(SERIAL_REPEATER) && (defined(__MK20DX256__) || defined(__MK64FX512__) || defined(__MK66FX1M0__)) + Serial1.write(data, length); + break; #endif default: break;