From 516f9804a0229b9c290ade08bf35dbc8c68d30a0 Mon Sep 17 00:00:00 2001 From: Peter Antypas Date: Sun, 5 Jun 2016 08:31:45 -0700 Subject: [PATCH] Changed UART parameters to reduce noise --- src/DataTerminal.cpp | 2 +- src/GPS.cpp | 4 ++-- src/RadioManager.cpp | 14 +++++++------- src/globals.h | 2 +- src/main.cpp | 2 +- 5 files changed, 12 insertions(+), 12 deletions(-) diff --git a/src/DataTerminal.cpp b/src/DataTerminal.cpp index fe1ace4..35ffba1 100644 --- a/src/DataTerminal.cpp +++ b/src/DataTerminal.cpp @@ -35,7 +35,7 @@ void DataTerminal::init() GPIO_InitStruct.GPIO_Mode = GPIO_Mode_AF; GPIO_InitStruct.GPIO_OType = GPIO_OType_PP; GPIO_InitStruct.GPIO_PuPd = GPIO_PuPd_NOPULL; - GPIO_InitStruct.GPIO_Speed = GPIO_Speed_Level_1; + GPIO_InitStruct.GPIO_Speed = GPIO_Speed_Level_3; GPIO_Init(GPIOB, &GPIO_InitStruct); RCC_APB1PeriphClockCmd(RCC_APB1Periph_USART3, ENABLE); diff --git a/src/GPS.cpp b/src/GPS.cpp index ab3742f..3f7499d 100644 --- a/src/GPS.cpp +++ b/src/GPS.cpp @@ -84,13 +84,13 @@ void GPS::init() GPIO_InitStruct.GPIO_Mode = GPIO_Mode_AF; GPIO_InitStruct.GPIO_OType = GPIO_OType_PP; GPIO_InitStruct.GPIO_PuPd = GPIO_PuPd_NOPULL; - GPIO_InitStruct.GPIO_Speed = GPIO_Speed_Level_2; + GPIO_InitStruct.GPIO_Speed = GPIO_Speed_Level_3; GPIO_Init(GPIOA, &GPIO_InitStruct); /* PA0 is connected to EXTI_Line0 -- currently the PPS signal from the GPS */ GPIO_InitStruct.GPIO_Pin = GPIO_Pin_0; GPIO_InitStruct.GPIO_Mode = GPIO_Mode_IN; - GPIO_InitStruct.GPIO_Speed = GPIO_Speed_Level_1; + GPIO_InitStruct.GPIO_Speed = GPIO_Speed_Level_3; GPIO_InitStruct.GPIO_OType = GPIO_OType_PP; GPIO_InitStruct.GPIO_PuPd = GPIO_PuPd_NOPULL; GPIO_Init(GPIOA, &GPIO_InitStruct); diff --git a/src/RadioManager.cpp b/src/RadioManager.cpp index 6350e40..f396d87 100644 --- a/src/RadioManager.cpp +++ b/src/RadioManager.cpp @@ -42,7 +42,7 @@ void RadioManager::init() GPIO_InitTypeDef gpio; gpio.GPIO_Pin = GPIO_Pin_5 | GPIO_Pin_6 | GPIO_Pin_7; gpio.GPIO_Mode = GPIO_Mode_AF; - gpio.GPIO_Speed = GPIO_Speed_Level_3; + gpio.GPIO_Speed = GPIO_Speed_Level_2; gpio.GPIO_OType = GPIO_OType_PP; gpio.GPIO_PuPd = GPIO_PuPd_NOPULL; @@ -63,7 +63,7 @@ void RadioManager::init() // PB8 is SDN2 gpio.GPIO_Pin = GPIO_Pin_8; gpio.GPIO_Mode = GPIO_Mode_OUT; - gpio.GPIO_Speed = GPIO_Speed_Level_2; + gpio.GPIO_Speed = GPIO_Speed_Level_3; gpio.GPIO_OType = GPIO_OType_PP; gpio.GPIO_PuPd = GPIO_PuPd_UP; GPIO_Init(GPIOB, &gpio); @@ -71,7 +71,7 @@ void RadioManager::init() // PC13 starts as input, used for POR status (RFIC2 GPIO1 -> MCU), then switched between RX/TX DATA as necessary gpio.GPIO_Pin = GPIO_Pin_13; gpio.GPIO_Mode = GPIO_Mode_IN; - gpio.GPIO_Speed = GPIO_Speed_Level_1; + gpio.GPIO_Speed = GPIO_Speed_Level_3; gpio.GPIO_OType = GPIO_OType_PP; gpio.GPIO_PuPd = GPIO_PuPd_NOPULL; GPIO_Init(GPIOC, &gpio); @@ -79,7 +79,7 @@ void RadioManager::init() // PB9 is input for bit clock, both RX and TX (RFIC2 GPIO3 -> MCU) gpio.GPIO_Pin = GPIO_Pin_9; gpio.GPIO_Mode = GPIO_Mode_IN; - gpio.GPIO_Speed = GPIO_Speed_Level_2; + gpio.GPIO_Speed = GPIO_Speed_Level_3; gpio.GPIO_OType = GPIO_OType_PP; gpio.GPIO_PuPd = GPIO_PuPd_NOPULL; GPIO_Init(GPIOB, &gpio); @@ -96,7 +96,7 @@ void RadioManager::init() // PA3 will be the SDN1 pin gpio.GPIO_Pin = GPIO_Pin_3; gpio.GPIO_Mode = GPIO_Mode_OUT; - gpio.GPIO_Speed = GPIO_Speed_Level_2; + gpio.GPIO_Speed = GPIO_Speed_Level_3; gpio.GPIO_OType = GPIO_OType_PP; gpio.GPIO_PuPd = GPIO_PuPd_UP; GPIO_Init(GPIOA, &gpio); @@ -104,7 +104,7 @@ void RadioManager::init() // PB2 starts as input, used for POR status (RFIC1 GPIO1 -> MCU), then switched between RX/TX DATA as necessary gpio.GPIO_Pin = GPIO_Pin_2; gpio.GPIO_Mode = GPIO_Mode_IN; - gpio.GPIO_Speed = GPIO_Speed_Level_1; + gpio.GPIO_Speed = GPIO_Speed_Level_3; gpio.GPIO_OType = GPIO_OType_PP; gpio.GPIO_PuPd = GPIO_PuPd_NOPULL; GPIO_Init(GPIOB, &gpio); @@ -112,7 +112,7 @@ void RadioManager::init() // PA1 is input for bit clock, both RX and TX (RFIC1 GPIO3 -> MCU) gpio.GPIO_Pin = GPIO_Pin_1; gpio.GPIO_Mode = GPIO_Mode_IN; - gpio.GPIO_Speed = GPIO_Speed_Level_2; + gpio.GPIO_Speed = GPIO_Speed_Level_3; gpio.GPIO_OType = GPIO_OType_PP; gpio.GPIO_PuPd = GPIO_PuPd_NOPULL; GPIO_Init(GPIOA, &gpio); diff --git a/src/globals.h b/src/globals.h index 0759eca..0055df1 100644 --- a/src/globals.h +++ b/src/globals.h @@ -31,7 +31,7 @@ #ifdef CALIBRATION_MODE -#define TX_POWER_LEVEL PWR_M27 +#define TX_POWER_LEVEL PWR_M16 #else #ifdef TX_TEST_MODE #define TX_POWER_LEVEL PWR_P16 diff --git a/src/main.cpp b/src/main.cpp index 27b7c03..ece773b 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -56,7 +56,7 @@ main(int argc, char* argv[]) { // At this stage the system clock should have already been configured // at high speed. - printf2_Init(230400); + printf2_Init(38400); #ifdef DEBUG // Disable buffered memory writes to debug imprecise bus faults