mirror of https://github.com/rusefi/wideband.git
PWM works
This commit is contained in:
parent
7a94321773
commit
3e90915d48
|
@ -112,7 +112,7 @@
|
||||||
/*
|
/*
|
||||||
* PWM driver system settings.
|
* PWM driver system settings.
|
||||||
*/
|
*/
|
||||||
#define STM32_PWM_USE_ADVANCED FALSE
|
#define STM32_PWM_USE_ADVANCED TRUE
|
||||||
#define STM32_PWM_USE_TIM1 TRUE
|
#define STM32_PWM_USE_TIM1 TRUE
|
||||||
#define STM32_PWM_USE_TIM2 FALSE
|
#define STM32_PWM_USE_TIM2 FALSE
|
||||||
#define STM32_PWM_USE_TIM3 TRUE
|
#define STM32_PWM_USE_TIM3 TRUE
|
||||||
|
|
|
@ -7,10 +7,10 @@
|
||||||
|
|
||||||
// 400khz / 1024 = 390hz PWM
|
// 400khz / 1024 = 390hz PWM
|
||||||
// TODO: this is wired to an inverted output, what do?
|
// TODO: this is wired to an inverted output, what do?
|
||||||
Pwm heaterPwm(PWMD1, 1, 400000, 1024);
|
Pwm heaterPwm(PWMD1, 0, 400'000, 1024);
|
||||||
|
|
||||||
// 48MHz / 1024 = 46.8khz PWM
|
// 48MHz / 1024 = 46.8khz PWM
|
||||||
Pwm pumpDac(PWMD3, 1, 48000000, 1024);
|
Pwm pumpDac(PWMD3, 0, 48'000'000, 1024);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Application entry point.
|
* Application entry point.
|
||||||
|
@ -21,6 +21,10 @@ int main() {
|
||||||
|
|
||||||
InitCan();
|
InitCan();
|
||||||
|
|
||||||
|
palSetPadMode(GPIOA, 6, PAL_MODE_ALTERNATE(1));
|
||||||
|
|
||||||
|
adcStart(&ADCD1, nullptr);
|
||||||
|
|
||||||
heaterPwm.Start();
|
heaterPwm.Start();
|
||||||
pumpDac.Start();
|
pumpDac.Start();
|
||||||
|
|
||||||
|
|
|
@ -17,10 +17,10 @@ void Pwm::Start()
|
||||||
m_counterPeriod,
|
m_counterPeriod,
|
||||||
nullptr,
|
nullptr,
|
||||||
{
|
{
|
||||||
{PWM_OUTPUT_ACTIVE_HIGH, nullptr},
|
{PWM_OUTPUT_ACTIVE_HIGH | PWM_COMPLEMENTARY_OUTPUT_ACTIVE_LOW, nullptr},
|
||||||
{PWM_OUTPUT_ACTIVE_HIGH, nullptr},
|
{PWM_OUTPUT_ACTIVE_HIGH | PWM_COMPLEMENTARY_OUTPUT_ACTIVE_LOW, nullptr},
|
||||||
{PWM_OUTPUT_ACTIVE_HIGH, nullptr},
|
{PWM_OUTPUT_ACTIVE_HIGH | PWM_COMPLEMENTARY_OUTPUT_ACTIVE_LOW, nullptr},
|
||||||
{PWM_OUTPUT_ACTIVE_HIGH, nullptr}
|
{PWM_OUTPUT_ACTIVE_HIGH | PWM_COMPLEMENTARY_OUTPUT_ACTIVE_LOW, nullptr}
|
||||||
},
|
},
|
||||||
0,
|
0,
|
||||||
0
|
0
|
||||||
|
|
Loading…
Reference in New Issue