TSDZ2 mid drive with 860C, 850C or SW102 displays only -- Flexible OpenSource firmware (Casainho code only)

Electric Motors and Controllers
casainho   10 GW

10 GW
Posts: 4070
Joined: Feb 14 2011 2:43pm

Re: TSDZ2 mid drive and 850C and SW102 displays only -- Flexible OpenSource firmware (Casainho code only)

Post by casainho » Jan 24 2020 5:34pm

Waynemarlow wrote:
Jan 24 2020 3:55pm
Did you ever look at the Emtb mode, an awful lot of the guys I know riding production Emtbs, seem to love it, on the V20 its good but you have to be riding on your own or with only other Ebikers as you can get too carried away and end up 450W everywhere, its fun but tough on battery levels :)
Use this thread to discuss only latest version of the firmware. Move to the other threads to discuss the other old or different versions.
- TSDZ2 FAQ: issues and repairs, etc
- TSDZ2 OpenSource firmware

Developer of the Flexible OpenSource firmware for EBikes: TSDZ2 mid drive motor, KT motor controllers and displays: Bafang 850C color, SW102 Bluetooth and KT-LCD3.

If you like my work, please consider making a donation. I am being using the donations to buy needed resources for my developments. My paypal: casainho AT gmail.com.

User avatar
eyebyesickle   10 kW

10 kW
Posts: 717
Joined: Apr 07 2015 9:28pm
Location: Nashville

Re: TSDZ2 mid drive -- Flexible OpenSource firmware (Casainho code only) for TongSheng TSDZ2 mid drive motor

Post by eyebyesickle » Jan 24 2020 6:31pm

casainho wrote:
Jan 24 2020 2:19pm
jeff.page.rides wrote:
Jan 24 2020 1:11pm
Anyone out there no if we can flash the 860C with the 850C firmware and it will work other than the extra button on the pad? From what I've seen the 860C is much better in direct sunlight than the 850C?
That will probably not happen as I am being the only one opening the displays and do this initial work.

Also our firmware support the 2 different versions of 850C and the latest version is much better in direct sunlight and also has the same light sensor as 860C. I think 860C has only the advantage of the extra button but costs way more than 850C. Also 860C is almost impossible to open without destroying, so it is way expensive than 850C from the development point, which means that in the end, 850C is way better.
Well, this is definitely up casainho, but APT has agreed to send me the info to change the code so bootloader upload is possible, so we may be able to do it without opening the display. They say it is simple, but I literally have no idea, I am just saying what I've been told. I am having a couple sent to casainho incase he gets the urge. They are waaaaay better in sunlight, and the extra button is typically used for menu access in the stock version... They are also only $5 more from the manufacturer, so if we are able to use them, I do think it's better all the way around. However, I obviously have no authority in regards to this.

casainho   10 GW

10 GW
Posts: 4070
Joined: Feb 14 2011 2:43pm

Re: TSDZ2 mid drive -- Flexible OpenSource firmware (Casainho code only) for TongSheng TSDZ2 mid drive motor

Post by casainho » Jan 24 2020 7:11pm

eyebyesickle wrote:
Jan 24 2020 6:31pm
Well, this is definitely up casainho, but APT has agreed to send me the info to change the code so bootloader upload is possible, so we may be able to do it without opening the display. They say it is simple, but I literally have no idea, I am just saying what I've been told. I am having a couple sent to casainho incase he gets the urge. They are waaaaay better in sunlight, and the extra button is typically used for menu access in the stock version... They are also only $5 more from the manufacturer, so if we are able to use them, I do think it's better all the way around. However, I obviously have no authority in regards to this.
On PSWPower, which have nice prices usually:

- SW102: 35 dollars
- 850C: 51 dollars
- 860C: 75 dollars

850C is not cheap already and I mean compared with KT-LCD3, the previous display on this project. 860C is even more expensive 50%.

I want to focus now on SW102 instead on a new more expensive display.

To support 860C, at least the manufacturer need to send the source code for initialization of the LCD and the information for the bootloader, then yes, it will be relatively fast to support it, otherway, I think it will not happen soon.
- TSDZ2 FAQ: issues and repairs, etc
- TSDZ2 OpenSource firmware

Developer of the Flexible OpenSource firmware for EBikes: TSDZ2 mid drive motor, KT motor controllers and displays: Bafang 850C color, SW102 Bluetooth and KT-LCD3.

If you like my work, please consider making a donation. I am being using the donations to buy needed resources for my developments. My paypal: casainho AT gmail.com.

jeff.page.rides   10 W

10 W
Posts: 80
Joined: Aug 13 2019 10:16am

Re: TSDZ2 mid drive -- Flexible OpenSource firmware (Casainho code only) for TongSheng TSDZ2 mid drive motor

Post by jeff.page.rides » Jan 24 2020 7:38pm

eyebyesickle wrote:
Jan 24 2020 6:31pm
casainho wrote:
Jan 24 2020 2:19pm
jeff.page.rides wrote:
Jan 24 2020 1:11pm
Anyone out there no if we can flash the 860C with the 850C firmware and it will work other than the extra button on the pad? From what I've seen the 860C is much better in direct sunlight than the 850C?
That will probably not happen as I am being the only one opening the displays and do this initial work.

Also our firmware support the 2 different versions of 850C and the latest version is much better in direct sunlight and also has the same light sensor as 860C. I think 860C has only the advantage of the extra button but costs way more than 850C. Also 860C is almost impossible to open without destroying, so it is way expensive than 850C from the development point, which means that in the end, 850C is way better.
Well, this is definitely up casainho, but APT has agreed to send me the info to change the code so bootloader upload is possible, so we may be able to do it without opening the display. They say it is simple, but I literally have no idea, I am just saying what I've been told. I am having a couple sent to casainho incase he gets the urge. They are waaaaay better in sunlight, and the extra button is typically used for menu access in the stock version... They are also only $5 more from the manufacturer, so if we are able to use them, I do think it's better all the way around. However, I obviously have no authority in regards to this.
eyebyesickle
Will you please share where you can buy the 860C for only $5 more?
And if the 860C is way better in the sunlight then both the old 850C and the new 850C? Thanks.
I'm also a little bit confused about why you need to take apart the 860C to flash it, and you don't need to take apart the 850C to flash it?
Thanks

User avatar
eyebyesickle   10 kW

10 kW
Posts: 717
Joined: Apr 07 2015 9:28pm
Location: Nashville

Re: TSDZ2 mid drive -- Flexible OpenSource firmware (Casainho code only) for TongSheng TSDZ2 mid drive motor

Post by eyebyesickle » Jan 25 2020 2:31am

casainho wrote:
Jan 24 2020 7:11pm
eyebyesickle wrote:
Jan 24 2020 6:31pm
Well, this is definitely up casainho, but APT has agreed to send me the info to change the code so bootloader upload is possible, so we may be able to do it without opening the display. They say it is simple, but I literally have no idea, I am just saying what I've been told. I am having a couple sent to casainho incase he gets the urge. They are waaaaay better in sunlight, and the extra button is typically used for menu access in the stock version... They are also only $5 more from the manufacturer, so if we are able to use them, I do think it's better all the way around. However, I obviously have no authority in regards to this.
On PSWPower, which have nice prices usually:

- SW102: 35 dollars
- 850C: 51 dollars
- 860C: 75 dollars

850C is not cheap already and I mean compared with KT-LCD3, the previous display on this project. 860C is even more expensive 50%.

I want to focus now on SW102 instead on a new more expensive display.

To support 860C, at least the manufacturer need to send the source code for initialization of the LCD and the information for the bootloader, then yes, it will be relatively fast to support it, otherway, I think it will not happen soon.
Yes, but PSW power prices are much higher with shipping... The 860c is only $5 more from the manufacturer, they are charging according to market, not real cost.

I have associates in China, and as well as US, that can sell as cheap as PSW, once you consider shipping.

That being said, it is good to hear you are focusing on SW102.

Also, 860c bootloader should be easy then anyway, because I will have the information you neee in the first week of February. Just as I supplied the information for the 850c, if you recall, it's not problem for me to obtain now!

If we get the 860C firmware bootloader compatible, and it is in demand, I will have Chinese associates stock up, and offer at a reasonable price just like the 850c, which was the priority for a while anyway, it's no problem.

However, as you know, I've always been a fan of the SW102, so everybody wins soon!

User avatar
eyebyesickle   10 kW

10 kW
Posts: 717
Joined: Apr 07 2015 9:28pm
Location: Nashville

Re: TSDZ2 mid drive -- Flexible OpenSource firmware (Casainho code only) for TongSheng TSDZ2 mid drive motor

Post by eyebyesickle » Jan 25 2020 2:35am

jeff.page.rides wrote:
Jan 24 2020 7:38pm
eyebyesickle
Will you please share where you can buy the 860C for only $5 more?
And if the 860C is way better in the sunlight then both the old 850C and the new 850C? Thanks.
I'm also a little bit confused about why you need to take apart the 860C to flash it, and you don't need to take apart the 850C to flash it?
Thanks
Directly from the manufacturer, bulk order... The cost is only $5 more per a unit. If we get it worked out, and it makes sense, I will arrange an associate to place an order and make it available on the market.

There is certain info needed so you don't have to take apart the 860c. The 850c was the same way until I obtained the info from the manufacturer. It can be hard to make them share this info, but I have negotiated with them, as they are also impressed with the work of casainho and other helpers. So we will have it soon...

casainho   10 GW

10 GW
Posts: 4070
Joined: Feb 14 2011 2:43pm

Re: TSDZ2 mid drive -- Flexible OpenSource firmware (Casainho code only) for TongSheng TSDZ2 mid drive motor

Post by casainho » Jan 25 2020 7:42am

eyebyesickle wrote:
Jan 25 2020 2:35am
There is certain info needed so you don't have to take apart the 860c. The 850c was the same way until I obtained the info from the manufacturer. It can be hard to make them share this info, but I have negotiated with them, as they are also impressed with the work of casainho and other helpers. So we will have it soon...
Please ask them:
- what is the LCD driver, on 850C there are 2 differents, the ILI9481 and the ST7796

- initialization commands to the LCD driver, similar to what is on line 99 on bafang_500C_lcd_init(), on this file: https://github.com/OpenSource-EBike-fir ... river/ugui

- lcd_pixel_set(), line 466 of this file:https://github.com/OpenSource-EBike-fir ... ang_850c.c

- changes in hardware, with technical details as possible, compared to 850C
- TSDZ2 FAQ: issues and repairs, etc
- TSDZ2 OpenSource firmware

Developer of the Flexible OpenSource firmware for EBikes: TSDZ2 mid drive motor, KT motor controllers and displays: Bafang 850C color, SW102 Bluetooth and KT-LCD3.

If you like my work, please consider making a donation. I am being using the donations to buy needed resources for my developments. My paypal: casainho AT gmail.com.

obcd   100 W

100 W
Posts: 136
Joined: Jul 16 2019 3:45pm

Re: TSDZ2 mid drive and 850C and SW102 displays only -- Flexible OpenSource firmware (Casainho code only)

Post by obcd » Jan 25 2020 8:04am

How well is the SW102 readable in direct sunlight?
I also like the idea of having a minimalistic cheap display that doesn't attract thiefs. The setup and advanced stuff could eventually be done with a smartphone using the bluetooth interface. In such case you have something simple for those who like simple and something advanced for those who like to play with settings.
If you don't have a smartphone, you likely want to keep it simple.

skestans   100 W

100 W
Posts: 120
Joined: Jul 12 2019 12:42am
Location: Luxembourg

Re: TSDZ2 mid drive -- Flexible OpenSource firmware for TongSheng TSDZ2 mid drive motor

Post by skestans » Jan 25 2020 12:08pm

ezrider1199 wrote:
Oct 17 2019 4:16pm
Hi,

I received a 850c from pswpower and am trying to flash it. I noticed it doesnt fit into my 4-1 cable because it came with a female end so i attempted to put on a new male connector (luckily had a spare). Cut it up and see that the colors are off and the pin positions dont match with what tsdz2 is expecting. So I tried to figure out and match up the pins according to this Image.

Here's where I am now

Image.


Currently I am able to plug an unflashed 850c to my controller and see it start up but I can't get it to flash... is there anything i can verify? I assume that because the 850c can startup that my wiring should be ok. The APT program doesn't show much in the way of errors. Thanks

Tsdz2 display --> 850c
Gnd, Black --> black
Batt V+, Red --> purple
Rx, Yellow --> white
Tx, Green --> green
5v, Blue --> orange
I cant figure this out. I wired it all like on the diagram in the wiki, my 850c wont turn on. I even used an external power supply for the converter. The converter currently output 29.6V, so when hooked up just to power (no computer involved), the display should still be turning on. But it doesn't.

Also, which wire on the cable is the VCC? I used the orange one but it didn't turn on. I had 30V between GND and PL. Then I measured the power on PL and P+ out of my motor, and it looks like the battery voltage is between GND and P+; nothing PL, so I connected the purple wire to the +30V instead, to match that. No difference, still won't turn on or flash.

Then I put the original firmware back on the TSDZ2 (the one I dumped before attempting anything), reconnected the display, and now the display works but every time I pedal a little, it puts max torque (800/900W), and the "press - for pedestrian mode" doesn't do anything anymore. I tried with a different (new) 850C, and everything behaves normally there.

Furthermore, I can't get the ST Programmer software to work on Windows, ever. But with stm8flash on Linux, I can read and write fine. I'm using three wires: GND, SWIM, +5V.

How did anyone manage to flash their 850c display with a home made programmer?? And how do I fix my first 850C display now?

jeff.page.rides   10 W

10 W
Posts: 80
Joined: Aug 13 2019 10:16am

Re: TSDZ2 mid drive -- Flexible OpenSource firmware (Casainho code only) for TongSheng TSDZ2 mid drive motor

Post by jeff.page.rides » Jan 25 2020 8:38pm

eyebyesickle wrote:
Jan 25 2020 2:35am
jeff.page.rides wrote:
Jan 24 2020 7:38pm
eyebyesickle
Will you please share where you can buy the 860C for only $5 more?
And if the 860C is way better in the sunlight then both the old 850C and the new 850C? Thanks.
I'm also a little bit confused about why you need to take apart the 860C to flash it, and you don't need to take apart the 850C to flash it?
Thanks
Directly from the manufacturer, bulk order... The cost is only $5 more per unit. If we get it worked out, and it makes sense, I will arrange an associate to place an order and make it available on the market.

There is certain info needed so you don't have to take apart the 860c. The 850c was the same way until I obtained the info from the manufacturer. It can be hard to make them share this info, but I have negotiated with them, as they are also impressed with the work of casainho and other helpers. So we will have it soon...
Yesterday after my post I decided to have my wife take me over to Electrify Bike there not far from my home and they do all the work on my handcycle. https://www.electrifybike.com I asked them what they knew about 860C and to my surprise, they had the 860C in stock and ready to go. They also informed me that they mailed an 860C to casainho and he should have it anytime now. They also informed me that they flashed it before they sent it to casainho with the 850C flash with the same method and it worked, almost. If you hold down the power button while powering up then the display will display but the color mapping is wrong. It goes black when you let go of the power button, so there is something different let’s hope it’s small and easy to overcome.
We also took the 850C the 860C and the LCD3 out into the direct sunlight to compare them. The LCD3 as everyone knows is totally awesome in the sun and any other conditions. The 860C is better than the 850C but only about 20% to 30%, unlike the LCD3, is like 300% better than 850C.
In the photos, you can see what I’m talking about, but it’s not as pronounced as when you’re looking at them yourself in the sun at different angles.
The 860C looks like a higher-end LCD and the mount is much more adjustable to get the best viewing angle. For 5 bucks more at a wholesale price, it’s definitely worth it. And who knows how useful the fourth button is going to be on the pad.

01_2_1.jpg
850C
01_2_1.jpg (454.12 KiB) Viewed 1064 times
02_2_1.jpg
850C
02_2_1.jpg (413.73 KiB) Viewed 1064 times
03_2_1.jpg
860C
03_2_1.jpg (474.34 KiB) Viewed 1064 times
04_2_1.jpg
860C
04_2_1.jpg (413.33 KiB) Viewed 1064 times
05_2_1.jpg
LCD3
05_2_1.jpg (472.57 KiB) Viewed 1064 times

User avatar
eyebyesickle   10 kW

10 kW
Posts: 717
Joined: Apr 07 2015 9:28pm
Location: Nashville

Re: TSDZ2 mid drive and 850C and SW102 displays only -- Flexible OpenSource firmware (Casainho code only)

Post by eyebyesickle » Jan 25 2020 9:18pm

Good to know. Yes I have some too, but while getting the new info is no problem to fix it... It is a matter of time with the Chinese New Year right now...

The fourth button on the stock firmware is for menu, as you may know, but maybe we can do things like:

Short press: graph and display readout switch
Long press: menu

Or maybe even add a double press option for one of the above, and also have a max power quick setting... I don't know but I'm excited either way.

Yes I agree on the mount 100%, much better. It also has a screen protector which is nice! Definitely worth an extra $5

jeff.page.rides   10 W

10 W
Posts: 80
Joined: Aug 13 2019 10:16am

Re: TSDZ2 mid drive and 850C and SW102 displays only -- Flexible OpenSource firmware (Casainho code only)

Post by jeff.page.rides » Jan 25 2020 11:09pm

eyebyesickle wrote:
Jan 25 2020 9:18pm
Good to know. Yes I have some too, but while getting the new info is no problem to fix it... It is a matter of time with the Chinese New Year right now...

The fourth button on the stock firmware is for menu, as you may know, but maybe we can do things like:

Short press: graph and display readout switch
Long press: menu

Or maybe even add a double press option for one of the above, and also have a max power quick setting... I don't know but I'm excited either way.

Yes I agree on the mount 100%, much better. It also has a screen protector which is nice! Definitely worth an extra $5
For me pushing two buttons at the same time is hard. but pushing twice, holding, fast and slow that's pretty easy but the double button requires both hands and it's difficult when your hands don't work.

User avatar
eyebyesickle   10 kW

10 kW
Posts: 717
Joined: Apr 07 2015 9:28pm
Location: Nashville

Re: TSDZ2 mid drive and 850C and SW102 displays only -- Flexible OpenSource firmware (Casainho code only)

Post by eyebyesickle » Jan 25 2020 11:32pm

jeff.page.rides wrote:
Jan 25 2020 11:09pm
eyebyesickle wrote:
Jan 25 2020 9:18pm
Good to know. Yes I have some too, but while getting the new info is no problem to fix it... It is a matter of time with the Chinese New Year right now...

The fourth button on the stock firmware is for menu, as you may know, but maybe we can do things like:

Short press: graph and display readout switch
Long press: menu

Or maybe even add a double press option for one of the above, and also have a max power quick setting... I don't know but I'm excited either way.

Yes I agree on the mount 100%, much better. It also has a screen protector which is nice! Definitely worth an extra $5
For me pushing two buttons at the same time is hard. but pushing twice, holding, fast and slow that's pretty easy but the double button requires both hands and it's difficult when your hands don't work.
understood... I meant 'double tap' the 'M' button, as opposed to how with the 850c you have to push the + and - at the same time for changing the graph etc... it may be easier this way... and separate the function from the assist toggle and power buttons...

ezrider1199   1 W

1 W
Posts: 64
Joined: Jul 02 2019 5:42pm

Re: TSDZ2 mid drive -- Flexible OpenSource firmware for TongSheng TSDZ2 mid drive motor

Post by ezrider1199 » Jan 26 2020 2:05pm

I had difficulty as well but kept trying and it just started working. I also have a self made cable with an inline voltage booster and it works every time now. Heres a better picture of the wiring to hookup 850c to the motor (but the "Tsdz2 display --> 850c" text bellow is accurate as well):
Image

The vcc is the orange wire.

Try to go over the instructions again. And make sure you flash the correct versions of firmwares:
850C_v0.6.4-bootloader.bin
TSDZ2-v0.53.0.hex

With flashing with APT, it will say "Waiting..." then if you press the power button it should say "Uploading..." and the progress bar will move to 100%.

Im not sure why you're having issues with STVP, it works fine for me (did you install the drivers https://www.st.com/content/st_com/en/pr ... nk009.html ?). For motor flashing, you only need 2 wires SWIM and GND if motor is plugged into battery.

skestans wrote:
Jan 25 2020 12:08pm
ezrider1199 wrote:
Oct 17 2019 4:16pm
Hi,

I received a 850c from pswpower and am trying to flash it. I noticed it doesnt fit into my 4-1 cable because it came with a female end so i attempted to put on a new male connector (luckily had a spare). Cut it up and see that the colors are off and the pin positions dont match with what tsdz2 is expecting. So I tried to figure out and match up the pins according to this Image.

Here's where I am now

Image.


Currently I am able to plug an unflashed 850c to my controller and see it start up but I can't get it to flash... is there anything i can verify? I assume that because the 850c can startup that my wiring should be ok. The APT program doesn't show much in the way of errors. Thanks

Tsdz2 display --> 850c
Gnd, Black --> black
Batt V+, Red --> purple
Rx, Yellow --> white
Tx, Green --> green
5v, Blue --> orange
I cant figure this out. I wired it all like on the diagram in the wiki, my 850c wont turn on. I even used an external power supply for the converter. The converter currently output 29.6V, so when hooked up just to power (no computer involved), the display should still be turning on. But it doesn't.

Also, which wire on the cable is the VCC? I used the orange one but it didn't turn on. I had 30V between GND and PL. Then I measured the power on PL and P+ out of my motor, and it looks like the battery voltage is between GND and P+; nothing PL, so I connected the purple wire to the +30V instead, to match that. No difference, still won't turn on or flash.

Then I put the original firmware back on the TSDZ2 (the one I dumped before attempting anything), reconnected the display, and now the display works but every time I pedal a little, it puts max torque (800/900W), and the "press - for pedestrian mode" doesn't do anything anymore. I tried with a different (new) 850C, and everything behaves normally there.

Furthermore, I can't get the ST Programmer software to work on Windows, ever. But with stm8flash on Linux, I can read and write fine. I'm using three wires: GND, SWIM, +5V.

How did anyone manage to flash their 850c display with a home made programmer?? And how do I fix my first 850C display now?

skestans   100 W

100 W
Posts: 120
Joined: Jul 12 2019 12:42am
Location: Luxembourg

Re: TSDZ2 mid drive -- Flexible OpenSource firmware for TongSheng TSDZ2 mid drive motor

Post by skestans » Jan 26 2020 2:58pm

Thanks. I didn't cut the connector off my display because it came with the right plug and I have an extension cord that I cut in the middle to re-use the connector.

I could never have the display turn on, even with only the 30V and the GND connected. My understanding is that if this is done right, the display should turn on and show the power booster's output voltage as the battery voltage. That is not my case, it just simply won't turn on. But when hooked up to the battery back on the motor, it turns on fine.

My extension cord has the following colors which I mapped to these pins on my power booster and USB TTL:
- Green: TXD
- White: RXD
- Black: GND (power booster)
- Orange: +30V
- Purple: not connected

I have also tried swapping the +30V to the purple wire instead of the orange one, but it made no difference: still not turning on.
ezrider1199 wrote:
Jan 26 2020 2:05pm
I had difficulty as well but kept trying and it just started working. I also have a self made cable with an inline voltage booster and it works every time now. Heres a better picture of the wiring to hookup 850c to the motor (but the "Tsdz2 display --> 850c" text bellow is accurate as well):
Image

The vcc is the orange wire.

Try to go over the instructions again. And make sure you flash the correct versions of firmwares:
850C_v0.6.4-bootloader.bin
TSDZ2-v0.53.0.hex

With flashing with APT, it will say "Waiting..." then if you press the power button it should say "Uploading..." and the progress bar will move to 100%.

Im not sure why you're having issues with STVP, it works fine for me (did you install the drivers https://www.st.com/content/st_com/en/pr ... nk009.html ?). For motor flashing, you only need 2 wires SWIM and GND if motor is plugged into battery.

skestans wrote:
Jan 25 2020 12:08pm
ezrider1199 wrote:
Oct 17 2019 4:16pm
Hi,

I received a 850c from pswpower and am trying to flash it. I noticed it doesnt fit into my 4-1 cable because it came with a female end so i attempted to put on a new male connector (luckily had a spare). Cut it up and see that the colors are off and the pin positions dont match with what tsdz2 is expecting. So I tried to figure out and match up the pins according to this Image.

Here's where I am now

Image.


Currently I am able to plug an unflashed 850c to my controller and see it start up but I can't get it to flash... is there anything i can verify? I assume that because the 850c can startup that my wiring should be ok. The APT program doesn't show much in the way of errors. Thanks

Tsdz2 display --> 850c
Gnd, Black --> black
Batt V+, Red --> purple
Rx, Yellow --> white
Tx, Green --> green
5v, Blue --> orange
I cant figure this out. I wired it all like on the diagram in the wiki, my 850c wont turn on. I even used an external power supply for the converter. The converter currently output 29.6V, so when hooked up just to power (no computer involved), the display should still be turning on. But it doesn't.

Also, which wire on the cable is the VCC? I used the orange one but it didn't turn on. I had 30V between GND and PL. Then I measured the power on PL and P+ out of my motor, and it looks like the battery voltage is between GND and P+; nothing PL, so I connected the purple wire to the +30V instead, to match that. No difference, still won't turn on or flash.

Then I put the original firmware back on the TSDZ2 (the one I dumped before attempting anything), reconnected the display, and now the display works but every time I pedal a little, it puts max torque (800/900W), and the "press - for pedestrian mode" doesn't do anything anymore. I tried with a different (new) 850C, and everything behaves normally there.

Furthermore, I can't get the ST Programmer software to work on Windows, ever. But with stm8flash on Linux, I can read and write fine. I'm using three wires: GND, SWIM, +5V.

How did anyone manage to flash their 850c display with a home made programmer?? And how do I fix my first 850C display now?

jeff.page.rides   10 W

10 W
Posts: 80
Joined: Aug 13 2019 10:16am

Re: TSDZ2 mid drive -- Flexible OpenSource firmware for TongSheng TSDZ2 mid drive motor

Post by jeff.page.rides » Jan 26 2020 3:02pm

ezrider1199 wrote:
Jan 26 2020 2:05pm
I had difficulty as well but kept trying and it just started working. I also have a self made cable with an inline voltage booster and it works every time now. Heres a better picture of the wiring to hookup 850c to the motor (but the "Tsdz2 display --> 850c" text bellow is accurate as well):
Image

The vcc is the orange wire.

Try to go over the instructions again. And make sure you flash the correct versions of firmwares:
850C_v0.6.4-bootloader.bin
TSDZ2-v0.53.0.hex

With flashing with APT, it will say "Waiting..." then if you press the power button it should say "Uploading..." and the progress bar will move to 100%.

Im not sure why you're having issues with STVP, it works fine for me (did you install the drivers https://www.st.com/content/st_com/en/pr ... nk009.html ?). For motor flashing, you only need 2 wires SWIM and GND if motor is plugged into battery.

skestans wrote:
Jan 25 2020 12:08pm
ezrider1199 wrote:
Oct 17 2019 4:16pm
Hi,

I received a 850c from pswpower and am trying to flash it. I noticed it doesnt fit into my 4-1 cable because it came with a female end so i attempted to put on a new male connector (luckily had a spare). Cut it up and see that the colors are off and the pin positions dont match with what tsdz2 is expecting. So I tried to figure out and match up the pins according to this Image.

Here's where I am now

Image.


Currently I am able to plug an unflashed 850c to my controller and see it start up but I can't get it to flash... is there anything i can verify? I assume that because the 850c can startup that my wiring should be ok. The APT program doesn't show much in the way of errors. Thanks

Tsdz2 display --> 850c
Gnd, Black --> black
Batt V+, Red --> purple
Rx, Yellow --> white
Tx, Green --> green
5v, Blue --> orange
I cant figure this out. I wired it all like on the diagram in the wiki, my 850c wont turn on. I even used an external power supply for the converter. The converter currently output 29.6V, so when hooked up just to power (no computer involved), the display should still be turning on. But it doesn't.

Also, which wire on the cable is the VCC? I used the orange one but it didn't turn on. I had 30V between GND and PL. Then I measured the power on PL and P+ out of my motor, and it looks like the battery voltage is between GND and P+; nothing PL, so I connected the purple wire to the +30V instead, to match that. No difference, still won't turn on or flash.

Then I put the original firmware back on the TSDZ2 (the one I dumped before attempting anything), reconnected the display, and now the display works but every time I pedal a little, it puts max torque (800/900W), and the "press - for pedestrian mode" doesn't do anything anymore. I tried with a different (new) 850C, and everything behaves normally there.

Furthermore, I can't get the ST Programmer software to work on Windows, ever. But with stm8flash on Linux, I can read and write fine. I'm using three wires: GND, SWIM, +5V.

How did anyone manage to flash their 850c display with a home made programmer?? And how do I fix my first 850C display now?
Will you please give the pro and con of your inline voltage booster?
Is the battery life longer or shorter?
Do you have more or less low RPM torque?
Do you have more or less high RPM power?
Does the motor stay cooler or heat up more?
Please include anything else you can think of to help make the point of why it is or is not worth the effort to put on a voltage booster?
Thank you!

ezrider1199   1 W

1 W
Posts: 64
Joined: Jul 02 2019 5:42pm

Re: TSDZ2 mid drive and 850C and SW102 displays only -- Flexible OpenSource firmware (Casainho code only)

Post by ezrider1199 » Jan 26 2020 3:28pm

@jeff.page.rides The voltage booster is for the 850c flashing cable. It converts 5v from USB to 30v so the device can power on.

john61ct   1.21 GW

1.21 GW
Posts: 3579
Joined: Dec 18 2018 2:06pm

Re: TSDZ2 mid drive and 850C and SW102 displays only -- Flexible OpenSource firmware (Casainho code only)

Post by john61ct » Jan 26 2020 3:57pm

Could you link to the booster you chose?

skestans   100 W

100 W
Posts: 120
Joined: Jul 12 2019 12:42am
Location: Luxembourg

Re: TSDZ2 mid drive and 850C and SW102 displays only -- Flexible OpenSource firmware (Casainho code only)

Post by skestans » Jan 26 2020 5:03pm

john61ct wrote:
Jan 26 2020 3:57pm
Could you link to the booster you chose?
It’s the one from aliexpress, check the open source firmware wiki on GitHub, on the page about flashing the 850c. The booster is only when flashing the display with the cable. When it’s under normal operation, the battery supplies the voltage and you don’t need the booster.

jeff.page.rides   10 W

10 W
Posts: 80
Joined: Aug 13 2019 10:16am

Re: TSDZ2 mid drive and 850C and SW102 displays only -- Flexible OpenSource firmware (Casainho code only)

Post by jeff.page.rides » Jan 26 2020 6:44pm

Will you please give the pro and con of your inline voltage booster?
Is the battery life longer or shorter?
Do you have more or less low RPM torque?
Do you have more or less high RPM power?
Does the motor stay cooler or heat up more?
Please include anything else you can think of to help make the point of why it is or is not worth the effort to put on a voltage booster?
Thank you!
ezrider1199 wrote:
Jan 26 2020 3:28pm
@jeff.page.rides The voltage booster is for the 850c flashing cable. It converts 5v from USB to 30v so the device can power on.
OK, I read something a while back about somebody putting on a voltage booster that kept the voltage to the motor a lot higher even when the battery voltage dropped and I wanted to know what the pros and cons of that were.

ezrider1199   1 W

1 W
Posts: 64
Joined: Jul 02 2019 5:42pm

Re: TSDZ2 mid drive -- Flexible OpenSource firmware for TongSheng TSDZ2 mid drive motor

Post by ezrider1199 » Jan 26 2020 11:14pm

Weird that the purple 30v didnt work, that's how i have it and the orange is unused. You mentioned that your 850c has the right connector and connects to your system without any splicing/modification? At this point i would try to verify the connector pin order, maybe default 850c pins are arranged differently from what the tsdz2 expects it to be and different from the connector we're trying to build... also i assume you verified that your step up voltage regulator is working... try swapping the rx/tx too...

This is the pin order of the display female cable that you want:
Image
skestans wrote:
Jan 26 2020 2:58pm
Thanks. I didn't cut the connector off my display because it came with the right plug and I have an extension cord that I cut in the middle to re-use the connector.

I could never have the display turn on, even with only the 30V and the GND connected. My understanding is that if this is done right, the display should turn on and show the power booster's output voltage as the battery voltage. That is not my case, it just simply won't turn on. But when hooked up to the battery back on the motor, it turns on fine.

My extension cord has the following colors which I mapped to these pins on my power booster and USB TTL:
- Green: TXD
- White: RXD
- Black: GND (power booster)
- Orange: +30V
- Purple: not connected

I have also tried swapping the +30V to the purple wire instead of the orange one, but it made no difference: still not turning on.
ezrider1199 wrote:
Jan 26 2020 2:05pm
I had difficulty as well but kept trying and it just started working. I also have a self made cable with an inline voltage booster and it works every time now. Heres a better picture of the wiring to hookup 850c to the motor (but the "Tsdz2 display --> 850c" text bellow is accurate as well):
Image

The vcc is the orange wire.

Try to go over the instructions again. And make sure you flash the correct versions of firmwares:
850C_v0.6.4-bootloader.bin
TSDZ2-v0.53.0.hex

With flashing with APT, it will say "Waiting..." then if you press the power button it should say "Uploading..." and the progress bar will move to 100%.

Im not sure why you're having issues with STVP, it works fine for me (did you install the drivers https://www.st.com/content/st_com/en/pr ... nk009.html ?). For motor flashing, you only need 2 wires SWIM and GND if motor is plugged into battery.

skestans wrote:
Jan 25 2020 12:08pm
ezrider1199 wrote:
Oct 17 2019 4:16pm
Hi,

I received a 850c from pswpower and am trying to flash it. I noticed it doesnt fit into my 4-1 cable because it came with a female end so i attempted to put on a new male connector (luckily had a spare). Cut it up and see that the colors are off and the pin positions dont match with what tsdz2 is expecting. So I tried to figure out and match up the pins according to this Image.

Here's where I am now

Image.


Currently I am able to plug an unflashed 850c to my controller and see it start up but I can't get it to flash... is there anything i can verify? I assume that because the 850c can startup that my wiring should be ok. The APT program doesn't show much in the way of errors. Thanks

Tsdz2 display --> 850c
Gnd, Black --> black
Batt V+, Red --> purple
Rx, Yellow --> white
Tx, Green --> green
5v, Blue --> orange
I cant figure this out. I wired it all like on the diagram in the wiki, my 850c wont turn on. I even used an external power supply for the converter. The converter currently output 29.6V, so when hooked up just to power (no computer involved), the display should still be turning on. But it doesn't.

Also, which wire on the cable is the VCC? I used the orange one but it didn't turn on. I had 30V between GND and PL. Then I measured the power on PL and P+ out of my motor, and it looks like the battery voltage is between GND and P+; nothing PL, so I connected the purple wire to the +30V instead, to match that. No difference, still won't turn on or flash.

Then I put the original firmware back on the TSDZ2 (the one I dumped before attempting anything), reconnected the display, and now the display works but every time I pedal a little, it puts max torque (800/900W), and the "press - for pedestrian mode" doesn't do anything anymore. I tried with a different (new) 850C, and everything behaves normally there.

Furthermore, I can't get the ST Programmer software to work on Windows, ever. But with stm8flash on Linux, I can read and write fine. I'm using three wires: GND, SWIM, +5V.

How did anyone manage to flash their 850c display with a home made programmer?? And how do I fix my first 850C display now?

skestans   100 W

100 W
Posts: 120
Joined: Jul 12 2019 12:42am
Location: Luxembourg

Re: TSDZ2 mid drive -- Flexible OpenSource firmware for TongSheng TSDZ2 mid drive motor

Post by skestans » Jan 27 2020 2:14am

The voltage regulator is working, yes.

I think the wiring to the plug is different in my motor and display compared to the colors in the extension cable I bought (separately)

Iirc, GND was on the pin left of the notch (when the notch is up), and +30V was on the pin on the right of the notch. When I switched it to the purple wire, +30V was then on the pin opposite the notch.

None of these configurations match your diagram.

I think I’d have to check what the current pin out is on my motor. Maybe the seller wired it differently? That would be surprising but maybe? If so, I might have been sending +30V down the wrong line and smashed something.

Once I have the display turning on, I’ll fiddle with the RX and TX likes.

Also, RX and TX match the usb ttl’s RX and TX, or they must be crossed?

Localhorst666   1 mW

1 mW
Posts: 10
Joined: Jan 17 2020 6:51am

Re: TSDZ2 mid drive and 850C and SW102 displays only -- Flexible OpenSource firmware (Casainho code only)

Post by Localhorst666 » Jan 27 2020 3:58am

casainho wrote:
Jan 24 2020 8:32am
Localhorst666 wrote:
Jan 24 2020 8:18am
When I run into speed limit (25 km/h configured, respectively real 27 km/h) the motor turns off (works as designed up to this point), but when I slow down, the motor sometimes don't start again supporting. That happens in maybe in 30% of the cases, when I slow down from >27km/h. I have the feeling, that it's getting worse when I enable the torque sensor calibration. Of course I configured it with my torque sensors measurements (see attachement)!

When I restart the system, it works well for a couple of minutes, but sooner or later the problem happens again. During this issue motor power = 0. At first I thought, maybe there is a defective contact, but all values like speed, human power will be shown as usual. Is it software/user related or could it also be a defective contact!?
My speed limit is set to 50 km/h and I have no such issues. Can you setup to 50 km/h and see if the issue persist?

Also check the hall sensors signals, if they are failing intermittently, then motor will not rotate as it should...

Your torque sensor curve seems equal to mine.
Hi casainho,

Set speed limit to 50 km/h has no positive effect. The hall sensor is working well. Speed is displayed properly and magnet is in line with speed sensor. Speed sensor was working for older versions together with VLCD5, too.

It works as it should be directly after turning on only once. When motor assist will be set off once (decelerate, slow down etc.), motor assist won't start anymore, until I turn it off and on. If I keep "motor assisting" it runs well for kilometers until I have to slow down / brake etc.

I'll check cables / soldering points next, but due to the fact that it's working after reboot once, I don't think that my soldering is the problem. After that I will roll back to VLCD5 etc. and check if it's hardware related.

Do you a have another idea?

casainho   10 GW

10 GW
Posts: 4070
Joined: Feb 14 2011 2:43pm

Re: TSDZ2 mid drive and 850C and SW102 displays only -- Flexible OpenSource firmware (Casainho code only)

Post by casainho » Jan 27 2020 4:23am

Localhorst666 wrote:
Jan 27 2020 3:58am
Set speed limit to 50 km/h has no positive effect. The hall sensor is working well. Speed is displayed properly and magnet is in line with speed sensor. Speed sensor was working for older versions together with VLCD5, too.

It works as it should be directly after turning on only once. When motor assist will be set off once (decelerate, slow down etc.), motor assist won't start anymore, until I turn it off and on. If I keep "motor assisting" it runs well for kilometers until I have to slow down / brake etc.

I'll check cables / soldering points next, but due to the fact that it's working after reboot once, I don't think that my soldering is the problem. After that I will roll back to VLCD5 etc. and check if it's hardware related.

Do you a have another idea?
Are you using lights? do you have lights installed? because there are issues with lights currently. Other than this, I don´t have a clue and that is very strange behavior...
- TSDZ2 FAQ: issues and repairs, etc
- TSDZ2 OpenSource firmware

Developer of the Flexible OpenSource firmware for EBikes: TSDZ2 mid drive motor, KT motor controllers and displays: Bafang 850C color, SW102 Bluetooth and KT-LCD3.

If you like my work, please consider making a donation. I am being using the donations to buy needed resources for my developments. My paypal: casainho AT gmail.com.

Localhorst666   1 mW

1 mW
Posts: 10
Joined: Jan 17 2020 6:51am

Re: TSDZ2 mid drive and 850C and SW102 displays only -- Flexible OpenSource firmware (Casainho code only)

Post by Localhorst666 » Jan 27 2020 5:03am

casainho wrote:
Jan 27 2020 4:23am
Are you using lights? do you have lights installed? because there are issues with lights currently. Other than this, I don´t have a clue and that is very strange behavior...
Yes, I'm using lights! They are installed at Y-splitter of speed sensor. I guess, that will be the cause then.
Is it an issue with newer releases only? Could I help you to solve this issue somehow?

Post Reply