Skip to content
casainho edited this page May 7, 2021 · 10 revisions

Table of Contents

See BBSHD Open Source Firmware: https://github.com/danielnilsson9/bbshd-fw


WARNING: as there are not development tools for the microcontroller D79F921/X8M06, it is impossible to develop the firmware.

NOTE: this motor controllers seems to have 2 microcontrollers, one probably to deal with the display only and run the ebike logic and other specific to control the motor. There are no developing tools for the one that controls the motor so no possible to develop firmware.

I think this is a chinese clone of the Renesas (formerly NEC) D79F9211, sometimes branded as a X8M06, well known from the old KU63 controllers. 44 Pin LQFP package.

https://github.com/stancecoke/Parameter-Setting-Tool-for-EBike-Controller/blob/master/related-documents/UPD79F9211-NEC.pdf

There is no cheap programmer available for this processor. I tried to build one on my own some month ago, but I stopped that project. https://github.com/stancecoke/Parameter-Setting-Tool-for-EBike-Controller

BBSHD motor controller

Motor controller (unpotted):

This motor controller hardware seems very similar to the TSDZ2 one, except that it has not the torque sensor part. There are power resistors to read the battery current and the microcontroller can control the 6 PWM channels that controls the power mosfets. Also there are the 3 motor hall sensors connections.

Since the microcontroller has only 32 kbytes of flash memory and the hardware is similar to the TSDZ2, the firmware for Bafang could be mostly based on our OpenSource firmware for TSDZ2 that implements FOC motor control. This would also mean that this Bafang motor would support the displays 850C color and SW102 Bluetooth, also running our OpenSource firmware.

Original firmware is available here.

Forum message on endless-sphere forum.

Microcontroller

Microcontroller is the STC15W4K32S4, based on a 8051 CPU, runs at 35 MHz and has 32 kbytes of flash memory.

Mosfets driver

OnSemi FAN7388

FAN7388: 625V, 3.3/5V input logic compatible, 0.65/0.35A sink/source current, 3-Phase Half-Bridge Gate-Drive IC.

BBS02 motor controller

This motor controller seems similar to BSSHD motor controller. Probably the firmware would be the same with minor differences.

DIY torque sensor

Bafang DIY motors miss a torque sensor. Maybe a torque sensor could be added to the pedal cranks like this: