|
7 | 7 | .program differential_manchester_tx
|
8 | 8 | .side_set 1 opt
|
9 | 9 |
|
10 |
| -; Transmit one bit every cycles. In each bit period: |
| 10 | +; Transmit one bit every 16 cycles. In each bit period: |
11 | 11 | ; - A '0' is encoded as a transition at the start of the bit period
|
12 | 12 | ; - A '1' is encoded as a transition at the start *and* in the middle
|
13 | 13 | ;
|
|
16 | 16 |
|
17 | 17 | public start:
|
18 | 18 | initial_high:
|
19 |
| - out x, 1 side 1 ; Start of bit period: always assert transition |
20 |
| - jmp !x high_0 [6] ; Test the data bit we just shifted out of OSR |
| 19 | + out x, 1 ; Start of bit period: always assert transition |
| 20 | + jmp !x high_0 side 1 [6] ; Test the data bit we just shifted out of OSR |
21 | 21 | high_1:
|
22 |
| - jmp initial_high side 0 [7] ; For `1` bits, also transition in the middle |
| 22 | + nop |
| 23 | + jmp initial_high side 0 [6] ; For `1` bits, also transition in the middle |
23 | 24 | high_0:
|
24 | 25 | jmp initial_low [7] ; Otherwise, the line is stable in the middle
|
25 | 26 |
|
26 | 27 | initial_low:
|
27 |
| - out x, 1 side 0 ; Always shift 1 bit from OSR to X so we can |
28 |
| - jmp !x low_0 [6] ; branch on it. Autopull refills OSR for us. |
| 28 | + out x, 1 ; Always shift 1 bit from OSR to X so we can |
| 29 | + jmp !x low_0 side 0 [6] ; branch on it. Autopull refills OSR for us. |
29 | 30 | low_1:
|
30 |
| - jmp initial_low side 1 [7] ; If there are two transitions, return to |
31 |
| -low_0: ; initial_low on the next bit. If just one, |
| 31 | + nop |
| 32 | + jmp initial_low side 1 [6] ; If there are two transitions, return to |
| 33 | +low_0: |
32 | 34 | jmp initial_high [7] ; the initial line state is flipped!
|
33 | 35 |
|
34 | 36 | % c-sdk {
|
|
0 commit comments