USART Manchester Encoding and other USART features

Hi everyone,

Has anyone here managed to set the DUE USART ports to Manchester Encoding? If I understand this correctly, the MCU supports this natively which would make that the most elegant way to implement this.

Same question for other USART features as sending "Break" signals and so on. How do I access the USART registers to do this?

Kind regards,


You will find most everything about Manchester Encoder explained in section 35 of Sam3x datasheet.

Before using e.g. USART2, you will have to Power ON USART2 with the PMC peripheral, and affect output pins to USART2.

Extracts from Sam3x datasheet:

page 782: Manchester Encoder When the Manchester encoder is in use, characters transmitted through the USART are encoded based on biphase Manchester II format. To enable this mode, set the MAN field in the US_MR register to 1. Depending on polarity configuration, a logic level (zero or one), is transmitted as a coded signal one-to-zero or zero-to-one. Thus, a transition always occurs at the midpoint of each bit time. It consumes more bandwidth than the original NRZ signal (2x) but the receiver has more error control since the expected input must show a change at the center of a bit cell. An example of Manchester encoded sequence is: the byte 0xB1 or 10110001 encodes to 10 01 10 10 0101 01 10, assuming the default polarity of the encoder. Figure 35-8 illustrates this coding scheme.


Then program US_MAN accordingly: USART2->US_MAN = …..

page 793: Transmit Break …… A break is transmitted by writing the Control Register (US_CR) with the STTBRK bit to 1.


And idem for Manchester decoder. Page 786: Manchester Decoder When the MAN field in US_MR register is set to 1, the Manchester decoder is enabled. The decoder performs both preamble and start frame delimiter detection. One input line is dedicated to Manchester encoded input data. ....

You can test RS232 with Manchester encoder/decoder within a single DUE board by altering US_CR and US_MAN accordingly respectively in USART0 (Serial1) and USART1(Serial2) in this example sketch (hook a jumper wire between RX1 and TX2 and between TX1 and RX2) :

[char c = 0;
void setup() {



void loop() {
  String s;
  s = "";

  while (Serial1.available() > 0) {
    c =;
    s += c;

  if (s.length() > 0) {