kopia lustrzana https://github.com/roncarr880/QRP_LABS_WSPR
Add files via upload
rodzic
40348dc9ab
commit
367a049dce
|
@ -1,6 +1,9 @@
|
||||||
// !!! note: there is a loose connection somewhere in the headers or the jumper wires to the headers. It will
|
// !!! note: there is a loose connection somewhere in the headers or the jumper wires to the headers. It will
|
||||||
// hang in setup on I2C commands sometimes. Maybe the clock or maybe the screw that contacts the USB
|
// hang in setup on I2C commands sometimes. Maybe the clock or maybe the screw that contacts the USB
|
||||||
// jack is keeping the boards too far apart. Just a note for when it happens again.
|
// jack is keeping the boards too far apart. Just a note for when it happens again.
|
||||||
|
// my common startup commands with WWVB logging
|
||||||
|
// enter 1 CAT command, ?V for Rx only or #0 to stay in FRAME TX mode
|
||||||
|
|
||||||
// QRP_LABS_WSPR
|
// QRP_LABS_WSPR
|
||||||
// Arduino, QRP Labs Arduino shield, SI5351 clock, QRP Labs RX module, QRP Labs relay board.
|
// Arduino, QRP Labs Arduino shield, SI5351 clock, QRP Labs RX module, QRP Labs relay board.
|
||||||
// NOTE: The tx bias pot works in reverse, fully clockwise is off.
|
// NOTE: The tx bias pot works in reverse, fully clockwise is off.
|
||||||
|
@ -150,6 +153,7 @@ uint8_t time_flags; // WWVB encodes the previous minute, flags to print the corr
|
||||||
uint8_t trends[60];
|
uint8_t trends[60];
|
||||||
uint8_t clr_trends;
|
uint8_t clr_trends;
|
||||||
unsigned int decodes;
|
unsigned int decodes;
|
||||||
|
uint8_t report_i; // see if a single trend shows the lsb of minutes position in time.
|
||||||
/***************************************************************************/
|
/***************************************************************************/
|
||||||
|
|
||||||
void ee_save(){
|
void ee_save(){
|
||||||
|
@ -500,6 +504,7 @@ static int unslip;
|
||||||
uint8_t count;
|
uint8_t count;
|
||||||
uint8_t trend_t,new_t;
|
uint8_t trend_t,new_t;
|
||||||
int w;
|
int w;
|
||||||
|
static int s_count; // counts from last sync - detect when spaced 9 apart. Most are 10 apart.
|
||||||
|
|
||||||
#define LIMIT 6 // 2 min 30 max
|
#define LIMIT 6 // 2 min 30 max
|
||||||
#define SYNC 32
|
#define SYNC 32
|
||||||
|
@ -519,8 +524,8 @@ int w;
|
||||||
if( frame_sec < 60 && (frame_msec < 400 || frame_msec > 600) ){
|
if( frame_sec < 60 && (frame_msec < 400 || frame_msec > 600) ){
|
||||||
if( frame_sec == 0 && frame_msec > 600 ) ; // ok, just early
|
if( frame_sec == 0 && frame_msec > 600 ) ; // ok, just early
|
||||||
else if( frame_sec == 1 && frame_msec < 400 ) ; // also ok
|
else if( frame_sec == 1 && frame_msec < 400 ) ; // also ok
|
||||||
else if( frame_sec < 30 && frame_sec > 0 ) ++i; // running slow is normal on weak signals
|
else if( frame_sec < 30 && frame_sec > 0 ) ++i, report_i = 0; // running slow is normal on weak signals
|
||||||
else unslip = 1; // probably a time reset or decode happened
|
else unslip = 1, report_i = 0;; // probably a time reset or decode happened
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -533,6 +538,13 @@ int w;
|
||||||
if( val == '1' ) new_t = ONES;
|
if( val == '1' ) new_t = ONES;
|
||||||
if( val == '0' ) new_t = ZEROS;
|
if( val == '0' ) new_t = ZEROS;
|
||||||
|
|
||||||
|
++s_count; // count from the last sync. Attempt early sync to 9 syncs spacing.
|
||||||
|
if( new_t == SYNC ){
|
||||||
|
if( s_count == 9 ) report_i = i;
|
||||||
|
if( s_count == 1 ) report_i = (i+9) % 60; // double sync detect
|
||||||
|
s_count = 0;
|
||||||
|
}
|
||||||
|
|
||||||
if( trend_t == new_t && trend_t != ERR ){ // increment the trend if match
|
if( trend_t == new_t && trend_t != ERR ){ // increment the trend if match
|
||||||
if( count < LIMIT ) ++count;
|
if( count < LIMIT ) ++count;
|
||||||
}
|
}
|
||||||
|
@ -1403,6 +1415,7 @@ char ch;
|
||||||
// break this up for 1200 baud, takes too much time and causes missed decode after line feed
|
// break this up for 1200 baud, takes too much time and causes missed decode after line feed
|
||||||
if( wwvb_quiet == 1 ){
|
if( wwvb_quiet == 1 ){
|
||||||
Serial.write(' ');
|
Serial.write(' ');
|
||||||
|
Serial.print(report_i); Serial.write(' ');
|
||||||
print_date_time();
|
print_date_time();
|
||||||
Serial.write(' ');
|
Serial.write(' ');
|
||||||
if( frame_msec < 100 ) Serial.write(' ');
|
if( frame_msec < 100 ) Serial.write(' ');
|
||||||
|
@ -1423,6 +1436,13 @@ char ch;
|
||||||
}
|
}
|
||||||
else print_stats(0,errors);
|
else print_stats(0,errors);
|
||||||
|
|
||||||
|
// use stats for an early sync to correct second
|
||||||
|
if( decodes == 0 && errors < 45 && report_i > 0 && report_i < 20 ){
|
||||||
|
if( report_i < 9 ) tm_correction2 += 100;
|
||||||
|
if( report_i > 9 ) tm_correction2 -= 100;
|
||||||
|
// if( report_i != 9 ) report_i = 0; // one time only for each detect( now one second adjust )
|
||||||
|
}
|
||||||
|
|
||||||
// time_flags = 0;
|
// time_flags = 0;
|
||||||
|
|
||||||
dither = ( errors >> 4 ) + 1;
|
dither = ( errors >> 4 ) + 1;
|
||||||
|
|
Ładowanie…
Reference in New Issue