-
Notifications
You must be signed in to change notification settings - Fork 9
Bafang color LCD 850C
Bafang 850C LCD is a color LCD that is manufactured by http://aptdevelop.com/.
Our OpenSource firmware repository: https://github.com/OpenSource-EBike-firmware/TSDZ2_wiki/wiki
- use something thin to force open the front cover, by making force on the sides of the case
- remove the hard plastic layer that is on top of the LCD
- remove the 2 little screws that fix the LCD and the board to the case
Picture of the board:
The backside of the board is glued to LCD. Seems the board has 2 layers.
- 320 x 480 pixels
- 3.5 inches
- seems to use a similar to ILI9481 driver
PCB connector pin | Connection to |
1 | GND |
2 | 2V (turn on this voltage by 1 logic on PA14) |
3 | 2V (turn on this voltage by 1 logic on PA14) |
4 | 2V (turn on this voltage by 1 logic on PA14) |
5 | 2V (turn on this voltage by 1 logic on PA14) |
6 | 2V (turn on this voltage by 1 logic on PA14) |
7 | GND |
8 | GND |
9 | PC4 (chip select signal) |
10 | PC3 (command/data signal) |
11 | PC5 (write strobe signal) |
12 | PC7 (rd strobe signal) |
13 | NC (not connected) |
14 | NC |
15 | NC |
16 | PB15 |
17 | PB14 |
18 | PB13 |
19 | PB12 |
20 | PB10 |
21 | PB9 |
22 | PB8 |
23 | PB7 |
24 | PB6 |
25 | PB5 |
26 | PB4 |
27 | PB3 |
28 | PB2 |
29 | PB1 |
30 | PB0 |
31 | NC |
32 | NC |
33 | NC |
34 | NC |
35 | NC |
36 | PC6 (display reset signal) |
37 | GND |
38 | NC |
39 | NC |
40 | NC |
41 | 3.3V |
42 | 3.3V |
43 | 3.3V |
44 | NC |
45 | NC |
NOTE: When the LCD flat cable is unconnected, the microcontroller keeps driving the data lines with signals.
Write strobe signal (PC5):
Chip select signal (PC4):
Command/data signal (PC3):
Bafang 850C wires | motor controller wire function |
brown wire | (P+) battery voltage |
orange wire | Vin |
black wire | GND ground |
green wire | UART TX motor controller |
white wire | UART RX motor controller |
This is a 32 bits ARM Cortex M3 that should be very similar to STM32F103.
GD32F103RET6 main characteristics:
- Maximum Speed Up to 108MHz
- Flash Memory: 512K
- RAM: 64K
- Package: LQFP64
Pin number | Function |
20 (PA4) |
ADC01_IN4, measure battery voltage. Battery voltage first goes over D5 and then R29 and R31 forms the voltage divider. R29 is connected in one side to GND. R31 = 200kohms; R29 = 10kohms. Vout = Vin * (R2 / (R2+R1)); Vout = Vin * 0,048. |
Resources:
This is a DC-DC converter that converts the battery voltage to 5V.
- When LCD is powered off, this IC is not running.
- The Enable pin seems to be wired to ground with a resistor and not controlled by the microcontroller.
U3, marked as E17E, is a Low Dropout Positive Voltage Regulator that outputs 3.3V.
- When LCD is powered off, this IC is not running.
U5, marked as ATMLH152 16B, is Two-wire Serial EEPROM of 2kbytes.
- it is powered with 5V
This integrated circuit may be responsible to control the USB charger. The microcontroller pin 17 / PA3 controls a line of this integrated circuit to enable/disable the USB charger.
On some boards seems that is populated a light sensor with label D7 and it is on the board back side (LCD side).
There are 2 pins connected to the microcontroller, maybe one is for excitation of the light sensor and other to measure the voltage at the light sensor terminals.
Microcontroller pin 15: measure sensor voltage. Pin 19: excitation.
Although the USB pins are connected to the board (unknown connections to the board), the USB pins of the GDF32F103RET6 are both connected to GND.
Was verified that the USB pins are not connected to UART TX/RX pins that goes to the motor controller.
Maybe the USB pins connected to board are needed for start charging of USB device.
Seems that original firmware includes a bootloader, because there is a Windows software provided by the manufacture that flash new firmware by the UART pins/wires that goes to the motor controller.
The JTAG SWD pins are available on the board, on the pads as seen on next picture, with the following JTAG pins:
Pad number (from left to right) |
JTAG name |
1 | GND |
2 | NRST |
3 | SWCLK |
4 | SWDIO |
5 |
VCC 3.3V (no need to connect if LCD is already powered on) |