Tuned 300 baud settings
This commit is contained in:
parent
16e989c680
commit
1c2d1b484b
51
device.h
51
device.h
|
@ -13,13 +13,10 @@
|
||||||
#define FREQUENCY_CORRECTION 0
|
#define FREQUENCY_CORRECTION 0
|
||||||
|
|
||||||
// Voltage references
|
// Voltage references
|
||||||
// TODO: Determine best defaults
|
|
||||||
#define CONFIG_ADC_REF 128
|
#define CONFIG_ADC_REF 128
|
||||||
#define CONFIG_DAC_REF 128
|
#define CONFIG_DAC_REF 255
|
||||||
|
|
||||||
// TODO: Change this back to default
|
#define CONFIG_LED_INTENSITY 192
|
||||||
//#define CONFIG_LED_INTENSITY 192
|
|
||||||
#define CONFIG_LED_INTENSITY 37
|
|
||||||
#define CONFIG_COM_LED_TIMEOUT_MS 40
|
#define CONFIG_COM_LED_TIMEOUT_MS 40
|
||||||
#define CONFIG_LED_UPDATE_INTERVAL_MS 40
|
#define CONFIG_LED_UPDATE_INTERVAL_MS 40
|
||||||
|
|
||||||
|
@ -29,9 +26,9 @@
|
||||||
// Serial settings
|
// Serial settings
|
||||||
#define SERIAL_DEBUG false
|
#define SERIAL_DEBUG false
|
||||||
#define TX_MAXWAIT 2UL
|
#define TX_MAXWAIT 2UL
|
||||||
#define CONFIG_QUEUE_SIZE 6000 // TODO: Optimise this by saving ram other places, add SD queue
|
#define CONFIG_QUEUE_SIZE 6000
|
||||||
#define CONFIG_QUEUE_MAX_LENGTH 15
|
#define CONFIG_QUEUE_MAX_LENGTH 15
|
||||||
#define CONFIG_UART0_BUFFER_SIZE 1536 // TODO: Tune this, what is actually required?
|
#define CONFIG_UART0_BUFFER_SIZE 1536
|
||||||
#define CONFIG_UART1_BUFFER_SIZE 128
|
#define CONFIG_UART1_BUFFER_SIZE 128
|
||||||
#define CONFIG_SERIAL_TIMEOUT_MS 10
|
#define CONFIG_SERIAL_TIMEOUT_MS 10
|
||||||
#define CONFIG_BENCHMARK_MODE false
|
#define CONFIG_BENCHMARK_MODE false
|
||||||
|
@ -102,42 +99,4 @@
|
||||||
#define USR_IO_4 4
|
#define USR_IO_4 4
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/*
|
|
||||||
PA0 ANALOG_IN
|
|
||||||
PA1 USR_1
|
|
||||||
PA2 USR_2
|
|
||||||
PA3 USR_3 / BT_MODE // TODO: Set as output
|
|
||||||
PA4 USR_4 / BT_RTS // TODO: Set as input
|
|
||||||
PA5 GPS_EN // TODO: Set as output/input
|
|
||||||
PA6 SD_CS // TODO: Set as output
|
|
||||||
PA7 SD_DETECT // TODO: Set as input and enable pullup
|
|
||||||
|
|
||||||
PB0 LED_RX
|
|
||||||
PB1 LED_TX
|
|
||||||
PB2 LED_STATUS
|
|
||||||
PB3 LED_DRAIN_PWM
|
|
||||||
PB4 LED_COM / SPI_SS (PGM)
|
|
||||||
PB5 SPI_MOSI SD/PGM
|
|
||||||
PB6 SPI_MISO SD/PGM
|
|
||||||
PB7 SPI_CLK SD/PGM
|
|
||||||
|
|
||||||
PC0 DAC_0
|
|
||||||
PC1 DAC_1
|
|
||||||
PC2 DAC_2
|
|
||||||
PC3 DAC_3
|
|
||||||
PC4 DAC_4
|
|
||||||
PC5 DAC_5
|
|
||||||
PC6 DAC_6
|
|
||||||
PC7 DAC_7
|
|
||||||
|
|
||||||
PD0 UART0_RX
|
|
||||||
PD1 UART0_TX
|
|
||||||
PD2 UART1_RX GPS
|
|
||||||
PD3 UART1_TX GPS
|
|
||||||
PD4 PTT_NEG
|
|
||||||
PD5 PTT_SIG
|
|
||||||
PD6 REF_DAC
|
|
||||||
PD7 REF_ADC
|
|
||||||
*/
|
|
|
@ -120,8 +120,8 @@ inline static uint8_t sinSample(uint16_t i) {
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if BITRATE == 300
|
#if BITRATE == 300
|
||||||
#define DCD_TIMEOUT_SAMPLES 520
|
#define DCD_TIMEOUT_SAMPLES 512
|
||||||
#define DCD_MIN_COUNT 2
|
#define DCD_MIN_COUNT 4
|
||||||
#elif BITRATE == 1200
|
#elif BITRATE == 1200
|
||||||
#define DCD_TIMEOUT_SAMPLES CONFIG_ADC_SAMPLERATE/100
|
#define DCD_TIMEOUT_SAMPLES CONFIG_ADC_SAMPLERATE/100
|
||||||
#define DCD_MIN_COUNT CONFIG_ADC_SAMPLERATE/1600
|
#define DCD_MIN_COUNT CONFIG_ADC_SAMPLERATE/1600
|
||||||
|
@ -177,7 +177,7 @@ typedef struct Afsk
|
||||||
uint16_t phaseAcc; // Phase accumulator
|
uint16_t phaseAcc; // Phase accumulator
|
||||||
uint16_t phaseInc; // Phase increment per sample
|
uint16_t phaseInc; // Phase increment per sample
|
||||||
|
|
||||||
uint16_t silentSamples; // How many samples were completely silent
|
uint16_t silentSamples; // How many samples were silent
|
||||||
|
|
||||||
volatile bool sending; // Set when modem is sending
|
volatile bool sending; // Set when modem is sending
|
||||||
volatile bool sending_data; // Set when modem is sending data
|
volatile bool sending_data; // Set when modem is sending data
|
||||||
|
@ -208,7 +208,7 @@ typedef struct Afsk
|
||||||
#else
|
#else
|
||||||
#error Not enough space in sampledBits variable!
|
#error Not enough space in sampledBits variable!
|
||||||
#endif
|
#endif
|
||||||
int16_t currentPhase; // Current phase of the demodulator
|
int16_t currentPhase; // Current phase of the demodulator
|
||||||
uint8_t actualBits; // Actual found bits at correct bitrate
|
uint8_t actualBits; // Actual found bits at correct bitrate
|
||||||
|
|
||||||
volatile int status; // Status of the modem, 0 means OK
|
volatile int status; // Status of the modem, 0 means OK
|
||||||
|
|
|
@ -191,23 +191,20 @@ void gps_nmea_parse(uint8_t sentence_length) {
|
||||||
gps_lon *= (gps_lon_sign == 'E' ? 1 : -1);
|
gps_lon *= (gps_lon_sign == 'E' ? 1 : -1);
|
||||||
|
|
||||||
// TODO: Remove this
|
// TODO: Remove this
|
||||||
// if (gps_fix) {
|
// printf("GPS fix: %d\r\n", nmea_fix);
|
||||||
// printf("GPS fix: %d\r\n", nmea_fix);
|
// printf("GPS satellites: %d\r\n", gps_sats);
|
||||||
// printf("GPS satellites: %d\r\n", gps_sats);
|
// printf("GPS latitude: %d\" %d' %.2fs %c\r\n", gps_lat_degrees, gps_lat_minutes, gps_lat_seconds, gps_lat_sign);
|
||||||
// printf("GPS latitude: %d\" %d' %.2fs %c\r\n", gps_lat_degrees, gps_lat_minutes, gps_lat_seconds, gps_lat_sign);
|
// printf("GPS longtitude: %d\" %d' %.2fs %c\r\n", gps_lon_degrees, gps_lon_minutes, gps_lon_seconds, gps_lon_sign);
|
||||||
// printf("GPS longtitude: %d\" %d' %.2fs %c\r\n", gps_lon_degrees, gps_lon_minutes, gps_lon_seconds, gps_lon_sign);
|
// printf("GPS coords: %.6f,%.6f\r\n", gps_lat, gps_lon);
|
||||||
// printf("GPS coords: %.6f,%.6f\r\n", gps_lat, gps_lon);
|
// printf("GPS speed %.2f Km/h\r\n", gps_speed_kmh);
|
||||||
// printf("GPS speed %.2f Km/h\r\n", gps_speed_kmh);
|
// printf("GPS speed %.2f knots\r\n", gps_speed_knots);
|
||||||
// printf("GPS speed %.2f knots\r\n", gps_speed_knots);
|
// printf("GPS bearing %.2f\r\n", gps_bearing);
|
||||||
// printf("GPS bearing %.2f\r\n", gps_bearing);
|
// printf("GPS height above MSL: %.2f\r\n", gps_height_above_msl);
|
||||||
// printf("GPS height above MSL: %.2f\r\n", gps_height_above_msl);
|
// printf("GPS altitude: %.2f\r\n", gps_altitude);
|
||||||
// printf("GPS altitude: %.2f\r\n", gps_altitude);
|
// printf("GPS geoid height: %.2f\r\n", gps_geoid_height);
|
||||||
// printf("GPS geoid height: %.2f\r\n", gps_geoid_height);
|
// printf("GPS HDOP: %.2f\r\n", gps_hdop);
|
||||||
// printf("GPS HDOP: %.2f\r\n", gps_hdop);
|
// printf("GPS time %d:%d:%d UTC\r\n", gps_t_hour, gps_t_minute, gps_t_second);
|
||||||
// printf("GPS time %d:%d:%d UTC\r\n", gps_t_hour, gps_t_minute, gps_t_second);
|
|
||||||
// } else {
|
|
||||||
// printf("No GPS fix");
|
|
||||||
// }
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -19,7 +19,7 @@ void VREF_init(void) {
|
||||||
|
|
||||||
void vref_setADC(uint8_t value) {
|
void vref_setADC(uint8_t value) {
|
||||||
config_input_gain = value;
|
config_input_gain = value;
|
||||||
OCR2A = config_input_gain;
|
OCR2A = 0xFF - config_input_gain;
|
||||||
}
|
}
|
||||||
|
|
||||||
void vref_setDAC(uint8_t value) {
|
void vref_setDAC(uint8_t value) {
|
||||||
|
|
|
@ -196,7 +196,7 @@ void config_set_output_gain(uint8_t gain) {
|
||||||
}
|
}
|
||||||
|
|
||||||
void config_set_input_gain(uint8_t gain) {
|
void config_set_input_gain(uint8_t gain) {
|
||||||
vref_setADC(0xFF - gain);
|
vref_setADC(gain);
|
||||||
}
|
}
|
||||||
|
|
||||||
void config_set_passall(uint8_t passall) {
|
void config_set_passall(uint8_t passall) {
|
||||||
|
|
Loading…
Reference in New Issue