Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

AFSK tone reversal #6

Open
W4KRL opened this issue Mar 7, 2022 · 1 comment
Open

AFSK tone reversal #6

W4KRL opened this issue Mar 7, 2022 · 1 comment

Comments

@W4KRL
Copy link

W4KRL commented Mar 7, 2022

If you listen to the audio output of pin 2 using the Hello World example, you will notice that the preamble has a high pitch on every other transmission. Printing the first bit of each message looks like this:

MYCALL-1>APRS,WIDE2-1:>Hello World !!
1
MYCALL-1>APRS,WIDE2-1:>Hello World !!
0
MYCALL-1>APRS,WIDE2-1:>Hello World !!
1
MYCALL-1>APRS,WIDE2-1:>Hello World !!
0
MYCALL-1>APRS,WIDE2-1:>Hello World !!
1

The AFSK tones must be reversed on each transmission. Is this the expected operation?

Also, the comment says that the crc is calculated with 0x1024 but the code uses 0x8408:

/*

  • This function will calculate CRC-16 CCITT for the FCS (Frame Check Sequence)
  • as required for the HDLC frame validity check.
  • Using 0x1021 as polynomial generator. The CRC registers are initialized with
  • 0xFFFF
    */
    void calc_crc(bool in_bit)
    {
    unsigned short xor_in;

xor_in = crc ^ in_bit; // bitwise XOR
crc >>= 1;

if(xor_in & 0x01)
crc ^= 0x8408;
.
.
.

@rogerclarkmelbourne
Copy link

I'm not sure if this the problem with the 'high pitch' thing you noticed

But the global variable called nada is only initialised when the sketch first loads, and the state of this variable (which is a single binary bit) is changed as each packet is sent.

I think this should be set to its default value before each packet is sent.

Repository owner deleted a comment from roneyfraga Mar 18, 2024
Repository owner deleted a comment from roneyfraga Mar 18, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants
@W4KRL @rogerclarkmelbourne and others