Skip to content

feat: Implement wired FSK comms in firmware#82

Merged
fanfare-ff merged 14 commits intoShiegeChan:devfrom
Ferni41359:proj/51/Tx_Rx_sync
Jan 23, 2026
Merged

feat: Implement wired FSK comms in firmware#82
fanfare-ff merged 14 commits intoShiegeChan:devfrom
Ferni41359:proj/51/Tx_Rx_sync

Conversation

@Ferni41359
Copy link
Collaborator

@Ferni41359 Ferni41359 commented Jan 19, 2026

  • Please check if the Pull Request fulfils these requirements

    • PR title follows the style: type: Descriptive Name
    • Commit messages follow the guidelines
    • Code compiles
    • New additions are tested
    • Changes are documented on the website (refer to the docs section)
  • Link related open issue
    [TASK] Port FSK demodulator from MATLAB to STM32 #52

  • Provide a short description
    Implemented wired FSK comms project in firmware

  • Provide a more detailed list of changes

    • You can write anything you want up to 64 characters
    • The entire message is coded in binary using two frequencies and send
    • The receiver synchronize with the first bit
    • Goertzel algorithm decoding the message
    • Received message print on serial monitor
  • Does this PR introduce a breaking change? (What must be changed in other projects/examples due to this PR?)
    N/A

  • Other information (Anything else reviewers should know)
    It was made to work not just with cables but also with the microphones. However, due to frequency matching and the frequency response of the microphones, it would be really hard to get it done.

@fanfare-ff fanfare-ff changed the title Proj/51/tx_rx_sync feat: Implement wired FSK comms in firmware Jan 19, 2026
Copy link
Collaborator

@fanfare-ff fanfare-ff left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I checked the styling, please fix these couple of inconsistencies

Logic looks okay, but we will take a deeper look in the setup with not multiple frequencies

uint8_t error_led = D86;
static uint32_t lib_error = 0; // Internal library error container
uint8_t error_led = D86;
const int SYNC_PIN = 2; // Syncronization signal from PIN 2 digital
Copy link
Collaborator

@fanfare-ff fanfare-ff Jan 23, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

put this SYNC_PIN to settings below, not error tab

Comment on lines +75 to +77
float fs = 32800 * 32; // Your sample rate
float f0 = fs / SAMPLES_PER_BIT; // YOUR low frequency
float f1 = fs * 2 / SAMPLES_PER_BIT; // YOUR high frequency
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Define these as settings in the beginning of the file

for (uint8_t byte_idx = 0; byte_idx < num_bytes; byte_idx++) {
uint8_t current_byte = data[byte_idx];

for (int bit_pos = 7; bit_pos >= 0; bit_pos--) {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

size_t

uint16_t bit_start_index = (byte_idx * BIT_PER_BYTE + 7 - bit_pos) * SAMPLES_PER_BIT;

if (bit) { // Asign bit '1' to high frequency LUT
for (int i = 0; i < sine_lut_size_1; i++) {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

size_t

Copy link
Collaborator

@fanfare-ff fanfare-ff left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

@fanfare-ff fanfare-ff merged commit 1edfee4 into ShiegeChan:dev Jan 23, 2026
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

Successfully merging this pull request may close these issues.

[TASK] Port FSK demodulator from MATLAB to STM32 [TASK] Implement FSK Comms with MATLAB

2 participants