Hi, i'm using homemade s06s controller but Open Sourse KT firmware on my opinion is too old.
I discovered that TSDZ2 and S06S working on a same microkontroller (STM8S105C6T6).
Also we know what this firmwares was written by Casainho and after modify by Stancecoke and codes very similar
BUT TSZD2 firmware is still updatind
Pluses of the TSDZ2 firmware is Fieldwaiking and more stable
I'm not a programmer but i made some changes in the motor.c and pwm.c
but still to modify adc.c and adc.h
who a interesting on this firmware conversation Welcome to help
I discovered that TSDZ2 and S06S working on a same microkontroller (STM8S105C6T6).
Also we know what this firmwares was written by Casainho and after modify by Stancecoke and codes very similar
BUT TSZD2 firmware is still updatind
Pluses of the TSDZ2 firmware is Fieldwaiking and more stable
I'm not a programmer but i made some changes in the motor.c and pwm.c
Code:
pwm.c
TIM1_OC1Init(TIM1_OCMODE_PWM1,
#ifdef DISABLE_PWM_CHANNELS_1_3
TIM1_OUTPUTSTATE_DISABLE,
TIM1_OUTPUTNSTATE_DISABLE,
#else
TIM1_OUTPUTSTATE_ENABLE,
TIM1_OUTPUTNSTATE_ENABLE,
#endif
255, // initial duty_cycle value
TIM1_OCPOLARITY_HIGH,
TIM1_OCPOLARITY_LOW,
TIM1_OCIDLESTATE_RESET,
TIM1_OCNIDLESTATE_SET);
TIM1_OC2Init(TIM1_OCMODE_PWM1,
TIM1_OUTPUTSTATE_ENABLE,
TIM1_OUTPUTNSTATE_ENABLE,
255, // initial duty_cycle value
TIM1_OCPOLARITY_HIGH,
TIM1_OCPOLARITY_LOW,
TIM1_OCIDLESTATE_RESET,
TIM1_OCIDLESTATE_SET);
TIM1_OC3Init(TIM1_OCMODE_PWM1,
#ifdef DISABLE_PWM_CHANNELS_1_3
TIM1_OUTPUTSTATE_DISABLE,
TIM1_OUTPUTNSTATE_DISABLE,
#else
TIM1_OUTPUTSTATE_ENABLE,
TIM1_OUTPUTNSTATE_ENABLE,
#endif
255, // initial duty_cycle value
TIM1_OCPOLARITY_HIGH,
TIM1_OCPOLARITY_LOW,
TIM1_OCIDLESTATE_RESET,
TIM1_OCNIDLESTATE_SET);
Code:
motor.c
void motor_enable_pwm(void)
{
TIM1_OC1Init(TIM1_OCMODE_PWM1,
#ifdef DISABLE_PWM_CHANNELS_1_3
TIM1_OUTPUTSTATE_DISABLE,
TIM1_OUTPUTNSTATE_DISABLE,
#else
TIM1_OUTPUTSTATE_ENABLE,
TIM1_OUTPUTNSTATE_ENABLE,
#endif
255, // initial duty_cycle value
TIM1_OCPOLARITY_HIGH,
TIM1_OCPOLARITY_LOW,
TIM1_OCIDLESTATE_RESET,
TIM1_OCIDLESTATE_RESET);
TIM1_OC2Init(TIM1_OCMODE_PWM1,
TIM1_OUTPUTSTATE_ENABLE,
TIM1_OUTPUTNSTATE_ENABLE,
255, // initial duty_cycle value
TIM1_OCPOLARITY_HIGH,
TIM1_OCPOLARITY_LOW,
TIM1_OCIDLESTATE_RESET,
TIM1_OCIDLESTATE_RESET);
TIM1_OC3Init(TIM1_OCMODE_PWM1,
#ifdef DISABLE_PWM_CHANNELS_1_3
TIM1_OUTPUTSTATE_DISABLE,
TIM1_OUTPUTNSTATE_DISABLE,
#else
TIM1_OUTPUTSTATE_ENABLE,
TIM1_OUTPUTNSTATE_ENABLE,
#endif
255, // initial duty_cycle value
TIM1_OCPOLARITY_HIGH,
TIM1_OCPOLARITY_LOW,
TIM1_OCIDLESTATE_RESET,
TIM1_OCIDLESTATE_RESET);
}
void motor_disable_pwm(void)
{
TIM1_OC1Init(TIM1_OCMODE_PWM1,
TIM1_OUTPUTSTATE_DISABLE,
TIM1_OUTPUTNSTATE_DISABLE,
255, // initial duty_cycle value
TIM1_OCPOLARITY_HIGH,
TIM1_OCPOLARITY_LOW,
TIM1_OCIDLESTATE_RESET,
TIM1_OCIDLESTATE_RESET);
TIM1_OC2Init(TIM1_OCMODE_PWM1,
TIM1_OUTPUTSTATE_DISABLE,
TIM1_OUTPUTNSTATE_DISABLE,
255, // initial duty_cycle value
TIM1_OCPOLARITY_HIGH,
TIM1_OCPOLARITY_LOW,
TIM1_OCIDLESTATE_RESET,
TIM1_OCIDLESTATE_RESET);
TIM1_OC3Init(TIM1_OCMODE_PWM1,
TIM1_OUTPUTSTATE_DISABLE,
TIM1_OUTPUTNSTATE_DISABLE,
255, // initial duty_cycle value
TIM1_OCPOLARITY_HIGH,
TIM1_OCPOLARITY_LOW,
TIM1_OCIDLESTATE_RESET,
TIM1_OCIDLESTATE_RESET);
who a interesting on this firmware conversation Welcome to help