Skip to content

Custom firmware for the popular amateur ATS-20 Receiver, fixing the common audio pop/click issue and adding an (FM-AM-SSB-CW) Favorites list (no RDS) and more. Based on Goshante ATS_EX.

License

Notifications You must be signed in to change notification settings

diqezit/ats20_ats_ex

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

ATS-20+ Firmware Modifications (diqezit's Fork)

Firmware ATS-20+ Status: active Top language Last commit

This repository is a fork of the original goshante/ats20_ats_ex firmware, dedicated to custom modifications, bug fixes, and new features. All discussion regarding these new versions should take place here.

Your feedback and suggestions are welcome! Please, put a star on the repository to raise the firmware higher up on the global list. Thanks :)

You can find the original project here: goshante/ats20_ats_ex


Key Modifications

This fork introduces two main branches of improvements over the original firmware:

  1. Audio Pop/Click Elimination (Hardware & Software Mod): A modification that completely removes pops and clicks when switching modes. It requires a minor physical change to the receiver circuit.
  2. MOD_NO_RDS Firmware Series: An alternative firmware branch where the RDS feature was removed to free up program space (from first modifications). This enabled the addition of new functionality, most notably a unified Favorites system for all bands (AM, FM, SSB, CW), along with dozens of other fixes and improvements in code.

Important: This audio improvement only affects the speaker output, as the headphone jack is connected before the amplifier.

I strongly recommend to connect the voltage divider as close to the pin as possible - use for this a two - 10kOm resistors. In order to eliminate possible interference with ADC readout distortion

Diagram showing how to connect the pins

Font, moving elements on the screen have been changed since version 5.0 - if you want to use the old mapping - use version 4.11 without long term support.

GET 4.11

V4.11

General interface view in version 4.11

Interface v4.11

v5.x

Key interface changes in the 5.x versions

Main Screen
Main Screen v5.x
Settings Screen
Info Screen v5.x

v6.x

Screen examples in the 6.x versions

SSB Mode
SSB Mode
Favorites List
Favorites List
Full Screen Layout
Full Screen Layout
Settings Menu
Settings Menu

Firmware Installation

This guide explains how to upload the firmware to your ATS-20(+) receiver using a Windows PC and the xLoader software

Step 1: Download the Necessary Files

You will need two things: the programming software and the correct firmware file

  1. Programming Software:

    • Download xLoader (Click the green "Code" button, then "Download ZIP". Extract the files to a folder on your computer)
  2. Firmware File (.hex):

    • For flashing via USB, you only need the file without the bootloader
    • Click here to download: ATS_EX.ino.eightanaloginputs.hex (Click the link, then find the "Download raw file" button)

📌 Which File Should I Use?

  • The ATS_EX.ino.eightanaloginputs.hex file is the correct one for updating your receiver's firmware over a standard USB connection using xLoader
  • The ATS_EX.ino.with_bootloader.hex file is an advanced file used only for programming with an external ISP programmer (like a USBasp). Do not use this file with xLoader for a standard USB update
  • Link for advanced users: With_bootloader

Step 2: Install Drivers (If Needed)

Most ATS-20(+) receivers use a CH340 chip for USB communication. If your computer does not recognize the receiver when you plug it in, you must install the driver. This is a one-time setup

  • Download and install the CH340 driver from a reliable source, such as SparkFun's Guide

Step 3: Connect the Receiver

  • Connect your ATS-20+ receiver directly to a USB port on your PC
  • Power on the receiver

Step 4: Find the COM Port

  • Open Device Manager in Windows (you can search for it in the Start Menu)
  • Expand the "Ports (COM & LPT)" section
  • Note the COM port number assigned to your receiver (e.g., COM3, COM4). If no port appears, verify your driver installation and USB cable

Step 5: Configure xLoader and Upload

  1. Launch xLoader.exe from the folder where you extracted it

  2. Configure the settings precisely as follows:

    • Hex file: Click the ... button and select the ATS_EX.ino.eightanaloginputs.hex file you downloaded
    • Device: Select Duemilanove/Nano(ATmega328). This is correct for most ATS-20+ boards, which use an old bootloader
    • COM Port: Select the port number you found in Device Manager
    • Baud rate: Set to 57600

    Your settings should look like this:

    xLoader Correct Settings

Step 6: Start the Upload

  1. Click the Upload button
  2. The receiver's lights may flash during the process. Wait for it to complete
  3. xLoader will display a message like "29xxx bytes uploaded" at the bottom of the window when finished
  4. Your receiver should restart automatically with the new firmware. If the screen shows "EEPROM RST" on the first boot, this is normal

Installation is complete!


Troubleshooting Tips

  • Upload Fails or Times Out: Double-check that you have selected the correct COM port and that no other software (like a serial monitor) is using it. Try a different USB cable or port
  • Still Fails: Some boards require you to press and release the receiver's RESET button just a moment before you click the "Upload" button in xLoader
  • Using an Arduino Uno Board Profile: If your receiver has a newer bootloader (like an official Arduino Uno), you may need to select Uno(ATmega328) as the Device and 115200 as the Baud rate. However, 57600 is correct for the vast majority of ATS-20+

ATS-20+ EX Firmware - The Complete User Guide

This manual provides a comprehensive overview of the ATS-20+ EX firmware's features and controls.

Table of Contents

  1. Core Concepts: Understanding the Interface
  2. Section 1: Main Screen Operations
  3. Section 2: Advanced Reception Controls
  4. Section 3: System Functions
  5. Section 4: Maintenance & Support
  6. Section 5: Experimental Features
  7. Quick Reference Button Chart

1. Core Concepts: Understanding the Interface

The firmware's UI is based on the "Active Command" paradigm. This model allows the encoder to serve multiple purposes without complex menus.

  • Default State: By default the encoder knob controls the frequency.
  • Active Command: A short press on VOL+ STEP BW or BAND+ makes that function the "Active Command". The corresponding UI element becomes inverted and the encoder knob temporarily controls that function.

Example: Changing Volume

  1. Short-press VOL+. The volume value becomes inverted.
  2. Rotate the encoder to set the desired level.
  3. Short-press the encoder button to exit immediately or simply wait 3 seconds for it to time out. The encoder will then revert to controlling the frequency.

Section 1: Main Screen Operations

1.1. Power Management & Screen Control

  • Screen Off Mode: A short press on the AGC button toggles the screen's power. The receiver continues to operate with minimal power drain significantly extending battery life.
  • Wake Screen: If the screen is off (either manually or by timeout) press any button to wake it. The first press only reactivates the screen and does not trigger any other action.

1.2. Frequency Tuning & Step Control

  • Tuning Step Selection:
    1. Short-press STEP. The "STEP" value on the display will be highlighted.
    2. Rotate the encoder to select the desired step size.
    3. Short-press the encoder button to confirm and exit or wait for the timeout.

1.3. Volume Control & Mute

  • Quick Adjustment: Short-press VOL+ then rotate the encoder.
  • Continuous Adjustment: Press and hold VOL+ or VOL-.
  • Mute: Short-press VOL- to toggle mute. The volume level is replaced by " M".

1.4. Band Navigation

  • Quick Jump: Short-press BAND+ then rotate the encoder to jump between pre-defined bands.
  • Seamless Tuning: Tune past the edge of the current band to automatically switch to the adjacent one. Note: This applies between AM/SW bands; tuning past the SW band edge will not roll over into the FM band.

1.5. Mode Switching (AM/SSB/CW)

  • Short-press MODE to cycle through reception modes: AMLSB/USBCWAM. This function is disabled on FM bands.

Section 2: Advanced Reception Controls

2.1. SSB Mode Operation

  1. Enter SSB Mode: Use the MODE button until LSB or USB is displayed.
  2. Sideband Selection: Press and hold the BW button for 1-2 seconds to switch between LSB and USB.
  3. Two-Stage Tuning: SSB requires a two-stage process for clear audio:
    • Coarse Tune (Frequency): Select a large step (e.g. 1 kHz 5 kHz). Tune the main frequency until you hear intelligible but still high or low-pitched audio.
    • Fine-Tune (Clarifier): Select a small step (e.g. 10 Hz 50 Hz). Now tuning only adjusts the audio pitch to make voices sound natural without changing the main frequency.
  4. Sync Feature: While in SSB mode press and hold the MODE button to toggle the Sync feature. An S indicator will appear when active. This engages the DSP's Automatic Frequency Control (AFC) to compensate for signal drift reducing fading and distortion.

2.2. CW (Morse Code) Mode Operation

  1. Enter CW Mode: Use the MODE button to select CW.
  2. CW Sideband: Press and hold BW to switch the reception sideband (L for LSB U for USB). This is a tool to eliminate nearby interference. The receiver will automatically adjust the frequency to keep the audible tone consistent.
  3. Tuning: The receiver's CW pitch is adjustable via CWP setting (500-800 Hz). Tune the main frequency until the Morse code signal's tone matches the selected pitch. Tip: Use a narrow BW filter (e.g. 0.5 kHz) in CW mode to isolate the signal.

2.3. Bandwidth (BW) Filter Adjustment

  1. Short-press the BW button.
  2. Rotate the encoder to change the filter width.
    • Narrower (e.g. 1.8 kHz): Rejects adjacent channel interference improving clarity in crowded bands.
    • Wider (e.g. 4.0 kHz): Provides better audio fidelity on strong clear signals.

Section 3: System Functions

3.1. Station Scanning

  • Enable First: In the Settings Menu (BAND-) set the SCN item to On.
  • Start/Stop Scan: In AM or FM mode short-press the encoder button to start scanning. Press any button to stop.
  • Scan Behavior: The receiver will scan within the current band boundaries (or full SW range for shortwave bands) using predefined seek thresholds optimized for each mode.

3.2. Favorites Management

This feature saves a complete station profile: frequency, mode (AM/LSB/USB/CW/FM), and the precise BFO offset for SSB/CW signals. The system supports up to 20 favorite stations across all bands.

  • To Save a Station:

    1. Tune to any station and adjust it for optimal reception (including fine-tuning the pitch in SSB/CW).
    2. Press and hold AGC. A "SAVED" confirmation will appear on the screen.
    3. Note: The system prevents saving duplicate entries (same frequency and mode).
  • To Access and Use the Favorites List:

    1. Press and hold STEP to open the Favorites menu.
    2. Navigate: Rotate the encoder to scroll through your saved stations (3 stations per page).
    3. Tune: Highlight the desired station and short-press the encoder button. The receiver will instantly reconfigure itself to match all the favorite's saved parameters.
    4. Delete: To remove a station, highlight it in the list and press the BW button.
    5. Exit: To close the menu without tuning, short-press STEP. The menu also closes automatically after 10 seconds of inactivity.

3.3. The Settings Menu: A Deep Dive

The Settings Menu provides access to all advanced receiver configurations. Think of it as your control center for fine-tuning the radio's behavior to match your listening preferences and conditions.

How to Access:

  • Enter: Short press BAND- button
  • Exit: Short press BAND- again, or wait 10 seconds for auto-exit
  • Important: All changes are automatically saved to EEPROM when you exit

Menu Structure:

  • 5 pages with 6 settings each (30 settings total)
  • Settings are arranged in a 2×3 grid on each page
  • Current page number shown in header (e.g., "SETTINGS 1|5")

Navigation & Editing:

  1. Select Item: Rotate the encoder to move between settings
    • Movement pattern depends on NAV setting (row-wise or column-wise)
  2. Enter Edit Mode: Short-press the encoder button
    • A > marker appears next to the value
    • The setting is now ready to be changed
  3. Change Value: Rotate the encoder while in Edit Mode
  4. Confirm: Short-press encoder again to save and exit Edit Mode
  5. Switch Pages: Short-press BAND+ to cycle through pages

💡 Beginner's Tip: Start with default values and change one setting at a time to understand its effect. You can always perform a factory reset if needed.

⚠️ Important Mode Display: Settings that are not applicable to the current operating mode will display as "---" instead of their value. This visual indicator helps you quickly identify which settings are active in your current mode, simplifying the configuration process.

📝 Mode-Dependent Settings: ATT, AVC, and SMA store different values for AM, LSB, and USB modes. When you switch modes, these values automatically change to match the current mode's stored settings.


Page 1: Core Audio & RF (Essential audio and reception controls)

Name Detailed Description Recommended Values Mode Availability Type Range
ATT Attenuator/AGC (Automatic Gain Control)
Controls how the receiver handles signal strength. Think of it as "sunglasses" for the radio.
AUT: The radio automatically adjusts its sensitivity. This is the best setting for 99% of situations.
Manual values (1..37 for AM, 1..26 for FM): Disables automatic control and applies a fixed amount of signal reduction (attenuation).
When to use manual values: Only if a very powerful local station sounds distorted or "crackly". Start with a value of 5 and increase if needed.
Mode-dependent: Saved separately for AM/LSB/USB.
Default: AUT
Strong locals: 5-15
Weak signals: AUT
All modes Selection AUT, 1..37
AVC Automatic Volume Control
Levels the volume between weak and strong stations. Think of it as a TV's "night mode" that boosts quiet dialogue.
0: Weakest effect. Preserves the natural volume difference between stations. Best for high-fidelity listening.
10: Strongest effect. Makes very quiet, distant stations sound almost as loud as strong local ones. Best for DXing.
Interaction with ATT: This works with ATT. If you apply manual attenuation (ATT > 0), you'll need a higher AVC value to compensate.
Mode-dependent: Saved separately for AM/LSB/USB.
AM Broadcast: 2-4
SSB/DXing: 8-10
Hi-Fi Audio: 0-2
AM/SSB/CW only
"---" in FM
Number 0..10
SQL Squelch Level
Silences the receiver until a signal exceeds this strength (AM mode only).
0: Always open (hear everything including noise)
60: Only very strong signals break through
Use case: Set to 15-25 to eliminate noise between stations while tuning.
Default: 0
Quiet tuning: 15-25
All modes Number 0..60
SMA AM Soft Mute Attenuation
How much to reduce volume on weak/noisy signals (in dB).
0: No muting (hear all noise)
32: Maximum muting (very quiet on weak signals)
Tip: Start with 10-16 for pleasant listening without losing weak stations.
Mode-dependent: Separate for AM/LSB/USB
Default: 0
Recommended: 10-16
AM/SSB/CW only
"---" in FM
Number 0..32
SMT AM Soft Mute SNR Threshold
Signal quality level that triggers soft mute.
• Lower values (0-20): Only mute very noisy signals
• Higher values (40-63): Mute anything below excellent quality
Balance: Use 15-25 with SMA=10-16 for good results.
Default: 0
Balanced: 15-25
AM/SSB/CW only
"---" in FM
Number 0..63
ANB AM Noise Blanker
Digital filter that removes clicking/popping interference.
Helps with: Power line noise, electric fences, car ignitions
Note: May slightly affect audio quality - turn off for music listening.
Default: Off
Urban areas: On
AM/SSB/CW only
"---" in FM
Switch On / Off

Page 2: SSB & CW (Single Sideband and Morse Code settings)

Name Detailed Description Recommended Values Mode Availability Type Range
BFO Beat Frequency Oscillator Calibration
Corrects frequency drift caused by component aging.
• Each step = 100 Hz correction
• Positive values: Increase displayed frequency
• Negative values: Decrease displayed frequency
Usage: If ALL SSB stations sound too high/low pitched on a specific band, adjust this.
Important: Saved per band (28 separate values).
Default: 0
Typical drift: ±5
AM/SSB/CW only
"---" in FM
Number -25..+25
SSM SSB Soft Mute
Reduces noise between SSB transmissions.
RSS: Mutes based on signal strength
SNR: Mutes based on signal-to-noise ratio
Tip: SNR mode works better for weak signal work.
Default: SNR
DXing: RSS
SSB only
"---" in AM/FM/CW
Switch RSS / SNR
SVC SSB Automatic Volume Control
Stabilizes audio level on fading SSB/CW signals.
When ON: Reduces fading effects but may pump on noise
When OFF: Natural signal dynamics, better for strong signals
Default: On
Weak signals: On
Local QSOs: Off
SSB only
"---" in AM/FM/CW
Switch On / Off
COF SSB Audio Cutoff Filter
Removes low-frequency rumble and noise.
AUT: Automatically matches filter to bandwidth
1: Mild filtering (fuller audio)
2: Aggressive filtering (cleaner but thinner audio)
Try: Use 2 for noisy bands, 1 for local contacts.
Default: AUT
Noisy bands: 2
SSB only
"---" in AM/FM/CW
Selection AUT, 1, 2
SYN SSB Sync (AFC)
Automatically tracks drifting SSB signals.
Pros: Reduces need to retune, handles fading better
Cons: Can lock onto wrong signal or noise
Best for: Stable broadcast stations, not recommended for ham bands.
Default: Off
Broadcast: On
Ham bands: Off
SSB only
"---" in AM/FM/CW
Switch On / Off
CWP CW Pitch
The audio tone frequency for Morse code signals.
Personal preference: Most operators prefer 600-700 Hz
Tip: Match this to your transmitted sidetone if you're a ham operator.
Default: 600
Common: 600-700
AM/SSB/CW only
"---" in FM
Selection 500, 600, 700, 800 Hz

Page 3: FM & Advanced Audio (FM reception and audio processing)

Name Detailed Description Recommended Values Mode Availability Type Range
DE FM De-Emphasis
Must match your region's broadcast standard for proper audio.
75 µs: North & South America, South Korea
50 µs: Europe, Asia, Africa, Australia
Wrong setting: Audio will sound too bright or too dull.
USA: 75
Europe: 50
FM only
"---" in AM/SSB/CW
Selection 50 / 75 µs
FMP FM Audio Profile
Tailors frequency response for your listening setup.
On: Reduces treble for internal speaker (warmer sound)
Off: Flat response for headphones/external speakers
Try both: The difference is quite noticeable.
Speaker: On
Headphones: Off
FM only
"---" in AM/SSB/CW
Switch On / Off
FMO Force Mono
Disables stereo decoding on FM.
Benefits: 10-20dB noise reduction on weak stations
Drawback: Loses stereo separation
Use when: Station is barely receivable in stereo.
Default: Off
Weak signals: On
FM only
"---" in AM/SSB/CW
Switch On / Off
FSA FM Soft Mute Attenuation
Volume reduction on weak FM signals (in dB).
Higher values: Quieter background when tuning
Lower values: Hear weak stations better
Sweet spot: 15-20 for most users.
Default: 22
DXing: 0-10
Casual: 15-22
FM only
"---" in AM/SSB/CW
Number 0..31
FST FM Soft Mute Threshold
Signal level that triggers FM soft mute.
Lower (0-5): Only mute very weak signals
Higher (10-15): Aggressive muting for quiet tuning
Tip: Pair with FSA for best results.
Default: 10
Balanced: 8-10
FM only
"---" in AM/SSB/CW
Number 0..15
SWA Shortwave AFC (AM mode, SW bands only)
Helps track drifting AM broadcast stations.
OFF: No correction (best for amateur radio)
PPM: Standard correction window
Hz1: ±1600Hz pull range (normal)
Hz2: ±2000Hz pull range (aggressive)
Warning: Turn OFF for SSB/CW listening!
Default: OFF
Broadcast: Hz1
SSB/CW: OFF
AM/SSB/CW only
"---" in FM
Selection OFF, PPM, Hz1, Hz2

Page 4: Display & UI (User interface and display settings)

Name Detailed Description Recommended Values Mode Availability Type Range
SCR Screen Brightness
OLED display brightness control.
1-3: Night/dark room use
4-6: Indoor daylight
7-10: Bright conditions
Battery tip: Lower brightness significantly extends battery life.
Indoor: 4-6
Night: 2-3
Daylight: 7-9
All modes Number 1..10
SPT Signal Meter Display
How signal strength is shown.
RSS: Raw RSSI number (0-99)
SNR: Traditional S-meter (S0 to S9+60)
Ham operators: Usually prefer SNR
SWLs: RSS gives more resolution.
Note: Display only, not available in SSB/CW modes.
Default: RSS
Hams: SNR
All modes Switch RSS / SNR
SWU Shortwave Units
Frequency display format for SW bands.
kHz: 14205 kHz (traditional)
MHz: 14.205 MHz (modern)
Preference: Purely cosmetic - choose what you're used to.
Traditional: kHz
Modern: MHz
AM/SSB/CW only
"---" in FM
Switch kHz / MHz
DIS Display Auto-Off Timer
Saves battery by turning off screen after inactivity.
Radio keeps playing with screen off!
Wake up: Press any button
Good practice: Use 10-15 minutes for battery savings.
Default: OFF
Battery save: 10m or 15m
All modes Selection OFF, 10m, 15m, 30m, 60m
RSI RSSI Polling in AM
Off (enabled): Normal RSSI updates
On (disabled): Stops RSSI polling to prevent clicks
Only change if: You hear clicking sounds every second in AM mode.
Default: Off
If clicks: On
AM/SSB/CW only
"---" in FM
Switch On (disabled) / Off (enabled)
NAV Menu Navigation Pattern
How encoder moves through settings.
ROW: Left→Right then down (like reading)
COL: Top→Bottom in columns (traditional)
Try both: ROW is usually faster for accessing items.
Default: ROW
Traditional: COL
All modes Switch ROW / COL

Page 5: Hardware Configuration (Hardware-specific adjustments)

Name Detailed Description Recommended Values Mode Availability Type Range
CAP Antenna Tuning Capacitor
Internal capacitor for antenna matching.
On: Better for random wire, whip antennas
Off: Better for 50Ω antennas, external tuners
Test both: See which gives stronger signals with your antenna.
Wire antenna: On
50Ω antenna: Off
All modes Switch On / Off
CPU Processor Speed
Trade-off between performance and battery life.
100% (16MHz): Snappy UI response
50% (8MHz): ~30% longer battery, slightly slower UI
Note: Radio performance is identical at both speeds.
AC power: 100%
Battery: 50%
All modes Selection 100% / 50%
BAP Battery Monitor Pin
Selects which analog pin reads battery voltage.
Standard boards: A1
Some clones: A2
How to test: Battery % should show realistic values.
Most boards: A1 All modes Selection A1 / A2
SCN Encoder Button Function
What happens when you short-press the encoder.
On: Start frequency scanning
Off: Open step size menu (classic)
Preference: Scanning is convenient for finding active stations.
Recommended: On All modes Switch On / Off
FVA FM Volume Compensation
Reduces FM volume to match AM/SSB levels.
Problem: FM broadcasts are often much louder
Solution: Set to 5-10 to balance volume across modes
Fine-tune: Adjust until mode switches don't require volume changes.
Default: 0
Typical: 5-10
All modes Number 0..15

🔧 Quick Setup Guide for New Users:

  1. First time: Leave most settings at defaults
  2. Set your region: Adjust DE (FM De-emphasis) for your location
  3. Optimize display: Set SCR (brightness) for your environment
  4. For weak signals: Enable AVC=5, SMA=12, SMT=20
  5. For headphones: Set FMP=Off
  6. Save battery: Set CPU=50% and DIS=15m

📝 Settings Memory:

  • Global settings: Saved once for entire radio
  • Mode-dependent: ATT, AVC, SMA saved separately per mode
  • Band-specific: BFO calibration saved per band (28 values)
  • Auto-save: Changes saved to EEPROM when exiting menu

📌 Key Technical Notes:

  • Mode-Dependent Settings: ATT, AVC, and SMA values are stored separately for AM, LSB, and USB modes. The displayed value changes automatically when you switch modes.
  • Band-Specific BFO: The BFO calibration is saved individually for each of the 28 bands, allowing precise crystal drift compensation per frequency range.
  • Soft Mute Systems: AM and FM use completely independent soft mute implementations with different parameter ranges (SMA/SMT for AM, FSA/FST for FM).
  • SW AFC: The SWA setting only activates on Shortwave bands (1.7-30 MHz) while in AM mode. It helps track drifting broadcast stations but should be disabled for SSB/CW.
  • Navigation Styles: The NAV setting affects only the Settings menu navigation, not the main screen or Favorites list.
  • Mode Indicators: Settings showing "---" are not functional in the current mode, helping you focus on relevant parameters only.

Section 4: Maintenance & Support

4.1. Factory Reset (EEPROM Reset)

This procedure resets all settings, band states, and clears all saved favorites to factory defaults.

  1. Power the receiver off.
  2. Press and hold the encoder button.
  3. While holding the button, power the receiver on.
  4. The screen will display "EEPROM RESET". The reset is complete.

Alternative Method: If the encoder button is faulty, you can perform a reset by holding the AGC button during power-on instead.


Section 5: Experimental Features

5.1. CW (Morse Code) Decoder (Experimental)

⚠️ IMPORTANT: This feature requires hardware modification and disabling Favorites (ENABLE_FAVORITES 0) due to memory constraints (requires ~30KB flash).

The firmware includes an experimental CW decoder using a fixed-point Goertzel algorithm for real-time Morse code to text conversion directly on the OLED display.

Technical Implementation:

  • Algorithm: Narrowband Goertzel detector (N=128 samples)
  • Reference: Internal 1.1V ADC reference for improved weak signal detection
  • Adaptive timing: Automatic WPM tracking (5-60 WPM range)
  • Display: 6 lines of decoded text with automatic scrolling
  • Input: Analog pin A6 with AC coupling

Required Hardware Modification:

Connect speaker output to A6 with proper biasing:

  • AC Coupling: 2.2 µF capacitor in series with audio signal
  • Bias Network:
    • R1: 390 kΩ from +3.48V to A6 (470 kΩ also acceptable, provides ~0.5V bias)
    • R2: 75 kΩ from A6 to GND
    • This creates optimal DC bias for the 1.1V internal reference

Circuit Diagram: CW Decoder Circuit

Operation Guide:

  1. Enable in firmware: Set ENABLE_CW_DECODER 1 and ENABLE_FAVORITES 0 in Defines.h before compiling
  2. Setup:
    • Switch to CW mode
    • Set CWP (CW Pitch) in settings to match expected tone (600-700 Hz recommended)
  3. Activate decoder: Long-press MODE button to enter decoder view
  4. Display shows:
    • Header: "CW DECODER" with live WPM reading
    • Main area: Decoded text (auto-scrolls after 6 lines)
  5. Exit: Press any button to return to normal display

Performance Characteristics:

  • Optimal reception: 600 Hz tone at 25-30 WPM
  • Pitch options: 500, 600, 700, 800 Hz (selectable via CWP setting)
  • Adaptive tracking: Automatically adjusts to speed variations
  • Best results with:
    • Stable signals (S5 or stronger)
    • Narrow bandwidth filter (0.5-1.0 kHz)
    • Minimal QRM/QRN

Known Limitations:

  • Requires clean audio signal (affected by noise and fading)
  • May struggle with hand-sent code with irregular timing
  • Cannot decode overlapping signals

Alternative Solution: For professional-grade decoding performance:

  • Android App: Morse Expert by VE3NEA
  • Provides superior algorithm, adjustable filters, and logging capabilities

Test Signal: For decoder testing at 600Hz, 30WPM try: A A A A A / T T T T T / E E E E E / N A N A N A / PARIS PARIS PARIS

Additional Technical Details:

Signal Processing Chain:

  • ADC Sampling: Continuous sampling at ~71.4 Hz block rate (14ms per block)
  • DC Offset Tracking: Adaptive high-pass filter with 256-sample time constant
  • Goertzel Bins: Pre-computed coefficients for bins 0-32 (Q14 fixed-point)
  • Signal Detection: Dual-filter envelope tracking:
    • Fast envelope: Immediate response for tone detection
    • Slow noise floor: 64-sample time constant for baseline estimation
    • Hysteresis margin: Dynamic threshold with 3dB separation

Morse Timing Engine:

  • Dot length: Adaptive from 2-6 blocks (28-84ms)
  • Dash/Dot ratio: ITU standard 3:1 with tolerance for hand-keying
  • Letter gap: 1.5× dot length
  • Word gap: 4.5× dot length
  • Symbol timeout: 140ms auto-flush for incomplete characters

Decoder Features:

  • Character set: Full alphabet (A-Z), numbers (0-9), slash (/)
  • Pattern matching: 5-bit packed lookup table for efficient memory use
  • Adaptive speed tracking:
    • Smoothing factor: 7/8 old + 1/8 new (prevents jitter)
    • WPM display updates every 5 decoded symbols
    • Speed range: 5-60 WPM with automatic adjustment

Memory Optimization:

  • Buffer size: 128 samples (int16_t) for Goertzel processing
  • Lookup table: 36 bytes for Morse patterns (compressed format)
  • State machine: 24 bytes total for decoder state
  • Display buffer: Direct write to OLED (no frame buffer)

Debug Mode: (When DEBUG_CW 1)

  • Serial output at 9600 baud showing:
    • ADC range and DC offset
    • Detected dots/dashes with timing
    • Envelope and noise floor levels
    • Real-time WPM calculations

Hardware Notes:

  • Why A6: This pin has no digital functions, dedicated ADC input
  • Voltage divider values: Creates ~0.55V DC bias (center of 1.1V range)
  • Capacitor value: 2.2µF provides -3dB at ~7Hz (blocks DC, passes audio)
  • Input impedance: ~465kΩ (set by bias network)

Quick Reference Button Chart

(Applies when on the main listening screen)

Button Short Press (Tap) Long Press (Hold 1-2 sec)
MODE Cycle Mode (AMSSBCW) Toggle Sync (SSB only) or CW Decoder (CW only)
STEP Activate Step selection Open/Close Favorites Menu
BW Activate Bandwidth selection Switch Sideband (SSB/CW only)
BAND+ Activate Band selection Cycle bands up continuously
BAND- Open/Close Settings Menu Cycle bands down continuously
VOL+ Activate Volume control Increase volume continuously
VOL- Toggle Mute Decrease volume continuously
AGC Toggle Screen Power On/Off Save Current Station to Favorites
Encoder Activate Step OR Start Scan (depends on SCN setting) (No function)

If you encounter difficulties with the new versions, you can temporarily roll back and download the version you like best using:

https://github.com/diqezit/ats20_ats_ex/archive/<commit_hash>.zip

Where <commit_hash> is copied from the list of commits at: https://github.com/diqezit/ats20_ats_ex/commits/mod_no_rds/

This way you will get the firmware archive of the desired version.

Thank you.

About

Custom firmware for the popular amateur ATS-20 Receiver, fixing the common audio pop/click issue and adding an (FM-AM-SSB-CW) Favorites list (no RDS) and more. Based on Goshante ATS_EX.

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • C 57.5%
  • C++ 42.5%