kopia lustrzana https://github.com/bristol-seds/pico-tracker
UBSEDS12: Contestia 16/1000 once per minute
rodzic
658076c468
commit
1c2b939256
|
@ -25,13 +25,28 @@
|
||||||
#ifndef CONTESTIA_H
|
#ifndef CONTESTIA_H
|
||||||
#define CONTESTIA_H
|
#define CONTESTIA_H
|
||||||
|
|
||||||
|
|
||||||
|
/* /\** */
|
||||||
|
/* * Contestia 8/1000 */
|
||||||
|
/* *\/ */
|
||||||
|
/* #define CONTESTIA_NUMBER_OF_TONES 8 */
|
||||||
|
/* #define CONTESTIA_CHARACTERS_PER_BLOCK 3 */
|
||||||
|
/* #define CONTESTIA_CHANNEL_SPACING 16 // Corresponds to 124.88 Hz */
|
||||||
|
/* #define CONTESTIA_SYMBOL_RATE 125 */
|
||||||
/**
|
/**
|
||||||
* Contestia 32/1000
|
* Contestia 16/1000
|
||||||
*/
|
*/
|
||||||
#define CONTESTIA_NUMBER_OF_TONES 32
|
#define CONTESTIA_NUMBER_OF_TONES 16
|
||||||
#define CONTESTIA_CHARACTERS_PER_BLOCK 5
|
#define CONTESTIA_CHARACTERS_PER_BLOCK 4
|
||||||
#define CONTESTIA_CHANNEL_SPACING 4 // Corresponds to 31.22 Hz
|
#define CONTESTIA_CHANNEL_SPACING 8 // Corresponds to 62.44 Hz
|
||||||
#define CONTESTIA_SYMBOL_RATE 31.25
|
#define CONTESTIA_SYMBOL_RATE 62.5
|
||||||
|
/* /\** */
|
||||||
|
/* * Contestia 32/1000 */
|
||||||
|
/* *\/ */
|
||||||
|
/* #define CONTESTIA_NUMBER_OF_TONES 32 */
|
||||||
|
/* #define CONTESTIA_CHARACTERS_PER_BLOCK 5 */
|
||||||
|
/* #define CONTESTIA_CHANNEL_SPACING 4 // Corresponds to 31.22 Hz */
|
||||||
|
/* #define CONTESTIA_SYMBOL_RATE 31.25 */
|
||||||
|
|
||||||
|
|
||||||
void contestia_start(char* data);
|
void contestia_start(char* data);
|
||||||
|
|
|
@ -129,7 +129,7 @@
|
||||||
* Telemetry
|
* Telemetry
|
||||||
*/
|
*/
|
||||||
#define TELEMETRY_FREQUENCY 434600000
|
#define TELEMETRY_FREQUENCY 434600000
|
||||||
#define TELEMETRY_INTERVAL 30
|
#define TELEMETRY_INTERVAL 60
|
||||||
#define APRS_INTERVAL 180
|
#define APRS_INTERVAL 180
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -35,7 +35,7 @@
|
||||||
/**
|
/**
|
||||||
* Current output tones
|
* Current output tones
|
||||||
*/
|
*/
|
||||||
int8_t contestia_tones[CONTESTIA_NUMBER_OF_TONES];
|
int8_t contestia_tones[32];
|
||||||
/**
|
/**
|
||||||
* Where we are in the current output tones
|
* Where we are in the current output tones
|
||||||
*/
|
*/
|
||||||
|
@ -80,7 +80,7 @@ uint8_t contestia_tick(void) {
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (contestia_tone_index < CONTESTIA_NUMBER_OF_TONES) {
|
if (contestia_tone_index < 32) {
|
||||||
uint8_t binary_code;
|
uint8_t binary_code;
|
||||||
uint8_t grey_code;
|
uint8_t grey_code;
|
||||||
|
|
||||||
|
@ -97,7 +97,7 @@ uint8_t contestia_tick(void) {
|
||||||
|
|
||||||
contestia_tone_index++;
|
contestia_tone_index++;
|
||||||
|
|
||||||
if (contestia_tone_index < CONTESTIA_NUMBER_OF_TONES) {
|
if (contestia_tone_index < 32) {
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -52,7 +52,7 @@
|
||||||
#include "spi_bitbang.h"
|
#include "spi_bitbang.h"
|
||||||
#include "system/interrupt.h"
|
#include "system/interrupt.h"
|
||||||
|
|
||||||
#define CALLSIGN "UBSEDS6"
|
#define CALLSIGN "UBSEDS12"
|
||||||
|
|
||||||
void xosc_measure_callback(uint32_t result);
|
void xosc_measure_callback(uint32_t result);
|
||||||
void timepulse_callback(uint32_t sequence);
|
void timepulse_callback(uint32_t sequence);
|
||||||
|
@ -223,7 +223,7 @@ void output_telemetry_string(enum telemetry_t type)
|
||||||
/* RSID */
|
/* RSID */
|
||||||
/* start - SI NOW BELONGS TO TELEMETRY, WE CANNOT ACCESS */
|
/* start - SI NOW BELONGS TO TELEMETRY, WE CANNOT ACCESS */
|
||||||
if (type == TELEMETRY_CONTESTIA) {
|
if (type == TELEMETRY_CONTESTIA) {
|
||||||
telemetry_start_rsid(RSID_CONTESTIA_32_1000);
|
telemetry_start_rsid(RSID_CONTESTIA_16_1000);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Sleep Wait for RSID */
|
/* Sleep Wait for RSID */
|
||||||
|
@ -391,16 +391,14 @@ int main(void)
|
||||||
//wdt_reset_count();
|
//wdt_reset_count();
|
||||||
|
|
||||||
/* Send the next packet */
|
/* Send the next packet */
|
||||||
output_telemetry_string((telemetry_alternate++ & 1) ?
|
output_telemetry_string(TELEMETRY_CONTESTIA);
|
||||||
TELEMETRY_CONTESTIA :
|
|
||||||
TELEMETRY_RTTY);
|
|
||||||
|
|
||||||
|
|
||||||
/* Maybe aprs? */
|
/* Maybe aprs? */
|
||||||
if (aprs_trigger_flag) {
|
/* if (aprs_trigger_flag) { */
|
||||||
aprs_telemetry();
|
/* aprs_telemetry(); */
|
||||||
}
|
/* } */
|
||||||
aprs_trigger_flag = 0;
|
/* aprs_trigger_flag = 0; */
|
||||||
|
|
||||||
|
|
||||||
/* Pips */
|
/* Pips */
|
||||||
|
|
|
@ -27,16 +27,12 @@
|
||||||
#include "samd20.h"
|
#include "samd20.h"
|
||||||
#include "mfsk.h"
|
#include "mfsk.h"
|
||||||
#include "math/fwht.h"
|
#include "math/fwht.h"
|
||||||
|
#include "contestia.h"
|
||||||
//#define OLIVIA_MFSK_ENCODE_TEST
|
|
||||||
#ifdef OLIVIA_MFSK_ENCODE_TEST
|
|
||||||
#include <stdint.h>
|
|
||||||
#endif
|
|
||||||
|
|
||||||
|
|
||||||
static const uint64_t scrambler_olivia = 0xE257E6D0291574ECLL;
|
static const uint64_t scrambler_olivia = 0xE257E6D0291574ECLL;
|
||||||
static const uint64_t scrambler_contestia = 0xEDB88320LL;
|
static const uint64_t scrambler_contestia = 0xEDB88320LL;
|
||||||
|
static const uint16_t shift_olivia = 13;
|
||||||
|
static const uint16_t shift_contestia = 5;
|
||||||
/**
|
/**
|
||||||
* USEFUL RESOURES =============================================================
|
* USEFUL RESOURES =============================================================
|
||||||
*
|
*
|
||||||
|
@ -116,7 +112,8 @@ void olivia_mfsk_encode_block(char* block, int8_t* tones)
|
||||||
{
|
{
|
||||||
size_t bits_per_symbol = 5; /* That is, there are 2^5=32 tones */
|
size_t bits_per_symbol = 5; /* That is, there are 2^5=32 tones */
|
||||||
|
|
||||||
mfsk_encode_block(block, tones, 64, bits_per_symbol, scrambler_olivia, 13);
|
mfsk_encode_block(block, tones, 64, bits_per_symbol,
|
||||||
|
scrambler_olivia, shift_olivia);
|
||||||
}
|
}
|
||||||
/**
|
/**
|
||||||
* This function encodes a single block of Contestia MFSK
|
* This function encodes a single block of Contestia MFSK
|
||||||
|
@ -126,7 +123,7 @@ void olivia_mfsk_encode_block(char* block, int8_t* tones)
|
||||||
*/
|
*/
|
||||||
void contestia_mfsk_encode_block(char* block, int8_t* tones)
|
void contestia_mfsk_encode_block(char* block, int8_t* tones)
|
||||||
{
|
{
|
||||||
size_t bits_per_symbol = 5; /* That is, there are 2^5=32 tones */
|
size_t bits_per_symbol = CONTESTIA_CHARACTERS_PER_BLOCK; /* That is, there are 2^x tones */
|
||||||
|
|
||||||
for (uint8_t c_index = 0; c_index < bits_per_symbol; c_index++) {
|
for (uint8_t c_index = 0; c_index < bits_per_symbol; c_index++) {
|
||||||
char character = block[c_index];
|
char character = block[c_index];
|
||||||
|
@ -157,28 +154,6 @@ void contestia_mfsk_encode_block(char* block, int8_t* tones)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
mfsk_encode_block(block, tones, 32, bits_per_symbol, scrambler_contestia, 5);
|
mfsk_encode_block(block, tones, 32, bits_per_symbol,
|
||||||
|
scrambler_contestia, shift_contestia);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
#ifdef OLIVIA_MFSK_ENCODE_TEST
|
|
||||||
void main(void)
|
|
||||||
{
|
|
||||||
/* Define a test string */
|
|
||||||
char test_string[6];
|
|
||||||
test_string = "HELLO";
|
|
||||||
|
|
||||||
/* Define a buffer for the tones produced */
|
|
||||||
int8_t tones[64];
|
|
||||||
|
|
||||||
|
|
||||||
olivia_mfsk_encode_block(test_string, tones);
|
|
||||||
|
|
||||||
|
|
||||||
/* Debug printout */
|
|
||||||
for (int i = 0; i < sizeof(tones)/sizeof(int8_t); i++) {
|
|
||||||
printf("%d ", tones[i]);
|
|
||||||
}
|
|
||||||
printf("\n");
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
|
|
Ładowanie…
Reference in New Issue