1
|
from analog: SSC_DATA, CARRIER (via PLL)
|
2
|
to analog: MOD
|
3
|
|
4
|
MOD on PA17 (SSC TD, out), PA23 (PWM0, out)
|
5
|
SSC_DATA on PA18 (SSC RD, in), PA27 (TIOB2, in)
|
6
|
FRAME on PA20 (SSC RF, in)
|
7
|
|
8
|
CARRIER (T5) on PA28 (TCLK1, in)
|
9
|
CARRIER_DIV_HELP (T3) on PA0 (TIOA0, out), PA29 (TCLK2, in)
|
10
|
(TF) on PA26 (TIOA2, out), PA15 (SSC TF, in)
|
11
|
|
12
|
SSC_CLOCK (T4) on PA1 (TIOB0, out), PA19 (SSC RK, in)
|
13
|
|
14
|
|
15
|
MOD: pure output, to modulation circuitry
|
16
|
* either fed from SSC transmitter
|
17
|
* or fed from PWM
|
18
|
SSC_DATA: pure input, from demulation circuitry
|
19
|
* goes to SSC receiver
|
20
|
* goes to tc_fdt as external event (TIOB2)
|
21
|
FRAME: set on any edge in SSC_DATA, reset by SSC_DATA_CONTROL (out)
|
22
|
* goes to SSC receiver as frame signal
|
23
|
|
24
|
CARRIER: pure input, from PLL
|
25
|
* goes to tc_cdiv and tc_fdt as XC1 (TCLK1)
|
26
|
CARRIER_DIV_HELP: internal signal, does ???
|
27
|
* comes from tc_cdiv (TIOA0)
|
28
|
* goes to tc_cdiv as XC2 (TCLK2)
|
29
|
TF: internal signal, transmission start
|
30
|
* comes from tc_fdt (TIOA2)
|
31
|
* goes to SSC transmitter as frame signal
|
32
|
|
33
|
SSC_CLOCK: internal signal, transceiver clock
|
34
|
* comes from tc_cdiv (TIOB0)
|
35
|
* goes to SSC transmitter and receiver as clock signal
|
36
|
|
37
|
tc_cdiv: XC1=TCLK1 (in), TIOB0 (out), TIOA0 (out), XC2=TCLK2 (in)
|
38
|
TC0 enabled
|
39
|
XC1 = TCLK1, XC2 = TCLK2
|
40
|
TC0: Clock from XC1, Wave mode, WAVSEL=2 (up auto)
|
41
|
TIOA0: RA compare = set, RC compare = clear, swtrg = clear
|
42
|
TIOB0: eevent = set, RB compare = clear, swtrg = clear
|
43
|
eevent: XC2, external trigger on rising edge
|
44
|
RA = 1, RB = 1 + divider/2, RC = divider
|
45
|
|
46
|
i.o.w: when CV = 0 (either through swtrg or through RC compare) then TIOA0 and TIOB0 are clear
|
47
|
TIOA0 is set on RA compare (at CV=1+phase), is connected to XC2 (through TCLK2) and therefore triggers the external event which sets TIOB0
|
48
|
TIOB0 is cleared at RB compare (at CV=1+divider/2+phase)
|
49
|
that means: Compare A sets TIOB and Compare B clears TIOB, Compare C is fixed at the divisor value, Compare A and B are divisor/2 apart, yielding an exact 50% duty cycle with a variable phase shift (offset from CV=0)
|
50
|
this trick is necessary because TIO{A,B} can't be directly affected by Compare {B,A}, so when using only one TIO you can either get a fixed duty cycle with zero offset compared to CV=0, or a variable offset yielding a variable duty cycle
|
51
|
|
52
|
tc_fdt: TIOA2 (out), TIOB2 (in), XC1=TCLK1 (in)
|
53
|
TC2 enabled
|
54
|
TC2: Clock from XC1, Wave mode, WAVSEL=0 (up)
|
55
|
TIOA2: RA compare = set, RC compare = clear, eevent = clear
|
56
|
TIOB2: eevent = nothing, RB compare = nothing
|
57
|
eevent: TIOB2, external trigger on falling edge, clock started and enabled on external trigger
|
58
|
clock stopped on RC compare
|
59
|
RC = 0xffff, RB = frame_end_set, RA = fdt_set
|
60
|
|
61
|
|