Hi everyone,
I’ve released an open-source protocol analyzer for decoding HDLC/SDLC frames on NEMA TS2 and ATC traffic signal communications: GitHub - wxinix/SdlcAnalyzer: A Saleae Logic 2 protocol analyzer for decoding HDLC/SDLC frames, with support for external clock synchronization used in NEMA TS2 and ATC traffic signal communications. · GitHub
Why I built this
The built-in Saleae HDLC analyzer doesn’t work for NEMA TS2 / ATC SDLC traffic. It only supports an internal baud-rate-derived sampling clock, which causes progressive drift on true synchronous protocols
where data must be sampled on edges of an external clock signal provided by the controller. The result: garbled frames, wrong CRC checks, and phantom abort sequences — making it unusable for traffic signal
fieldwork.
What this analyzer adds
- Bit Synchronous (External Clock) mode — samples the data line on edges of a physical clock channel, eliminating sampling drift entirely
- NRZ data encoding — NEMA TS2 single-ended RS-485 probing uses NRZ, not NRZI as standard SDLC assumes
- Data polarity inversion — handles the opposite polarity between TxData+ and RxData+ when probing single-ended on the RS-485 + wire
- Full HDLC frame decoding — Address (basic/extended), Control (modulo 8/128/32768/2G), Information, and FCS fields
- CRC verification — CRC-8, CRC-16-CCITT, and CRC-32 with pass/fail indication
- CSV export with timestamped frames
Typical setup for NEMA TS2
Connect to the TS2 Type AB (EIA-485) port and run two analyzer instances — one for Tx (command frames from the controller) and one for Rx (response frames from the field device). The only difference between
them is the Invert Data setting due to opposite RS-485 polarity on the + wire.
- NEMA TS2: 153,600 bps
- ATC: 614,400 bps
Implementation
Written in C++23 with modern patterns — CRTP mixins, compile-time CRC table generation via constexpr, fold-expression serialization, declarative pattern matching, and monadic guard chaining. Builds cleanly
with zero warnings on MSVC, GCC 13+, and Clang 16+.
Links
Feedback and contributions welcome. If you work with traffic signal controllers and have been struggling with the stock HDLC analyzer, give this a try — it should just work out of the box for TS2 and ATC.
