New "TSDZ2 Torque Sensor Central Motor"

I’ve made another short cable but this time using the speed sensor cable end; identical problem; this is a total waste of time ☹️. As lots of people have done this successfully there’s something I’m not doing right; what can it be?
I soldered connections onto the speed sensor cable so that it could be connected to the ST LINK V2. My cable is about 10-11cm long. I also made a 9cm then cut it down to 5cm home made cable before I bastardised the speed sensor cable. 4 wires including 5V for power are connected.

I have Windows VM running.
I open up the ST Visual programmer application.
I plug in the ST LINK V2 to the USB already plugged in to the TSDZ2. A blue light shines on the ST LINK V2.
I click on the USB bar in Windows and select the ST LINK V2
I select STM8S105x6 (I have also tried the x4 variant; makes no difference).
Port: USB; Programming mode SWIM.
I then try to read the controller by pressing Read all tabs: I then get the following error:
Cannot communicate with device!
Check Swim cable connection and check all the needed pin connections on the Swim connector.
If the application code uses Swim Disable and Reset pin as output or has disabled SEIM clock divider. Try now to Switch off and on the application power supply while NRST reset pin is forced low.
The light alternates from blue to red a couple of after the error pops up then goes red.
Where am I going wrong?
 
aja said:
I’ve made another short cable but this time using the speed sensor cable end; identical problem; this is a total waste of time ☹️. As lots of people have done this successfully there’s something I’m not doing right; what can it be?
I soldered connections onto the speed sensor cable so that it could be connected to the ST LINK V2. My cable is about 10-11cm long. I also made a 9cm then cut it down to 5cm home made cable before I bastardised the speed sensor cable. 4 wires including 5V for power are connected.

I have Windows VM running.
I open up the ST Visual programmer application.
I plug in the ST LINK V2 to the USB already plugged in to the TSDZ2. A blue light shines on the ST LINK V2.
I click on the USB bar in Windows and select the ST LINK V2
I select STM8S105x6 (I have also tried the x4 variant; makes no difference).
Port: USB; Programming mode SWIM.
I then try to read the controller by pressing Read all tabs: I then get the following error:
Cannot communicate with device!
Check Swim cable connection and check all the needed pin connections on the Swim connector.
If the application code uses Swim Disable and Reset pin as output or has disabled SEIM clock divider. Try now to Switch off and on the application power supply while NRST reset pin is forced low.
The light alternates from blue to red a couple of after the error pops up then goes red.
Where am I going wrong?
Don't know. Can you read things like the OPT or EEPROM? Try to erase, unlock, etc the STM8.
 
casainho said:
aja said:
I’ve made another short cable but this time using the speed sensor cable end; identical problem; this is a total waste of time ☹️. As lots of people have done this successfully there’s something I’m not doing right; what can it be?
I soldered connections onto the speed sensor cable so that it could be connected to the ST LINK V2. My cable is about 10-11cm long. I also made a 9cm then cut it down to 5cm home made cable before I bastardised the speed sensor cable. 4 wires including 5V for power are connected.

I have Windows VM running.
I open up the ST Visual programmer application.
I plug in the ST LINK V2 to the USB already plugged in to the TSDZ2. A blue light shines on the ST LINK V2.
I click on the USB bar in Windows and select the ST LINK V2
I select STM8S105x6 (I have also tried the x4 variant; makes no difference).
Port: USB; Programming mode SWIM.
I then try to read the controller by pressing Read all tabs: I then get the following error:
Cannot communicate with device!
Check Swim cable connection and check all the needed pin connections on the Swim connector.
If the application code uses Swim Disable and Reset pin as output or has disabled SEIM clock divider. Try now to Switch off and on the application power supply while NRST reset pin is forced low.
The light alternates from blue to red a couple of after the error pops up then goes red.
Where am I going wrong?
Don't know. Can you read things like the OPT or EEPROM? Try to erase, unlock, etc the STM8.
How do I read OPT or EEPROM? and indeed how do I erase or unlock the STM8? Is OPT, option byte?

Thanks
 
aja said:
I’ve made another short cable but this time using the speed sensor cable end; identical problem; this is a total waste of time ☹️. As lots of people have done this successfully there’s something I’m not doing right; what can it be?
I soldered connections onto the speed sensor cable so that it could be connected to the ST LINK V2. My cable is about 10-11cm long. I also made a 9cm then cut it down to 5cm home made cable before I bastardised the speed sensor cable. 4 wires including 5V for power are connected.

I have Windows VM running.
I open up the ST Visual programmer application.
I plug in the ST LINK V2 to the USB already plugged in to the TSDZ2. A blue light shines on the ST LINK V2.
I click on the USB bar in Windows and select the ST LINK V2
I select STM8S105x6 (I have also tried the x4 variant; makes no difference).
Port: USB; Programming mode SWIM.
I then try to read the controller by pressing Read all tabs: I then get the following error:
Cannot communicate with device!
Check Swim cable connection and check all the needed pin connections on the Swim connector.
If the application code uses Swim Disable and Reset pin as output or has disabled SEIM clock divider. Try now to Switch off and on the application power supply while NRST reset pin is forced low.
The light alternates from blue to red a couple of after the error pops up then goes red.
Where am I going wrong?

What are you running the windows vm on ? I run on a MacBook Pro and sometimes get these error. I use st visual programmer, And when I get these errors I shut the program down and then restart it. I make sure I'm on the program tab and then use the writer current tab option from the program menu. I had loads of issues at the start, but since adopting this method it seem to be fine.
 
Hi,
Using a Macbook Air 2011
When you say ‘write’ I take it you mean ‘program’ as I don’t see a ‘write’ anywhere.
Did you try to read the current tab or all tabs before trying to program/write to the motor controller?
I haven’t tried to program the ST Link yet as JB suggested ensuring that it could read first; I take it that if it can’t read then it can’t write/program?
I’ve lost count of the times that I quit STVP and started it again!
Are you using STM8S105x4 as JB mentioned that x6 is now used for both screen and motor?
 
maximusdm said:
To make cables even shorter I connected directly into the board! Same result. Please see picture.
I made swim on black wire pin, reset on purple, ground on LCD black wire. Please see picture.
I have the LCD cables cut out. Is this a problem?
https://imgur.com/a/jHlqWDS
https://imgur.com/a/K7M5iK9

EDit: i have no idea how to attach picture. How do you do it?
I program with the motor controller powered on and for that, the LCD must be powered on and enable power to the motor controller........
 
OK so no takers on the springs beneath the non reciprocating part of the Torque Sensor. Does anyone have a photo of that area so that I could reference them against something.

I have heard that there was a service manual for this engine somewhere on the internet, I can't seem to locate it, any ideas.

Thanks.
 
aja said:
Hi,
Using a Macbook Air 2011
When you say ‘write’ I take it you mean ‘program’ as I don’t see a ‘write’ anywhere.
Did you try to read the current tab or all tabs before trying to program/write to the motor controller?
I haven’t tried to program the ST Link yet as JB suggested ensuring that it could read first; I take it that if it can’t read then it can’t write/program?
I’ve lost count of the times that I quit STVP and started it again!
Are you using STM8S105x4 as JB mentioned that x6 is now used for both screen and motor?


Sorry yeah I meant program current tab, I'm not in front of the computer just now. I use x6. If you can read then you should be abld to write as it's the same protocol. As to reading all tabs before programming, I don't do this now as I doscovered the process works better starting visual programmer, loading hex file and programming it without first reading. And I use a USB extension cable. Wifi and Bluetooth turned off as well.
 
casainho said:
maximusdm said:
To make cables even shorter I connected directly into the board! Same result. Please see picture.
I made swim on black wire pin, reset on purple, ground on LCD black wire. Please see picture.
I have the LCD cables cut out. Is this a problem?
https://imgur.com/a/jHlqWDS
https://imgur.com/a/K7M5iK9

EDit: i have no idea how to attach picture. How do you do it?
I program with the motor controller powered on and for that, the LCD must be powered on and enable power to the motor controller........
That is an important detail. Thank you!
 
aja said:
Can someone please help me; I've tried connecting the ST Link to the Speed sensor on the TSDZ2 to flash the firmware to the motor but whatever I do, I get the same Swim comms error; started with cables inc connectors at 9cm and cut them down to 5cm...still doesn't work; spent the whole weekend creating cables then soldering and re-soldering t different lengths; nothings worked. I do have a speed sensor cable but don't want to cut it up if I get the same result as I've followed JB's and Casainho and indeed Eco ebikes instructions but to no avail. :(
I've flashed the 0.14 hex file to the LCD3 without a problem.

I am not sure if this will help you, but i want to relate 2 things re. the motor flash cable with 6 pin connector .
pls refer to the pic. this is what the connections should be looking from the front. also: you can make your own female plug by using e.g. short pieces of tiny brass tubes that will fit over the motor connector pins. this way you do not have to use sensor cables etc... i tried to use a speed sensor cable from another bike..there were only 2 wires in it...these tubes are used in modelling, RC toys etc
the length of my cable is about 15 cm, it works perfectly well. i am using a tube with 0,9 mm inner diameter and 0,2mm wall thickness, 0,8mm would be even better if available connector made from tube.jpegtsdz2flashconnector.png
 
andyme said:
I am not sure if this will help you, but i want to relate 2 things re. the motor flash cable with 6 pin connector .
pls refer to the pic. this is what the connections should be looking from the front. also: you can make your own female plug by using e.g. short pieces of tiny brass tubes that will fit over the motor connector pins. this way you do not have to use sensor cables etc... i tried to use a speed sensor cable from another bike..there were only 2 wires in it...these tubes are used in modelling, RC toys etc
the length of my cable is about 15 cm, it works perfectly well. i am using a tube with 0,9 mm inner diameter and 0,2mm wall thickness, 0,8mm would be even better if available connector made from tube.jpegtsdz2flashconnector.png

I made my own connectors in the formation you have shown; didn’t work. I had a speed sensor with 6 wires which corresponded with casainho’s installation guidelines. When I try to read the motor controller, the battery pack is not plugged in and the LCD is not switched on but I note that casainho just mentioned doing so; is it necessary? I didn’t see that instruction anywhere.
 
i can only say that i have the motor connected to the battery, but i did not turn the lcd on...on the other hand: it will not harm either...
 
if you have the 5v wire connected to the flash tool then you don't need any other external power.
 
andyme said:
i can only say that i have the motor connected to the battery, but i did not turn the lcd on...on the other hand: it will not harm either...

I've also tried your method, nothing.
 
I have similar issues.

I can program the LCD just fine. Motor is very flaky.

I ended up turning OFF the verification. Then I run the flash around 5-10 times until I don't get an error.

Not exactly a great solution.
(52v - 750w with throttle version).
 
About getting Bafang 850C color LCD working with TSDZ2

I am being trying to develop knowledge and firmware for Bafang 850C color LCD, to make it working with TSDZ2 and our OpenSource firmware. I think this LCD model has good potential because uses standard/popular technology (the same used on Arduino world) and I can easily develop firmware for it, using just the same tools as for LCD3.

Over LCD3, it is obvious that it has much more flexibility because of the color display. I also think it has 3 big advantages: 1. huge memory space of 512kbytes; 2. internal clock that means I will not need anymore to check the hours on my watch while riding; 3. fast communication from the microcontroller to LCD that should permit fast drawing of real time graphs with data like motor current, motor temperature, etc.

BUT I am blocked, because I can't drive the LCD, because I do not know which driver IC it uses... I got the help from the work of hurzhurz that developed a change to UTFT LCD library (for TSDZ2 XH18 LCD) and I used it.
I also got the help from another user that sent me a new TSDZ2 + 1x Bafang 850C color LCD.

My next step is to try using a logic analyzer to read the 19 signals that goes to LCD and find what data is needed to drive it. I never done this!! Always learning and trying :)

Right now I used 3x Bafang 850C color LCD. The first one I burned by mistake, the 2nd do not has the original firmware firmware and the 3rd one is waiting for me to received the logic analyzer.

 
I have bought a new TSDZ2, but infortunately it is not working. I would like to test it without LCD display. I have 8 pin cable, so I need to short blue and red wire, but I don't know which pins are these on my connector. Pin 1 is battery +. How to find a second one?

NNZnaM7.jpg
 
feketehegyi said:
fyi, I've made a TSDZ2 Display from scratch
[youtube]yoJl_CpBqrY[/youtube]
I am more and more interested on this type of DIY. I would prefer to go with an already existing LCD for ebikes but seems very hard to make the LCD working when we have no datasheet of it -- I also saw a lot of forum messages of people with this type of problems for cheap LCDs to Arduino, where chinese guys sell them saying they use a specific LCD driver but in fact use some different....

I had one idea: why not recycle ours TSDZ2 VLCD6 and use the enclose to put inside the Arduino + the LCD??

I think a color LCD of 3.2 inches takes the area of the original LCD of VLCD6. And even we could reuse the original UP, DOWN and POWER buttons of VLCD6!!

What I think we need (this is the hardware of Bafang Color LCDs):
- 1x Arduino (I would go with 32bits STM32 Bluepill board, because is small, cheap, powerful and we can use the same flash/development tools for TSDZ2)
- 1x 3.2 inches color LCD (there are some versions already of IPS TFT that should give a better reading outside light) -- connection by SPI
- 1x Arduino RTC (real time clock, so the system can have tie/clock) -- connection by SPI
- 1x 60V to 5V DC-DC (to power the system)
- 1x some switch to power on/of the motor controller

Optional:
- 1x Bluetooth module
- 1x other hardware for bicycle sensors

Doing DIY is not good as most users will simple not do it. The probability for errors are much higher...

What is your plan??
 
casainho said:
I am more and more interested on this type of DIY. I would prefer to go with an already existing LCD for ebikes but seems very hard to make the LCD working when we have no datasheet of it -- I also saw a lot of forum messages of people with this type of problems for cheap LCDs to Arduino, where chinese guys sell them saying they use a specific LCD driver but in fact use some different....

I had one idea: why not recycle ours TSDZ2 VLCD6 and use the enclose to put inside the Arduino + the LCD??

I think a color LCD of 3.2 inches takes the area of the original LCD of VLCD6. And even we could reuse the original UP, DOWN and POWER buttons of VLCD6!!

What I think we need (this is the hardware of Bafang Color LCDs):
- 1x Arduino (I would go with 32bits STM32 Bluepill board, because is small, cheap, powerful and we can use the same flash/development tools for TSDZ2)
- 1x 3.2 inches color LCD (there are some versions already of IPS TFT that should give a better reading outside light) -- connection by SPI
- 1x Arduino RTC (real time clock, so the system can have tie/clock) -- connection by SPI
- 1x 60V to 5V DC-DC (to power the system)
- 1x some switch to power on/of the motor controller

Optional:
- 1x Bluetooth module
- 1x other hardware for bicycle sensors

Doing DIY is not good as most users will simple not do it. The probability for errors are much higher...

What is your plan??

Being a beginning arduino user, this really interests me! Agreed that I'm sure it wouldn't get mainstream adoption so it might not be the best idea to abandoned support for the LCD3. That said, I would imagine at some point a fully stable release will be settled on that implements most of the desired functions and some more fringe-diy off shoots can be pursued without leaving the LCD3 dev in a lurch.

Would be super awesome to have reliable bluetooth, color display - and would be a fun project to build.
 
casainho said:
What is your plan??
My Arduino and SPI TFT setup is a proof of concept only. A mobile phone connected to TSDZ2 via bluetooth is the best display imho.
If someone has not seen my bluetooth module:
https://www.youtube.com/watch?v=CiTuFZmhYbA
Or a live demo with my VOAMCA firmware:
https://www.youtube.com/watch?v=MRNlK_30TOA
 
Back
Top