new tsdz8 pswpower

I’m starting to make cables for J-link while waiting it to come. I’m little confused.

I think Segger j-link has 20 pins. In diagram picture from doc folder is only six visible. Which pins I should connect wires. Pinnout is from Segger web page.

J-Link Interface Description


Segger_pins.jpgDiagram-TS 32-bit Mid Drive Motor Controller Programming Cable (EN).jpg
 
I’m starting to make cables for J-link while waiting it to come. I’m little confused.

I think Segger j-link has 20 pins. In diagram picture from doc folder is only six visible. Which pins I should connect wires. Pinnout is from Segger web page.

J-Link Interface Description


View attachment 366097View attachment 366098
Some Jlink devices are delivered with an external board (pcb) that contains several connectors. When you have such a board, the XH-6Y connector can directly fit in one of the board connector.
If you buy a Jlink device without this external board, and probably just flat cable, you have to connect directly to the Jlink device or to the provide flat cable.

Personally I had a jLink device without the board and I used an extension cable foreseen for the speed sensor.
I cut the extension cable and I connected to pin headers (on a small pcb). I then connected the pin headers to the link flat cable.
Here the function of the different wires in the extension cord I had:
Take care that I am not sure that the color are the same as your cable.
- orange = grnd (to be connected to Jlink - there are many Grnd pin in the Jlink connector; use one of them)
- brun = Vcc = VTref of Jlink (see note here below)
- yellow = speed sensor (so not connected to Jlink)
- green = light (so not connected to jlink)
- Red = SWDIO (to be connected to JLink pin 7 - TMS)
- black = SWCLK (to be connected to jlink pin 9 - TCK)

Note: it is possible to find on the web a picture of the 6 pins female connector giving the functions of each pin. This allows to check if the color are the same or not. Here a link to such a picture. It is about TSDZ2 and STlink but that does not make a difference to know the functions of each pin.

Note about VTref.
If you make you own cable, it is good to keep the possibility to be able to connect/disconnect this wire to/from Jlink.

When you have a Jlink chinese clone, Jlink provides by default 3.3V on this pin.
When you flash the controller, it is better not to power the controller by the main battery. So having the wire connected to Jlink, Jlink can deliver the power supply to the controller to flash it without any risk to drive high current from the battery.
With my firmware, there is also an option to let the motor runs while it is connected to jlink. This can be usefull to monitor some data and perform some fine tuning (without flashing). In this case, the motor is powered by the main battery and it is (probably) better to avoid powering it also by the Jlink device. That is the reason why I then disconnect the wire from VRef.

Addittional note: I think that the original Segger Jlink devices (not the clone)does not provide by default a voltage on VTref.
Those using the original Jlink have then 2 options:
- Send a command to Jlink to force it to provide a volatge on VTRef (see official doc)
- Power the controller from the main battery when flashing. I expect it should be OK even if it seems me a little less secure.
 
Thank you very detailed answer. I think I will have same Segger clone than you. I ordered it from aliexpress what you linked. I watched pictures from there and noticed it has 20 pins and then search from internet and found Segger site and took pictures from there.
I have speed sensor cable what I cutted and found there is wires with same colors that in DOC folder picture. You have different colors.
I hope Segger clone arrives next week and I cant test your software with TSDZ8.
 
FYI, I put on github a new version of OSF for TSDZ8 at GitHub - mstrens/OSF
It does not require to install complex software to compile.
You just have to use J-flash program with a Jlink device (like when flashing another firmware version).
To setup the configuration, you have to use also the provided XLS configurator.
Read the new Readme section on github for details.
I did not tested it on a bike. I expect that some motor specific parameters have still to be fine tuned.

This is still a version for VLCD5 display (or other displays supported by TSDZ2 mbrusa firmware).
.
Later on, I expect a version for 860C allowing to change all config parameters with the display (associated with a specific firmware within the 860C like for the TSDZ2_860C OSF version).
 
OSF (at least the version that I reused) has currently more that 100 parameters that can be choosen by the user.
Most of them can only be defined within the Java configurator. The configurator generates a file with is used during the compilation step to provide the final firmware. It means that the code implemented in the controller is more or less complex depending on the values filled in the configurator. It is then not possible for the display to activate those function.s that are not in the generated code.
With the display, the user can only activate a few options (like select the assist mode between Power, Torque, Cadence, eMTB,... or the way the lights are working).

E.g. in the configurator you can define the % of assistance in ECO, TOUR, SPORT and TURBO for several assist mode (POWER, TORQUE, CADENCE, ...). With the display you can not changes those % but you can select the assist mode (POWER, TORQUE, ...) that you want.

I’m starting to make cables for J-link while waiting it to come. I’m little confused.

I think Segger j-link has 20 pins. In diagram picture from doc folder is only six visible. Which pins I should connect wires. Pinnout is from Segger web page.

J-Link Interface Description


View attachment 366097View attachment 366098
You have wrong diagram, use this
 

Attachments

  • Screenshot_20250212_192205_YouTube.jpg
    Screenshot_20250212_192205_YouTube.jpg
    270.4 KB · Views: 23
Does this sheet work on Microsoft excel? I have tried with couple of browsers and blue button on advanced is not working.


View attachment 366240
I only tried it on my windows 10 PC with Chrome and it works. Perhaps it requires that you are the owner of the google sheet document.The button does not perform very special things. It is just a macro that moves to the sheet HEX and select the green cells. Did you try to copy my google doc in you own google drive (to become the owner). It this still doe snot work you can just do the selection and copy of the cells manually.
I do not have XLS microsoft on my PC so I can't test this.
 
Last edited:
hey mstrens. first off thank you for your work on this osf. i'm very excited to try it. i have a question,
when you say to flash the configurations .hex file created with the xlsx doc, are we to flash first the tsdz8 .hex file from github, and in a separate action flash the configurations.hex afterword? or should i somehow be flashing both files to the tsdz8 in one go?
 
hey mstrens. first off thank you for your work on this osf. i'm very excited to try it. i have a question,
when you say to flash the configurations .hex file created with the xlsx doc, are we to flash first the tsdz8 .hex file from github, and in a separate action flash the configurations.hex afterword? or should i somehow be flashing both files to the tsdz8 in one go?
Each hex file contains the adress (and the data) where the data have to be written in flash memory.
You have to do flash separately the 2 hex files.
The first time you can do it in any order (firmware first of config first).
Afterwards, if you only change the config, you do not have to reflash the firmware.
Also, if I make a new version of the firmware (that do not use new config parameters), you do not have to reflash the config.

Still, rarely, it can be that I made some changes (in the firmware and in the config XLS) that requires that both are re-flash.
That is why there is a "main" version number in the config file. The firmware checks it for compatibility and in case of error gives an error E09 on the display. So, if you get this error, then you have to reflash probably both to be sure with the latest files from github.
Note: it could be that some displays does not use E09 but blinking E08 (not 100% sure, I should check the code).
 
Each hex file contains the adress (and the data) where the data have to be written in flash memory.
You have to do flash separately the 2 hex files.
The first time you can do it in any order (firmware first of config first).
Afterwards, if you only change the config, you do not have to reflash the firmware.
Also, if I make a new version of the firmware (that do not use new config parameters), you do not have to reflash the config.

Still, rarely, it can be that I made some changes (in the firmware and in the config XLS) that requires that both are re-flash.
That is why there is a "main" version number in the config file. The firmware checks it for compatibility and in case of error gives an error E09 on the display. So, if you get this error, then you have to reflash probably both to be sure with the latest files from github.
Note: it could be that some displays does not use E09 but blinking E08 (not 100% sure, I should check the code).
awesome! i noticed today riding home from work the tsdz8 has about 1.5 seconds of lag when you hit the trottle to it actually applying any power... is there any way of changing it so there is less lag in the control system when using the trottle?
 
awesome! i noticed today riding home from work the tsdz8 has about 1.5 seconds of lag when you hit the trottle to it actually applying any power... is there any way of changing it so there is less lag in the control system when using the trottle?
TSDZ8 firmware re-use mainly the code from TSDZ2.
I transmitted your remark to the developper team of TSDZ2 firmware.
Here below the answer I got:
-----------------------
It will depend mainly on the throttle position, shifted gear, and motor inertia.

In the firmware we don't accelerate as fast as possible until cassette synchronizes with wheel speed and if the user holds the throttle lightly it may take a second.

In principle you want to accelerate as fast as possible (max torque) and reduce torque around synchronization speed (cadence = bicycle speed / gear ratio) to avoid sudden jerk . But since we don't know for sure what gear the bicycle is in, it would be a bit tricky to do it smoothly especially when user presses throttle lightly and expects little torque and little jerk.
---------------------
 
I only tried it on my windows 10 PC with Chrome and it works. Perhaps it requires that you are the owner of the google sheet document.The button does not perform very special things. It is just a macro that moves to the sheet HEX and select the green cells. Did you try to copy my google doc in you own google drive (to become the owner). It this still doe snot work you can just do the selection and copy of the cells manually.
I do not have XLS microsoft on my PC so I can't test this.
After many hours of work and many trials and errors, I finally found the solution. I feel a bit stupid.
I just downloaded config settings and then open it and macros did not work.

Then I looked menus again and found under File menu Make a copy option, and then everything worked.
 
Do you think it is safe to up the power to 1000 watts in the firmware? I don't want to burn anything up but would like a little extra power
 
Hi, first i want to thanks Mstrens:) I also tried it, after the first tests, the support works and throttle works as well, it works on xh18, ekd01, vlcd5, I managed to upload the main hex file, but I have a problem with line 82 in the hex sheet, the Ref# error appears, and then it is impossible to upload the personalized hex file to tsdz8. The error appears to be in the original hex spreadsheet. Do you also have such a problem?? Alternatively, what is the value on line 82 of the hex sheet?
 
Hi, first i want to thanks Mstrens:) I also tried it, after the first tests, the support works and throttle works as well, it works on xh18, ekd01, vlcd5, I managed to upload the main hex file, but I have a problem with line 82 in the hex sheet, the Ref# error appears, and then it is impossible to upload the personalized hex file to tsdz8. The error appears to be in the original hex spreadsheet. Do you also have such a problem?? Alternatively, what is the value on line 82 of the hex sheet?
i havent yet flashed mine to the motor however my line 82 is this :02F0A00002006C
where is this ref# error appearing? on the display of the bike? or in the jflash program?
 
Last edited:
i havent yet flashed mine to the motor however my line 82 is this :02F0A00002006C
where is this ref# error appearing? on the display of the bike? or in the jflash program?
Ok thanks, I have it even in original mstrens xlxs file, and also after changing values in yellow chambers.
 
Ok I find solution with 82 line in hex file, after first tests osf by Mstrens(thanks again) working fine in my tsdz8 with xh18, on the same hex file its working also with ekd01 (but with some fails). Now tsdz8 working as stronger tsdz2 osf. Respect Mstrens;)
 
Important note :
I am currently preparing a new version that would not use the XLS sheet but directly the TSDZ2 configurator.
To prepare this, I made (yesterday and this morning) some changes to the XLS.
I forgot to change immediately the version nr in XLS in order to let the firmware automatically detects the incompatibility.
I did it now.

Currently I have not yet updated the TSDZ8 OSF firmware on github. I still must do some changes and tests.
So currently, if you download the latest version on github and google drive, it wil not work.

I hope having the new version using the configurator this evening.
 
Important note :
I am currently preparing a new version that would not use the XLS sheet but directly the TSDZ2 configurator.
To prepare this, I made (yesterday and this morning) some changes to the XLS.
I forgot to change immediately the version nr in XLS in order to let the firmware automatically detects the incompatibility.
I did it now.

Currently I have not yet updated the TSDZ8 OSF firmware on github. I still must do some changes and tests.
So currently, if you download the latest version on github and google drive, it wil not work.

I hope having the new version using the configurator this evening.
I had some problems but I've found solutions and even in last version working fine, if you can check line 82 in hex file, there was fail. It seems to be great project. Once more thanks
 
I had some problems but I've found solutions and even in last version working fine, if you can check line 82 in hex file, there was fail. It seems to be great project. Once more thanks
I fixed now the issue with line 82 but be very carreful because I moved some fields to another position. When using the HEX file the firmware can't detect it and so some parameters are totally wrong (shifted)!!
The current version of the XLS has another "main version" now and so the firmware should detect the error and not run (giving an error 09 on VLCD5)
 
Important note :
I am currently preparing a new version that would not use the XLS sheet but directly the TSDZ2 configurator.
To prepare this, I made (yesterday and this morning) some changes to the XLS.
I forgot to change immediately the version nr in XLS in order to let the firmware automatically detects the incompatibility.
I did it now.

Currently I have not yet updated the TSDZ8 OSF firmware on github. I still must do some changes and tests.
So currently, if you download the latest version on github and google drive, it wil not work.

I hope having the new version using the configurator this evening.
Very big thanks to @mstrens developing OSF to TSDZ8. :bigthumb:
 
I'm very excited about the firmware project! I hope that other displays will also be compatible with it (I currently use the EKD01).
me too, just noticed this thread. Now following.. I use the 860C display currently btw ;)
 
Last edited:
Ok I find solution with 82 line in hex file, after first tests osf by Mstrens(thanks again) working fine in my tsdz8 with xh18, on the same hex file its working also with ekd01 (but with some fails). Now tsdz8 working as stronger tsdz2 osf. Respect Mstrens;)
What solution did you find for line 82? I planned on flashing mine today but don't want to if there is an error
 
Back
Top