comparison DUART28-PPD-surprise @ 72:2ac10b2cde4f

DUART28-PPD-surprise article written
author Mychaela Falconia <falcon@freecalypso.org>
date Mon, 19 Jul 2021 05:01:15 +0000
parents
children
comparison
equal deleted inserted replaced
71:bf7a0c2b2b50 72:2ac10b2cde4f
1 DUART28 partial power-down surprise behaviour
2 =============================================
3
4 FreeCalypso DUART28 adapter was specifically designed to handle partial
5 power-down scenarios as gracefully as possible. There are two possible PPD
6 scenarios:
7
8 1) USB host is connected (USB power present), but the connected Calypso device
9 is in the switched-off state in the Iota VRPC sense. This condition occurs all
10 the time in standard FreeCalypso workflows.
11
12 2) The connected Calypso device is up and running, but there is no USB host
13 connected. This scenario is practically relevant only when the Calypso device
14 is equipped with LCD and keypad peripherals and runs handset firmware that is
15 capable of untethered operation.
16
17 As we have learned through experience with Caramel2 boards, PPD scenario 1
18 would be best handled on the Calypso device side by inserting an LVC buffer
19 powered from Calypso V-IO into Calypso input signal paths, rather than on the
20 USB adapter side. However, for already existing Calypso boards which don't have
21 any such LVC buffers, DUART28 provides some improvement over the alternatives:
22 current feeding into powered-down Calypso inputs is reduced to 1.27 mA per pin,
23 and the outputs from the adapter are 2.8V rather than 3.3V.
24
25 For PPD scenario 2 (which matters for Caramel2 in the Luna configuration) we
26 were hoping that the combination of LVC input and output buffers on the DUART28
27 side and UART data line pull-up resistors on the Caramel2 side would do the
28 trick, and produce the graceful behaviour we were after. Unfortunately though,
29 this PPD scenario does not work as well in practice as we hoped for at design
30 time.
31
32 DUART28 design includes pull-up resistors to the adapter's 2.8V rail in front of
33 all 6 LVC input buffers. These pull-up resistors are there to keep these LVC
34 inputs from floating (and thus propagating garbage, possibly even rapidly
35 oscillating garbage, to FT2232D inputs) in the following scenarios:
36
37 1) PPD scenario 1;
38
39 2) Even more importantly, partial connection scenarios. DSR input is currently
40 expected to be almost always unconnected, as none of our Calypso devices except
41 GTM900 feature DSR outputs; RI input is likewise connected only very rarely
42 (only available on Caramel2 and requires a separate wire connection), and there
43 is no DCD output on FCDEV3B, causing DCD input to be unconnected as well when
44 working with FCDEV3B.
45
46 However, these pull-up resistors create a nasty surprise in PPD scenario 2:
47 current from Calypso outputs flows in the reverse direction through these
48 pull-up resistors into the powered-down DUART28 adapter's P_2V8 rail, enough
49 power flows into that rail to power up the other LVC buffer serving adapter
50 outputs, those outputs drive low because the inputs coming from FT2232D are
51 powered-down low, and the inputs to Calypso UARTs become low instead of high.
52 Calypso UARTs apparently don't like it when their RxD inputs are continuously
53 low (break condition), and all Calypso sleep modes are disabled as the result.
54 The lack of sleep becomes visible on Caramel2 with the yellow STATUS LED
55 remaining lit continuously, rather than flashing with sleep-wake activity as it
56 does in expected normal operation.
57
58 What is incredible about this erratic behaviour scenario is how little power it
59 takes to turn on the LVC buffer serving adapter outputs. With 3 out of 4
60 Calypso outputs driving high, the maximum total current that can flow through
61 the 3 100 kOhm resistors that stand in the way is 84 uA. The voltage measured
62 at the P_2V8 circuit node in this condition is about 1.22 V, i.e., out of the
63 2.8 V put out by Calypso, about 1.6 V drops across the 100 kOhm resistors (thus
64 it seems that only about 16 uA flows through each resistor), and the unlucky
65 74LVC541A buffer IC gets powered up with just 48 uA at 1.22 V. In this erratic
66 condition, the outputs of this buffer IC drive low strongly enough to overpower
67 the 100 kOhm pull-ups on Calypso inputs, and those latter inputs sense low
68 instead of high.
69
70 Measuring voltages at other circuit nodes in this state, we see that P_5V rests
71 at about 0.89 V - we are seeing reverse leakage through the 2.8V LDO regulator,
72 from its output to its input. However, P_3V3 (the output of the other LDO
73 regulator) rises to no more than 8 mV - thankfully, not enough power comes in
74 through these back paths to turn on another separate LDO, and no spurious resets
75 are triggered via the 74LVC2G07 boot control circuit.
76
77 Possible solutions
78 ==================
79
80 There are two general approaches we can take:
81
82 1) We can create DUART28 V2 with a more complex design for these pull-ups:
83 perhaps we can insert diodes somewhere to block the reverse current flow through
84 pull-up resistors, or seeing that P_3V3 is not powered on by this erratic back
85 feeding, we could add a third separate LDO regulator just for these pull-ups.
86
87 2) We can just live with this defect, as it is not particularly serious.
88
89 It is worth noting that the erratic behaviour in question occurs ONLY in PPD
90 scenario 2, and this PPD scenario is relevant ONLY for Caramel2+Luna setups:
91 not for FCDEV3B, and not for Caramel2 used in a modem configuration. Given how
92 few FC community members are expected to work with Luna, and given that we have
93 a large surplus of unsold DUART28 boards, a simple solution would be to issue
94 two DUART28 boards to every community member who works with Luna, keep one board
95 unmodified (all 6 input pull-up resistors intact per the original design), and
96 modify the other board for Caramel2+Luna configuration.
97
98 If a DUART28 adapter board is to be modified specifically for C2+Luna, the
99 modification will consist of removing 4 0402 discrete resistors: R11, R12, R14
100 and R16. These are pull-up resistors on RxD, CTS, DCD and RxD2 inputs - these
101 4 signals are the ones driven from Caramel2+Luna to DUART28. OTOH, the other
102 two pull-up resistors for DSR and RI need to remain: there is no DSR output on
103 Caramel2, and Calypso GPIO1 (which could otherwise be RI) is made inaccessible
104 by Luna cabling.
105
106 A DUART28 adapter board that has been modified in this manner should be used
107 only with Caramel2 and not with FCDEV3B. (Connecting FCDEV3B would result in a
108 floating LVC buffer input propagating garbage to FT2232D DCD input, which is
109 bad.) Furthermore, even with Caramel2 (with or without Luna) certain user
110 behaviours will need to be adjusted when using a sans-pull-up DUART28 adapter:
111 specifically, all operations with fc-loadtool (flashing), fc-iram (miscellaneous
112 run-from-RAM programs) and fc-xram (FFS editor) need to be performed through the
113 secondary UART (the one that carries RVTMUX with running firmware), rather than
114 the primary UART that carries the main AT command channel. In contrast, the
115 ttyUSB device corresponding to the primary UART should only be opened when the
116 Calypso+Iota chipset is switched on and the firmware is running. The reason
117 for these user guidelines is that when a modified-DUART28 ttyUSB port is opened
118 while the Calypso+Iota chipset is switched off, FT2232D inputs will be receiving
119 garbage. The primary UART channel has flow control and modem control signals,
120 whereas the secondary UART is data leads only - thus the Linux host will see
121 less bogosity on the latter.