Skip to main content

MVBC Frame Transceiver Design: Manchester Encoding, CRC, and MVB

·2123 words·10 mins
MVB MVBC VxWorks Train Communication Network Manchester Encoding CRC FPGA Embedded Systems
Table of Contents

MVBC Frame Transceiver Design: Manchester Encoding, CRC, and MVB

๐Ÿš† Introduction to MVB and MVBC
#

With the evolution of embedded control systems and industrial fieldbus technologies, modern railway control systems have increasingly moved from centralized architectures toward distributed network-based control.

The Multifunction Vehicle Bus (MVB) is an important component of the Train Communication Network (TCN) defined by IEC 61375. Together with the Wire Train Bus (WTB), MVB provides a communication architecture designed for the demanding requirements of railway systems, including deterministic communication, high reliability, and real-time operation.

MVB is primarily used to connect programmable electronic equipment, sensors, actuators, and other onboard devices that require interoperable and deterministic communication. Although designed for railway applications, its architecture also makes it suitable for other industrial fieldbus applications.

The Multifunction Vehicle Bus Controller (MVBC) is the communication controller responsible for interfacing equipment with the MVB network. It abstracts much of the low-level communication processing from the application software and provides communication services independently of the specific physical-layer implementation.

Compared with earlier MVB controllers such as the BAP15-2/3 family, MVBC provides substantially enhanced processing and communication capabilities.

The MVBC communicates with the physical MVB bus through a bus adapter. According to the MVB communication specification, Manchester encoding is used for serial transmission, while an 8-bit CRC check value is associated with frame data.

MVB communication frames contain several fundamental elements:

  • Frame header or delimiter
  • Frame data
  • CRC check information
  • Frame trailer or end delimiter

Different frame types are distinguished by their frame headers.

Within the MVBC, the frame transceiver performs the low-level processing required to transmit and receive these frames. Its responsibilities include:

  • Frame transmission control
  • Frame reception control
  • Manchester encoding
  • Manchester decoding
  • CRC generation
  • CRC verification
  • Frame type identification
  • Error detection
  • Collision detection
  • Communication-memory interaction

Because the frame transceiver sits close to the physical interface and performs critical data-link processing, its design is one of the key challenges in implementing an MVBC.

๐ŸšŒ MVBC Architecture and Communication Flow
#

The MVBC can be configured for different device classes defined by the IEC TCN architecture, including Classes 1 through 4.

It can connect a wide range of onboard equipment, from programmable controllers to relatively simple sensors and actuators, with addressing capability extending to thousands of devices.

The controller performs several important data transformations.

During reception, serialized MVB signals are decoded and converted into parallel data bytes. During transmission, parallel data supplied by the controller is serialized and sent to the physical communication interface.

Depending on its configuration, the MVBC can operate as either a bus master or bus slave. It performs data-link-layer processing and selected transport-layer functions while communicating with higher-level software through shared communication memory.

Internally, the MVBC contains encoding and decoding circuits together with control logic for managing communication memory and frame processing.

Typical operations include:

  1. Detecting frame preambles and delimiters.
  2. Determining frame types.
  3. Receiving and shifting serial data.
  4. Generating CRC check information.
  5. Validating received CRC information.
  6. Detecting communication errors.
  7. Detecting bus collisions.
  8. Storing valid received data into communication memory.
  9. Preparing transmit data for serialization.

The resulting architecture allows application software to interact with communication memory while the hardware handles time-critical MVB protocol processing.

๐Ÿ”„ Frame Transceiver Architecture
#

The MVBC frame transceiver can be divided into several major functional blocks:

  • Manchester Encoder
  • Manchester Decoder
  • CRC Generator
  • CRC Checker
  • Frame Encoder
  • Frame Decoder
  • Transmission Control
  • Reception and Redundancy Control

Among these blocks, Manchester encoding/decoding and CRC processing form the fundamental low-level algorithms.

The overall transmission path can be summarized as:

Transmit Buffer
      โ†“
Frame Construction
      โ†“
CRC Generation
      โ†“
Manchester Encoding
      โ†“
MVB Physical Interface

The reception path operates in the reverse direction:

MVB Physical Interface
      โ†“
Manchester Decoding
      โ†“
Frame Identification
      โ†“
CRC Verification
      โ†“
Receive Buffer
      โ†“
Upper-Layer Processing

๐Ÿ“ก Manchester Encoding and Decoding
#

MVB uses Manchester encoding for serial communication. Each logical data bit is represented by two signal levels within a single bit period.

The encoding rules are:

  • Logical 1: high during the first half of the bit period, followed by low during the second half.
  • Logical 0: low during the first half, followed by high during the second half.

This guarantees a transition within every valid data bit and provides useful timing information to the receiver.

Special full-bit symbols can also be represented by continuous high or low levels. These symbols are not ordinary data and can be used for special protocol purposes such as frame delimiters.

Manchester Encoder
#

The Manchester encoder converts ordinary serial data into the corresponding Manchester waveform.

In the described implementation, serial data is shifted out on the rising edge of a 1.5 MHz clock. The data signal is then combined with the clock through an XOR operation.

Conceptually:

Serial Data
     โ”‚
     โ–ผ
Shift Register
     โ”‚
     โ”œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
     โ”‚              โ”‚
     โ–ผ              โ–ผ
                  XOR โ”€โ”€โ”€โ”€> Manchester Output
     โ–ฒ
     โ”‚
  1.5 MHz Clock

The resulting waveform satisfies the required Manchester encoding relationship between the input data and the physical signal transitions.

Manchester Decoder
#

The decoder performs the inverse operation. It must recover the original data while also determining whether the incoming waveform is valid.

The received Manchester signal first passes through multiple synchronization stages. In the described implementation, three synchronization registers are used to reduce the risk of metastability when sampling an asynchronous bus signal.

After synchronization, the decoder detects the beginning of a frame and establishes the sampling timing.

The Manchester bit period is divided into 16 sampling intervals using a counter. This provides several potential sampling points within each bit cell.

The decoder uses dedicated sample points for different purposes:

  • Data Sample Point 1: Determines the original data value.
  • Data Sample Point 2: Assists with frame header and trailer recognition.

The decoder also checks the waveform for protocol violations.

A valid Manchester bit should satisfy two basic conditions:

  1. The signal level remains consistent within each half-bit interval.
  2. The levels of the first and second halves of the bit are opposite.

If these conditions are violated, the decoder reports a coding error.

This mechanism is particularly important for detecting collisions or corrupted signals on the bus.

๐Ÿงฎ CRC Generation and Verification
#

CRC, or Cyclic Redundancy Check, is widely used in digital communication systems to detect transmission errors.

The MVBC performs CRC generation and verification directly in hardware, avoiding the need for software intervention during normal frame processing.

The generator polynomial used in the described design is:

G(x) = xโท + xโถ + xโต + xยฒ + 1

Several CRC implementation techniques are commonly used, including:

  • Bit-by-bit algorithms
  • Byte-oriented algorithms
  • Lookup-table implementations

For the serial MVB interface, a bit-oriented implementation is appropriate.

LFSR-Based CRC Implementation
#

The hardware CRC generator is implemented using a Linear Feedback Shift Register (LFSR).

The circuit consists primarily of:

  • Shift registers
  • XOR gates
  • Feedback paths

As each serial data bit enters the circuit, the LFSR updates its state according to the generator polynomial.

Conceptually:

Serial Data
     โ”‚
     โ–ผ
โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
โ”‚ Shift Registerโ”‚
โ”‚   + XOR       โ”‚
โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜
        โ”‚
        โ–ผ
   CRC State

The CRC checker uses a closely related structure. The main distinction is the position of the CRC processing relative to the shift register.

This hardware-based approach allows CRC processing to occur at line speed without consuming processor cycles.

๐Ÿ“ค Encoder Module Design
#

The Encoder is responsible for constructing and transmitting MVB frames.

Its primary functions include:

  1. Constructing frame headers.
  2. Constructing frame trailers.
  3. Generating CRC values.
  4. Reading frame data from the transmit buffer.
  5. Performing Manchester encoding.
  6. Transmitting master frames.
  7. Transmitting slave frames.
  8. Managing transmission state.

In Class 1 operation, the Encoder is controlled by the Class 1 control logic. In other configurations, control can be provided by the MCU or corresponding control modules.

When a frame is ready for transmission, the control logic provides information such as the frame type and length.

The Encoder then executes the transmission sequence:

Frame Ready
    โ†“
Identify Frame Type
    โ†“
Transmit Header
    โ†“
Shift Frame Data
    โ†“
Generate / Transmit CRC
    โ†“
Manchester Encode
    โ†“
Transmit Trailer
    โ†“
Transmission Complete

The Encoder therefore combines protocol-level frame construction with physical-layer serialization.

๐Ÿ“ฅ Decoder Module Design
#

MVB uses redundant communication media, so the MVBC must support redundant reception.

The implementation uses two Decoder instances associated with the two communication lines.

The two paths can be conceptually represented as:

             โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
MVB Line A โ”€โ”€โ–บ   Decoder A   โ”œโ”€โ”€โ”
             โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜  โ”‚
                                โ”œโ”€โ”€โ–บ Line Control
             โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”  โ”‚
MVB Line B โ”€โ”€โ–บ   Decoder B   โ”œโ”€โ”€โ”˜
             โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜

Each Decoder performs operations such as:

  • Start-bit detection
  • Manchester sampling
  • Manchester decoding
  • Serial-to-parallel conversion
  • Frame type identification
  • Frame length determination
  • CRC extraction
  • CRC verification
  • Reception status reporting

The active or trusted line is used as the primary source of received data, while the redundant line is monitored for consistency and fault conditions.

๐Ÿ” Redundancy and Line Switching
#

During initialization, one line is assigned as the trusted line while the other becomes the redundant monitoring line.

For example:

ICA โ†’ Trusted Line
ICB โ†’ Redundant Line

If the trusted line experiences a timeout, becomes silent, or is overridden by control logic, the roles can be exchanged:

ICB โ†’ Trusted Line
ICA โ†’ Redundant Line

This redundancy mechanism improves communication availability when one physical path experiences a fault.

During reception, both Decoder instances provide status information to the line-control logic, including:

  • Frame detected
  • Frame type
  • Frame completion
  • Reception validity
  • CRC result
  • Line status

The line-control module combines this information and passes the appropriate reception status and buffer-validity information to higher-level processing logic.

๐Ÿงช FPGA Verification Strategy
#

Verification of the MVBC bus-interface module focuses on validating the complete transmit and receive path under different operating conditions.

The test architecture connects the Encoder output to the Decoder input so that transmitted frames can be received and checked within the verification environment.

The basic verification sequence is:

Control Module
      โ”‚
      โ–ผ
Write Test Frame
into TxBuffer
      โ”‚
      โ–ผ
    Encoder
      โ”‚
      โ–ผ
Manchester Output
      โ”‚
      โ–ผ
    Decoder
      โ”‚
      โ–ผ
Write Received Data
into RxBuffer
      โ”‚
      โ–ผ
Control Module
      โ”‚
      โ–ผ
Compare Results

The verification environment monitors both Encoder and Decoder status signals while the test frame is transmitted.

After reception is complete, the control module reads the contents of the receive buffer and compares them against the original transmit data.

The following functions should be verified:

  • Manchester encoding correctness
  • Manchester decoding correctness
  • Frame header generation
  • Frame trailer generation
  • Frame type recognition
  • Frame length handling
  • Data transmission
  • Data reception
  • CRC generation
  • CRC verification
  • Invalid-frame detection
  • Collision/error detection
  • Redundant-line switching
  • Encoder/Decoder status reporting

This approach provides coverage from the physical encoding mechanism through complete frame-level communication.

๐Ÿ“Š Key Design Considerations
#

Several aspects are particularly important when implementing an MVBC frame transceiver in FPGA or ASIC logic.

Clock and Sampling Accuracy
#

Manchester decoding depends heavily on reliable timing. Dividing the bit period into multiple sampling intervals provides timing margin and allows the decoder to distinguish valid transitions from malformed signals.

Metastability Protection
#

The MVB interface is asynchronous relative to the internal processing clock. Multiple synchronization stages are therefore required before the incoming signal is consumed by synchronous logic.

Collision Detection
#

Manchester decoding is not merely a data-recovery operation. The decoder must also verify that the waveform obeys the expected Manchester transition rules. Violations can indicate collisions or communication errors.

Hardware CRC Processing
#

Implementing CRC using an LFSR allows the MVBC to process serial data at communication speed without requiring software calculations.

Redundant Communication Paths
#

The two-line architecture requires additional control logic to determine which physical line should be trusted and when the active and redundant paths should be exchanged.

Frame-Level State Machines
#

The Encoder and Decoder should maintain explicit protocol states for headers, data, CRC, trailers, errors, and completion conditions. This makes the implementation easier to verify and reduces ambiguity during abnormal communication conditions.

๐Ÿ“ Conclusion
#

The MVBC frame transceiver is a critical hardware component in the MVB communication architecture. It bridges the gap between the serial MVB physical interface and the parallel communication-memory interface used by the rest of the controller.

Its implementation combines several important digital-design techniques:

  • Manchester encoding and decoding
  • Serial data sampling
  • LFSR-based CRC generation
  • Hardware CRC verification
  • Frame construction and identification
  • Collision and coding-error detection
  • Redundant communication-line management
  • Hardware state-machine control

The Manchester encoder converts parallel or serial logical data into the required MVB waveform, while the decoder reconstructs the original data and validates the incoming signal. The CRC engine provides hardware-based error detection, and the Encoder and Decoder modules combine these mechanisms into complete master and slave frame transmission and reception paths.

FPGA-based loopback and functional verification can then validate the complete architecture by transmitting known frames through the Encoder, receiving them through the Decoder, and comparing the resulting data and status information against expected values.

Together, these techniques provide a practical architecture for implementing a reliable MVBC-MVB bus interface suitable for deterministic railway communication systems.

Related

Building an MVB Monitoring and Early-Warning Terminal with VxWorks and FPGA
·1436 words·7 mins
VxWorks FPGA MVB Rail Transit Train Communication Network Industrial Cybersecurity Embedded Systems PowerPC Real-Time Systems
Revisiting PCIโ€“RapidIO Bridge Driver Design on VxWorks: A 2026 Perspective
·1235 words·6 mins
VxWorks RapidIO PCI Device Drivers Embedded Systems DMA FPGA Interconnects
Common VxWorks Commands and Flash File System Operations
·1721 words·9 mins
VxWorks VxWorks Commands RTOS Embedded Systems Debugging Flash File System TFFS BSP