Router's LCD and keypad interfaced to Arduino

 Author:   Posted on:   Updated on:  2018-10-06T15:29:59Z
A router with display is not something you see everyday. That’s why when I saw two such routers that were discarded I bought them. At that time I had absolutely no idea if I could install an open source firmware on them (such as OpenWrt). I didn’t even know what type of display do they use. Currently, there is no way of installing a 3rd party firmware on those devices. But the front panel of the router can be interfaced to a microcontroller (only a specific hardware version).

The devices I’m talking about are SerComm SHG1500 routers, used for ADSL internet. They are based on Broadcom BCM6361 SoC and, although this platform is supported by OpenWrt, a specific build for this device or a way to upgrade firmware isn’t known. So I gave up this idea. But upon opening the case, the front panel with LCD display looked like a module that could be used for my projects. The LCD is color TFT, 2.8” size. Next to it there is a capacitive keypad with 5 keys. Front panel plugs into main board using a 2x15 pins, 1.27 mm pitch connector. It seemed good enough to start gathering information.

SerComm SHG1500 front panel with LCD and capacitive keypad
SerComm SHG1500 front panel with LCD and capacitive keypad
Throughout this post I will attempt to identify various connectors and parts needed to use the front panel (the LCD and keypad) without the router. I do not attempt to make any changes to the device firmware. From what I have seen the router seems to work without the front panel (at least the web interface, LAN and WiFi are working). But if you use it for services from your ISP, opening the case is forbidden by contract.

I said earlier I own two pieces of this router model. Both main boards are visually identical. This isn’t true for the front panel circuitry too. First of all, let’s identify some ports on the main board.

Serial port and keypad I2C port
Serial port and keypad I2C port
The ports from the above photo are located near the SoC (which is covered by a heatsink). J302 is a serial port. You can see its output in a serial terminal configured for 115200 8N1. It doesn’t respond to if you send data to it. Voltage levels are 3.3V. Pinout is similar to serial ports on other SerComm devices (see below). Next to it is JP7, a port thought by some to be JTAG. Using a multimeter as continuity tester, I learned this is an I2C port for the capacitive keypad. But it is not used on the boards I have because the lines from JP7 are contained by J3, the big connector for the front panel.
Pinout of serial and I2C port
Pinout of serial and I2C port
If you flip the board on the other side you can see the front panel connector. It is a 2x15 female pinheader with 1.27mm pitch. The pinheader is labeled as JP3 and JP4. We can see that it includes a possible 2x5 connector labeled JP8.

Front panel connector - a 2x15 female pinheader
Front panel connector - a 2x15 female pinheader
Since I had two routers, my first idea was to switch the front panels. I found out the LCD displays were by no means compatible. The keypad worked however. So I looked for other differences. Besides different versions of firmware, my routers were different hardware versions. The SerComm SHG1500 (LCDv3, WiFi-RFv3) had an FPGA on the front panel PCB. This is driving the LCD display. Looking at the second router, it was SerComm SHG1500 (LCDv6, WiFi-RFv3), with a slightly newer firmware version and a completely different front panel PCB. While the former had a quite populated PCB with PFGA, RAM and some other circuitry, this one had an almost empty board with tracks going straight from main board connector to LCD connector.

I’ve only been able to control LCDv6 with a development board. The LCD on v6 is manufactured by Truly (you will see TRULY® printed on FPC connector). Information in this post only applies to this display and front panel type. I don’t have enough information to use the FPGA driven LCD yet (by the way, that one is manufactured by Giantplus).

In an attempt to identify the pinout of the front panel connector I used a logic analyzer. Although I set my $5 analyzer to its maximum sample rate (24MHz) I wasn’t able to get a readable protocol for the display. I guess it’s SPI though (this was later confirmed). The FPGA board used a serial protocol too. It could still be SPI, but data stream is probably different.

Without other information about LCD screens (no datasheets available) I focused on what I could use: the keypad. It is on a different PCB fitted into the front panel PCB using a pinheader of 9 pins (1 mm pitch). The keypad IC has “8646” printed on it. I found out it is Semtech SX8646 [Ultra Low Power, Capacitive Button Touch Controller (8 sensors) with Enhanced LED Drivers]. The datasheet is available from manufacturer’s website.

At this point I had a partial pinout of the front panel connector. But without information about LCD it was useless. Months passed. Until somebody got and made public the GPL source code for this router.

A document inside the archive lists all open source packages used for this router. I now knew that Disko UI framework was used for display and that SerComm driver for Truly LCD was named HX8347I. This was huge. The name of the library is the name of the controller IC used by LCD. Note that the same file mentions HX8347B driver for HHG1500, a similar router from Huawei. For both controllers there are Arduino libraries, but from what I’ve seen the modified UTFT library for the -I version configures the LCD with different parameters. When writing my own software, I will definitely use register values from the source code of the router.

Looking in the sources it seems some files are missing (probably not GPL code). They seem to be mixing Truly LCD with FPGA LCD, making me believe that FPGA emulates HX8347I (an early version, LCDv3 emulates the protocol of an IC that would be used in a future version, LCDv6 – didn’t seem very probable). Code for SX8646 doesn’t exist, although the IC is mentioned in some configuration files.

When sampling various pins of the front panel connector with the logic analyzer I noticed a strange transmission on one of the pins. C source for LCD confirmed the signal was for backlight control. I now have a – still partial, but working – pinout of the front panel.

Front panel connector pinout
Front panel connector pinout
The grayed pins are not needed for proper operation of this version of the panel. 1.25 V and 1.8 V are used by FPGA LCD board but not by this one. UNKW pins showed no changes on logic analysis. The front panel needs 5V to power LCD backlight and LEDs behind capacitive keys. Everything else is using 3.3V (and so are the signal lines levels). LCD is driven with pins 4 (SPI slave select, active low), 3 (SPI clock), 6 (SPI data) and 15 (reset, active low). Backlight is configured on pin 18. The capacitive keypad is an I2C slave device that pulls low pin 25 to generate an interrupt at host when a key is touched. Then it sends I2C data on pin 26 when host generates I2C clock on pin 27. Pin 11, when pulled low turns on the power LEDs (4 red LEDs in a row).

The pinout above is for the male connector on front panel board. The female connector on main board has it mirrored since the front panel plugs into it. Testing with the 1.27 mm pitch connector was difficult so I built my own adapter. I removed the female connector on main board and placed it on a home made adapter PCB. Now I have 2.54 mm pinheaders and I can plug the front panel even into the breadboard.

2.54mm to 1.27mm pinheader adapter for front panel
2.54mm to 1.27mm pinheader adapter for front panel
Software development is done on a 3.3V development board. I will choose between ESP8266 NodeMcu and STM32 blue pill. Both can be programmed with Arduino API.

Initial measurements with something displayed on LCD revealed about 12mA current on 3.3V line and 125mA on 5V line (current drawn by LEDs).

Initial test of front panel on breadboard, driven by STM32 bluepill
Initial test of front panel on breadboard, driven by STM32 bluepill
In the above photo I used my home made breadboard power supply for 3.3V because I didn't know what current draw to expect. The STM32 blue pill is programmed with Arduino IDE via ST-Link.

Posts explaining in detail how to control the backlight, display on LCD and read key touches will be published in the future.

Links

No comments :

Post a Comment

Please read the comments policy before publishing your comment.