Skip to content
This repository has been archived by the owner on Jun 23, 2023. It is now read-only.

Bafang LCD SW102

Kevin Hester edited this page Aug 10, 2019 · 20 revisions

Table of Contents

SW102 LCD is a 64x128 pixels monochrome graphic LCD with Bluetooth. It is produced by Topology Tech and it can be bought on many online shops as the "Bafang LCD SW102".

How to open the LCD

Although seems it is not possible to open this LCD without breaking/deform it, it is easy to access to the board that has the firmware programming/debug pads. Please work carefully and slowly, referring frequently to these instructions:

Leave the Up/Down keypad lid and the M button lid in place.

Cut in between the cases edge and keypad and repeating this over and over again until you can lift of the key pad by gently levering it out. You will need to run a shop knife repeatedly from left to right and top to bottom on the bottom three sides of the keypad. Don't cut in between LCD and keypad because it is very likely that the glass will break.

It helps to hold the bottom part of the case in a vice (not too tightly) so you can cut without hurting yourself or the plastic.

Cutting along the right:

Cutting along the left:

Cutting along the bottom:

After about 10 passes on each of the three sides you will feel the pressure increase because you are through the glue and now just scraping on the plastic.

At that point take a very small screwdriver (or other flat implement) and slide it vertically down into the bottom edge of the case. Try to put it about 25% in from the left side and press pretty firmly down so you can push between the bottom part of the keypad and the case. It is important to notice that the keypad comes in two parts - the top movable part with the buttons and the bottom rigid part. You want to pry only on that bottom part (see photo of the keypad below so you understand). You can pry the bottom part of the keypad up with slight but constant pressure until the remaining glue begins to unpeel. If it isn't going well, either cut some more or try prying up on the bottom edge about 25% in from the right side.

Once the keypad begins to lift you can insert a second small screwdriver on the other side of the bottom edge to help the glue release. After the keypad is mostly out, gently pull it from the screen and the glue between it and the screen should release. Do not insert anything between the screen and the keypad or you risk breaking wires or the glass.

IMPORTANT: Notice how the keypad has a top and a bottom part. Pry up (gently) ONLY on that bottom part. Your tiny screwdriver will be pressed down between the bottom part of the keypad and the side of the case, then you will slightly pry it up to get the glue to release.

You will find the firmware programming/debug pads under the keypad plastic cover. At this point it is a good time to scrape off any remaining glue, so that when you later go to reglue the keypad (use a TINY amount of glue) you'll have a good flat base. If you leave too much old glue in, you'll find the bottom button is hard to push. Probably best to test that before reglueing the unit.

The front glass and LCD are glued, there is no way to open without breaking the case. I had to heat the plastic case and deform it until I could get the boards and LCD exposed.

Board

There are 2 boards. The main board is the smaller one that has the NRF51 microcontroller and the bluetooth antenna. This board connects the the LCD board using a flat cable. The LCD boards seems to have all the circuit for the power and LCD control.

Integrated ICs

nRF51822-QFAC

16MHz ARM Cortex-M0, 256 KBytes flash memory and 32 KBytes RAM memory.

Package: QFN48 (48 pins).

Bluetooth Low Energy and 2.4 GHz SoC The nRF51822 is a general purpose, ultra-low power SoC ideally suited for Bluetooth® Low Energy and 2.4 GHz proprietary wireless applications. It is built around the 32-bit ARM® Cortex™-M0 CPU with 256/128 KB flash and 32/16 KB RAM. The flexible 2.4 GHz radio supports Bluetooth Low Energy and 2.4 GHz proprietary protocols, such as Gazell.

It incorporates a rich selection of analog and digital peripherals that can interact directly without CPU intervention through the Programmable Peripheral Interconnect (PPI) system. Flexible GPIOs enables you to connect digital interfaces like SPI Master/slave, TWI Master and UART to any of the 31 GPIOs on the device.

XL7005

This is a DC/DC converter that converts the battery voltage to 3.3V.

MP1541DJ

There is a SOT23-5 IC (|B3YW with Y-Year code and W-Week code) which is a step up converter (from 3.3V) feeding the OLED Operating voltage supply Vpp with 11.5V.

Eletric signals

Electric signals of the display cable:

Green - UART TX
Black - UART RX
Red - GND
Blue - LOCK
Yellow - BAT+

Electric signals of the flat cable to the LCD module:

1 - NC
2 - VPP
3 - VCOMH
4 - VDD
5 - IM1
6 - IREF
7 - CS
8 - RES
9 - A0
10 - D0
11 - D1
12 - VSS
13 - NC

Electric signal on the connector of flat cable. From left to right (starting counting near D5):

1 - UART tx (green wire of LCD cable)
2 - UART rx (black wire of LCD cable)
3 - on/off button state (3.3V when pressed and 0V otherwise)
4 - enable/disable power circuit (1 logic to enable)
5 - BAT+ (Voltage Divider 300k/16k)
6 - GND
7 - 3.3V Vdd
8 - LCD data
9 - LCD clock
10 - LCD command/data
11 - LCD reset
12 - LCD chip select

Files recorded with DSLogic logic analyzer, on the LCD data signals. Install DSLogic software and open the files to see the init sequence and regular data/pixels write to LCD: https://github.com/OpenSource-EBike-firmware/Color_LCD/tree/master/Bafang_LCD_SW102/DSLogic_save_files_LCD_data_signals

Eagle schematic

The schematic shows the pin assignment of the MCU and some of the more important circuitry. Component values of the RF part and decoupling capacitors are assumed from reference design and not actually measured.
You can find the Eagle CAD file here:
https://github.com/OpenSource-EBike-firmware/Color_LCD/blob/master/Bafang_LCD_SW102/SW102_nRF51x22.sch

Bootloader

It is possible that there is a Bluetooth bootloader based on the Nordic bootloader and probably with a custom encryption keys (locked bootloader that we can't use).

Flash and debug

Access to the board that has the firmware programming/debug pads doing this:

  1. use something thin to slide on the sides on the keypad
  2. force gently to the side the plastic cover until you can remove the keypad plastic cover
  3. you will find the firmware programming/debug pads under the keypad plastic cover
Clone this wiki locally