Wed, 12 Jul 2023 21:43:22 +0200
numworks: minor fixes
======================================= Numworks N0110 calculator full repair ======================================= :Author: David Douard :Category: Electronics :Tags: Numworks, N0110, repair, calculator :slug: numworks-lcd My daughter's `Numworks <https://www.numworks.com>`_ N0110 graphing calculator got fried when plugged in a cheap USB PSU. Black screen, heating up killing the battery in a matter of a few tens of minutes. The design being originally Open Source (hardware and firmware), it makes sense to try to fix it instead of just buying a new one (it is not a cheap calculator). The schematic is pretty simple: built around a `STM32F730V8T6 <https://www.st.com/en/microcontrollers-microprocessors/stm32f730v8.html>`_, there are only a few components surrounding the MCU: - an LCD (280x320, 2,8", ST7789V driver) driven using the 16 bits 8080 interface, taking advantage of ST's `FSMC <https://www.st.com/resource/en/product_training/STM32F7_Memory_FSMC.pdf>`_ controller, - 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, - LiPo charger (`RT9526AGE <https://www.richtek.com/Products/Battery%20Management/Single%20Cell%20Li-Ion%20Battery%20Charger/RT9526A?sc_lang=en&specid=RT9526A>`_), - `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, - LCD backlight DC-DC converter (`RT9365GQW <https://www.richtek.com/Products/LED%20Driver/White%20LED%20Driver/RT9365?sc_lang=en>`_) - 3 LEDs plus a number of passives, keypad, reset button, - LiPo battery, - USB port surge protection diodes (`USBLC6-2SC6 <https://www.st.com/en/protections-and-emi-filters/usblc6-2.html>`_) The list of fried devices was pretty much every active component: - MCU, - LCD, - 2.8v regulator, - USB protection diodes. Due to the global chip shortage, I had to gamble on Aliexpress to find a STM32F730. I bought one from `there <https://fr.aliexpress.com/item/1005004924466026.html>`_. Against all odds, the delivered chip looks genuine and is working properly. So I replaced the MCU and the 2.8v regulator. At this point, I wasn't sure about the status of the LCD. I did not know the USB protection diodes was dead, so uploading a firmware was quite a challenge; USB based DFU was not working (obvioulsy), but it was not obvious to understand why; I wasn't sure if a blank STM32 should enumerate ok as USB device, or if bootstrping a firmware was required before. I also did not want to upload Numworks' latest official firmware nor using their WebDFU tools since they changes their licensing policy and moved to a closed source model, official firmwares since version 16.3 now lock the bootloader to prevent custom or open source firmware from being installed. A complete explanation of this (in French) is `provided here <https://tiplanet.org/forum/viewtopic.php?f=97&t=25561>`_ So I started looking at the alternative firmware projects for the Numworks: `Omega <https://getomega.dev/install/latest>`_, `Phi <https://phi.getomega.dev/>`_, `Khi <https://www-fourier.univ-grenoble-alpes.fr/~parisse/nws.html>`_ and `Upsilon <https://lolocomotive.github.io/Upsilon-website/install>`_ (!) Plus starting from a blank STM32 instead of an upgrade from an existing installation added a bit of confusion. After some time I got convinced I had successfully uploaded a firmware, but noting showed up on the LCD: diagnostic of a dead LCD as well... The tricky part is that the LCD used in the calculator is pretty common on principle: standard size, usual LCD controller. The very one used in the calculator seems specificly made for the Numworks: specific ribbon cable and specific pinout. Could not find a compatible device on usual sources. To validate I did indeed have a successfully replaced the MCU and uploaded a working firmware, I did a nasty rastnest experiment with a ST7789V LCD module I had around. The result was pretty ugly .. image:: {static}/images/numworks/rastnest.jpg :alt: The test setup to connect a ST7789V based LCD module to the Numworks, using a breadboard to interconnect the 2 interfaces. :class: image-process-large-photo but I had *some* results: .. image:: {static}/images/numworks/partial.jpg :alt: The LCD module shows half a screen with some content mixed with garbage. :class: image-process-large-photo First I was thinking the issue could be related to the speed of the communications between the MCU and the LCD: the signal path was far from optimal, with a ribbon cable, a breakout board, a bus of 10cm jump wires, a breadboard, another bunch of 10cl jump wires, yet another bunch of jump wires, another breakboard, and at last, the ribbon cable of the LCD module... So I spent some time hacking the Omega source code to reduce the transmission speed; but that did not help. To figure out what was wrong I ended up using my DSLogic logic analyzer. The culprit was a pair of swapped jumpers (strangely there was only one pair of messed connections). Since it was a pair of data lines above D7, it was partially working. So the messed half display. With the 2 wires back in order, result was much better... .. image:: {static}/images/numworks/success.jpg :alt: The LCD module shows the Numworks main screen... but flipped :class: image-process-large-photo For some reason, this display showed the image reversed. Anyway, I was confident enough to spend a bit more money buying a replacemement LCD module. Choosing a suitable replacement was not an easy task: - It needs to use the ST7789V controller. - It needs to be the proper size; seems easy, it's a standard 2.8" module... well no, most of these modules are 66.95x47.80mm while the module in the calculator is 66x50mm. Also the thickness must be about 2.1 or 2.2mm max. - It needs to have the proper ST7789V signals available, 16bits 8080 mode; especially the Tearing Effect (TE) signal is used by the firmware to optimize display refresh timing. - It needs to be an "12 o'clock" IPS LCD module (not a TN one) so the viewing angle is adapted when used in the calculator. I found a few references on AliExpress (almost) matching all these contraints and bought `this one <https://fr.aliexpress.com/item/1005004628969756.html>`_. Which worked nicely: .. image:: {static}/images/numworks/test_ips_module.jpg :alt: The IPS module works just fine, the image is correctly oriented. :class: image-process-large-photo Obviously, the ribbon cable pinout is not the same as the original LCD module. So an adapter had to be made. At first I thought I could just solder a bunch of thin enameled wires, but this was not a very good idea; too hard to do properly, without damaging the ribbon cable etc. So I decided to try the new Flex PCB service JLCPCB (and others) now offer. Never did a Flex PCB design, was a nice opportunity to give it a try. I did a simple design, with one side being connected to 30 pins FCP connector on the Numworks side, and the other side with a 40pins FCP connecter soldered onto the Flex PCB. The design, printed on paper to check dimensions, looks like this: .. image:: {static}/images/numworks/flex_design.jpg :alt: Paper print of the flex-PCB adapter. :class: image-process-large-photo The flex-PCB arrived a few days later: .. image:: {static}/images/numworks/flex_pcb.jpg :alt: Flex-PCB adapter side-to-side with the paper print. :class: image-process-large-photo Was not sure how it would support hand soldering the FCP connector, but it went ok. .. image:: {static}/images/numworks/flex_pcb_connected.jpg :alt: Flex-PCB adapter installed in the Numworks. :class: image-process-large-photo It fits pretty nicely in the Numworks enclosure; the only modification I had to make it to trim a bit some plastic pads to fit and center le LCD module. .. image:: {static}/images/numworks/repaired.jpg :alt: The Numworks fully reassembled running the Omega firmware. :class: image-process-large-photo The Kicad design for the Flex-PCB is available `here <https://git.sr.ht/~douardda/numworks-lcd-adapter>`_.