Replies: 6 comments 2 replies
-
|
Oh, my example does the current reading in left alignment, but that's nothing to adapt back |
Beta Was this translation helpful? Give feedback.
-
|
If there's anyone interested&able to test i could make a branch(&binary if necessary) for this. I'm guessing "hand adjusted" OC4 timing might need to be readjusted, but atm. i don't have |
Beta Was this translation helpful? Give feedback.
-
To clarify what i wrote above a bit, with "somewhere" i meant about when the code in level zero |
Beta Was this translation helpful? Give feedback.
-
|
no problem
Yahoo Mail: Suchen, organisieren, erobern
Am Fr., Aug. 1, 2025 at 15:36 schrieb ***@***.***>:
This is just for the stm8(TSDZ2). So doesn't affect BBS's in any way, but thank you for the offer.
—
Reply to this email directly, view it on GitHub, or unsubscribe.
You are receiving this because you commented.Message ID: ***@***.***>
|
Beta Was this translation helpful? Give feedback.
-
|
Just noticed; the code for tsdz2 does atm. read the result for adc_battery_current in wrong order. RM0016 for stm8 page 445:
What most likely that won't affect anything, as it's not used as a whole, so this is not a bug report. |
Beta Was this translation helpful? Give feedback.
-
|
Fwiw., i got bbs-fw working on kunteng controller*, but it is still throttle-only(i got no PAS-hw). Currently waiting for a scope i bought to arrive, so i could try to measure which way to adjust the OC4 *) KT36/48SVPRD-HRDF02L (6fet version: rated current 10A, max current 20A+/-1A) from pswpower.com. |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Wrote something that might be seen as an improvement for tsdz2 also.
Gave that a shot, and now have things running nicely. Setting software priorities like this:
is what allows to run start of timer1 irq handler like this:
and adc irq then does what the comment says, after reading battery voltage it will start conversion

on throttle before going back to continous for current, which is the shorter pulse seen below:
So, from start to finish the adc operations take about 14us of the time, AND it uses some of that
to work on rest of the stuff it has to do anyway - using the scanning w/adc includes time spent on
useless input, and so it happens somewhere most of the time, because it is relatively low on priorities,
which doesn't result in as consistent sampling as far as i can tell(possible pauses from level 0 and
other irqs do mess up with that).
Any thoughts on this ?
Beta Was this translation helpful? Give feedback.
All reactions