This program is guided to help establish a connection between two RFM95 900MHz LoRa radio modules using Maxim Integrated's Feather MCUs (MAX32630FTHR Mbed and the MAX32620FTHR Mbed). Once the radios are configured after powering on and if the radios are wired correctly, the two radios will self identify as either a master or a slave, and will then proceed to PING and PONG back and forth. Information about what is happening between the radios can be seen if the two boards are hooked up to a USB COM port through the included DAPLINK/MAX32625PICO modules.
Dependencies: BufferedSerial SX1276GenericLib USBDeviceHT max32630fthr
Fork of MAX326xxFTHR_LoRa_PingPong by
PinMap.h
00001 /* 00002 * Copyright (c) 2018 Helmut Tschemernjak 00003 * 30826 Garbsen (Hannover) Germany 00004 * Licensed under the Apache License, Version 2.0); 00005 */ 00006 00007 00008 00009 #ifdef TARGET_NUCLEO_L476RG 00010 #define FEATURE_LORA 00011 00012 #elif TARGET_DISCO_L072CZ_LRWAN1 00013 #define FEATURE_LORA 00014 00015 #elif TARGET_STM32L432KC 00016 #define HELTEC_STM32L4 00017 #define FEATURE_LORA 00018 #define FEATURE_USBSERIAL 00019 #endif 00020 00021 00022 00023 #if defined(TARGET_DISCO_L072CZ_LRWAN1) 00024 #define LED LED2 00025 00026 #define LORA_SPI_MOSI PA_7 00027 #define LORA_SPI_MISO PA_6 00028 #define LORA_SPI_SCLK PB_3 00029 #define LORA_CS PA_15 00030 #define LORA_RESET PC_0 00031 #define LORA_DIO0 PB_4 00032 #define LORA_DIO1 PB_1 00033 #define LORA_DIO2 PB_0 00034 #define LORA_DIO3 PC_13 00035 #define LORA_DIO4 PA_5 00036 #define LORA_DIO5 PA_4 00037 #define LORA_ANT_RX PA_1 00038 #define LORA_ANT_TX PC_2 00039 #define LORA_ANT_BOOST PC_1 00040 #define LORA_TCXO PA_12 // 32 MHz 00041 00042 00043 00044 #elif defined(TARGET_NUCLEO_L476RG) // using the RFM95 board 00045 00046 #define LORA_SPI_MOSI PC_12 00047 #define LORA_SPI_MISO PC_11 00048 #define LORA_SPI_SCLK PC_10 00049 #define LORA_CS PA_0 00050 #define LORA_RESET PA_1 00051 #define LORA_DIO0 PD_2 // DIO0=TxDone/RXDone 00052 #define LORA_DIO1 PB_7 // 00053 #define LORA_DIO2 PC_14 // DIO2=FhssChangeChannel 00054 #define LORA_DIO3 PC_15 // DIO3=CADDone 00055 #define LORA_DIO4 PH_0 // ???? 00056 #define LORA_DIO5 NC // unused? 00057 00058 #elif defined (HELTEC_STM32L4) 00059 00060 #define USER_BUTTON PH_3 // boot pin 00061 #define LED PB_0 // red 00062 #define LED2 PB_1 // green 00063 #define LED1 LED 00064 00065 #define POWER_VEXT PA_3 00066 #define POWER_VEXT_ON 0 00067 #define POWER_VEXT_OFF 1 00068 00069 00070 #define LORA_SPI_MOSI PA_7 00071 #define LORA_SPI_MISO PA_6 00072 #define LORA_SPI_SCLK PA_5 00073 #define LORA_CS PA_4 00074 #define LORA_RESET PA_1 00075 #define LORA_DIO0 PA_0 // DIO0=TxDone/RXDone/CADDone 00076 #define LORA_DIO1 NC // 00077 #define LORA_DIO2 NC // 00078 #define LORA_DIO3 NC // 00079 #define LORA_DIO4 NC // 00080 #define LORA_DIO5 NC // 00081 00082 #elif defined(TARGET_NUCLEO_L432KC) // using the RFM95 board 00083 00084 // #define LED PB_3 // green 00085 #define LED PB_5 // green 00086 00087 #define LORA_SPI_MOSI PA_7 00088 #define LORA_SPI_MISO PA_6 00089 #define LORA_SPI_SCLK PB_5 00090 #define LORA_CS PA_4 00091 #define LORA_RESET PA_1 00092 #define LORA_DIO0 PA_0 // DIO0=TxDone/RXDone/CADDone 00093 #define LORA_DIO1 NC // 00094 #define LORA_DIO2 NC // 00095 #define LORA_DIO3 NC // 00096 #define LORA_DIO4 NC // 00097 #define LORA_DIO5 NC // 00098 00099 00100 #elif defined(TARGET_NUCLEO_F411RE) // using the RFM95 board 00101 00102 #define LED LED1 // green 00103 00104 #define LORA_SPI_MOSI PC_12 00105 #define LORA_SPI_MISO PC_11 00106 #define LORA_SPI_SCLK PC_10 00107 #define LORA_CS PA_0 00108 #define LORA_RESET PA_1 00109 #define LORA_DIO0 PD_2 // DIO0=TxDone/RXDone 00110 #define LORA_DIO1 PB_7 // 00111 #define LORA_DIO2 PC_14 // DIO2=FhssChangeChannel 00112 #define LORA_DIO3 PC_15 // DIO3=CADDone 00113 #define LORA_DIO4 PH_0 // ???? 00114 #define LORA_DIO5 NC // unused? 00115 00116 00117 #elif defined(TARGET_MAX32630FTHR) // using the RFM95 board 00118 00119 // #define LED PB_3 // green 00120 #define LED LED2 // green 00121 00122 #define LORA_SPI_MOSI P5_1 00123 #define LORA_SPI_MISO P5_2 00124 #define LORA_SPI_SCLK P5_0 00125 #define LORA_CS P3_0 00126 #define LORA_RESET P3_1 00127 #define LORA_DIO0 P3_2 // DIO0=TxDone/RXDone/CADDone 00128 #define LORA_DIO1 NC // 00129 #define LORA_DIO2 NC // 00130 #define LORA_DIO3 NC // 00131 #define LORA_DIO4 NC // 00132 #define LORA_DIO5 NC // 00133 00134 #elif defined(TARGET_MAX32620FTHR) // using the RFM95 board 00135 00136 // #define LED PB_3 // green 00137 #define LED LED2 // green 00138 00139 #define LORA_SPI_MOSI P5_1 00140 #define LORA_SPI_MISO P5_2 00141 #define LORA_SPI_SCLK P5_0 00142 #define LORA_CS P3_0 00143 #define LORA_RESET P3_1 00144 #define LORA_DIO0 P3_2 // DIO0=TxDone/RXDone/CADDone 00145 #define LORA_DIO1 NC // 00146 #define LORA_DIO2 NC // 00147 #define LORA_DIO3 NC // 00148 #define LORA_DIO4 NC // 00149 #define LORA_DIO5 NC // 00150 00151 00152 00153 #else 00154 00155 #error "unknown board" 00156 00157 #endif
Generated on Tue Jul 12 2022 19:49:37 by 1.7.2