Encoding Flowchart

First, the USART and CCL should be initialized to encoding state. Then prepare Manchester data and enable USART DRE interrupt. Manchester code is sent inside the Interrupt Service Routine. The flowchart is shown in the figure below.

Figure 1. Flowchart