content/numworks-lcd.rst

changeset 149
5ce5f3046c0b
child 150
8eb94ab1fa43
child 151
c851522149f5
equal deleted inserted replaced
148:2f87039dd0b5 149:5ce5f3046c0b
1 ==========================
2 Numwork N0110 calculator
3 ==========================
4
5 :Author: David Douard
6 :Category: Electronics
7 :Tags: Numworks, N0110, repair, calculator
8
9
10 My daughter's `Numwork <https://www.numworks.com>`_ N0110 graphing calculator
11 got fried when plugged in a cheap USB PSU. Black screen, heating up killing the
12 battery in a matter of a few tens of minutes.
13
14 The design being originally Open Source (hardware and firmware), it makes sense
15 to try to fix it instead of just buying a new one (it is not a cheap
16 calculator).
17
18 The schematic is pretty simple: built around a `STM32F730V8T6 <https://www.st.com/en/microcontrollers-microprocessors/stm32f730v8.html>`_, there are
19 only a few components surrounding the MCU:
20
21 - an LCD (280x320, 2,8", ST7789V driver) driven using the 16 bits 8080
22 interface, taking advantage of ST's `FSMC <https://www.st.com/resource/en/product_training/STM32F7_Memory_FSMC.pdf>`_ controller,
23
24 - a 64MB flash (`AT25SF641 <https://www.renesas.com/us/en/products/memory-logic/non-volatile-memory/spi-nor-flash/at25sf641-64mbit-27v-minimum-spi-serial-flash-memory-dual-io-support>`_) to store apps and user data,
25
26 - LiPo charger (`RT9526AGE <https://www.richtek.com/Products/Battery%20Management/Single%20Cell%20Li-Ion%20Battery%20Charger/RT9526A?sc_lang=en&specid=RT9526A>`_),
27
28 - `RT9078 <https://www.richtek.com/Products/Linear%20Regulator/Single%20Output%20Linear%20Regulator/RT9078?sc_lang=en&specid=RT9078>`_ 2.8V voltage regulator to poser the MCU from the LiPo battery,
29
30 - LCD backlight DC-DC converter (`RT9365GQW <https://www.richtek.com/Products/LED%20Driver/White%20LED%20Driver/RT9365?sc_lang=en>`_)
31
32 - 3 LEDs plus a number of passives, keypad, reset button,
33
34 - LiPo battery,
35
36 - USB port surge protection diodes (`USBLC6-2SC6 <https://www.st.com/en/protections-and-emi-filters/usblc6-2.html>`_)
37
38
39 The list of fried devices was pretty much every active component:
40
41 - MCU,
42
43 - LCD,
44
45 - 2.8v regulator,
46
47 - USB protection diodes.
48
49
50 Due to the global chip shortage, I had to gamble on Aliexpress to find a
51 STM32F730. I bought one from `there <https://fr.aliexpress.com/item/1005004924466026.html>`_. Against all odds, the delivered chip
52 looks genuine and is working properly.
53
54 So I replaced the MCU and the 2.8v regulator. At this point, I wasn't sure
55 about the status of the LCD. I did not know the USB protection diodes was dead,
56 so uploading a firmware was quite a challenge; USB based DFU was not working
57 (obvioulsy), but it was not obvious to understand why; I wasn't sure if a blank
58 STM32 should enumerate ok as USB device, or if bootstrping a firmware was
59 required before.
60
61 I also did not want to upload Numworks' latest official firmware nor using
62 their WebDFU tools since they changes their licensing policy and moved to a
63 closed source model, official firmwares since version 16.3 now lock the
64 bootloader to prevent custom or open source firmware from being installed.
65 A complete explanation of this (in French) is `provided here <https://tiplanet.org/forum/viewtopic.php?f=97&t=25561>`_
66
67 So I started looking at the alternative firmware projects for the Numworks:
68 `Omega <https://getomega.dev/install/latest>`_, `Phi
69 <https://phi.getomega.dev/>`_, `Khi
70 <https://www-fourier.univ-grenoble-alpes.fr/~parisse/nws.html>`_ and `Upsilon
71 <https://lolocomotive.github.io/Upsilon-website/install>`_ (!) Plus starting
72 from a blank STM32 instead of an upgrade from an existing installation added a
73 bit of confusion.
74
75
76 After some time I got convinced I had successfully uploaded a firmware, but
77 noting showed up on the LCD: diagnostic of a dead LCD as well...
78
79 The tricky part is that the LCD used in the calculator is pretty common on
80 principle: standard size, usual LCD controller. The very one used in the
81 calculator seems specificly made for the Numworks: specific ribbon cable and
82 specific pinout. Could not find a compatible device on usual sources.
83
84 To validate I did indeed have a successfully replaced the MCU and uploaded a
85 working firmware, I did a nasty rastnest experiment with a ST7789V LCD module I
86 had around.
87
88 The result was pretty ugly
89
90 .. image:: {static}/images/numworks/rastnest.jpg
91 :alt: The test setup to connect a ST7789V based LCD module to the Numworks,
92 using a breadboard to interconnect the 2 interfaces.
93 :class: image-process-large-photo
94
95 but I had *some* results:
96
97 .. image:: {static}/images/numworks/partial.jpg
98 :alt: The LCD module shows half a screen with some content mixed with garbage.
99 :class: image-process-large-photo
100
101
102 First I was thinking the issue could be related to the speed of the
103 communications between the MCU and the LCD: the signal path was far from
104 optimal, with a ribbon cable, a breakout board, a bus of 10cm jump wires, a
105 breadboard, another bunch of 10cl jump wires, yet another bunch of jump wires,
106 another breakboard, and at last, the ribbon cable of the LCD module... So I
107 spent some time hacking the Omega source code to reduce the transmission speed;
108 but that did not help.
109
110 To figure out what was wrong I ended up using my DSLogic logic analyzer. The
111 culprit was a pair of swapped jumpers (strangely there was only one pair of
112 messed connections). Since it was a pair of data lines above D7, it was
113 partially working. So the messed half display.
114
115 With the 2 wires back in order, result was much better...
116
117 .. image:: {static}/images/numworks/success.jpg
118 :alt: The LCD module shows the Numworks main screen... but flipped
119 :class: image-process-large-photo
120
121 For some reason, this display showed the image reversed. Anyway, I was
122 confident enough to spend a bit more money buying a replacemement LCD module.
123
124 Choosing a suitable replacement was not an easy task:
125
126 - It needs to use the ST7789V controller.
127
128 - It needs to be the proper size; seems easy, it's a standard 2.8" module...
129 well no, most of these modules are 66.95x47.80mm while the module in the
130 calculator is 66x50mm. Also the thickness must be about 2.1 or 2.2mm max.
131
132 - It needs to have the proper ST7789V signals available, 16bits 8080 mode;
133 especially the Tearing Effect (TE) signal is used by the firmware to optimize
134 display refresh timing.
135
136 - It needs to be an "12 o'clock" IPS LCD module (not a TN one) so the viewing
137 angle is adapted when used in the calculator.
138
139 I found a few references on AliExpress (almost) matching all these contraints
140 and bought `this one <https://fr.aliexpress.com/item/1005004628969756.html>`_.
141
142 Which worked nicely:
143
144 .. image:: {static}/images/numworks/test_ips_module.jpg
145 :alt: The IPS module works just fine, the image is correctly oriented.
146 :class: image-process-large-photo
147
148 Obviously, the ribbon cable pinout is not the same as the original LCD module.
149 So an adapter had to be made. At first I thought I could just solder a bunch of
150 thin enameled wires, but this was not a very good idea; too hard to do
151 properly, without damaging the ribbon cable etc. So I decided to try the new
152 Flex PCB service JLCPCB (and others) now offer. Never did a Flex PCB design,
153 was a nice opportunity to give it a try.
154
155 I did a simple design, with one side being connected to 30 pins FCP connector
156 on the Numworks side, and the other side with a 40pins FCP connecter soldered
157 onto the Flex PCB.
158
159 The design, printed on paper to check dimensions, looks like this:
160
161 .. image:: {static}/images/numworks/flex_design.jpg
162 :alt: Paper print of the flex-PCB adapter.
163 :class: image-process-large-photo
164
165 The flex-PCB arrived a few days later:
166
167 .. image:: {static}/images/numworks/flex_pcb.jpg
168 :alt: Flex-PCB adapter side-to-side with the paper print.
169 :class: image-process-large-photo
170
171 Was not sure how it would support hand soldering the FCP connector, but it went
172 ok.
173
174 .. image:: {static}/images/numworks/flex_pcb_connected.jpg
175 :alt: Flex-PCB adapter installed in the Numworks.
176 :class: image-process-large-photo
177
178 It fits pretty nicely in the Numworks enclosure; the only modification I had to
179 make it to trim a bit some plastic pads to fit and center le LCD module.
180
181 .. image:: {static}/images/numworks/repaired.jpg
182 :alt: The Numworks fully reassembled running the Omega firmware.
183 :class: image-process-large-photo
184
185
186 The Kicad design for the Flex-PCB is available `here <https://git.sr.ht/~douardda/numworks-lcd-adapter>`_.

mercurial