1
\$\begingroup\$

I'm at beginner level STM32, which is a bit more complicated than Arduino. I'm trying to generate PWM, and have watched some videos. But I really don't understand what is going on, because the PA6 or D12 (on STM32F767ZI) have a .1 voltage on my multimeter, and I have set the period to 255 and pulse to 200 in the IDE, so shouldn't that be about 200/255 * 5 V? But also, I'm getting the same reading on other pins, like D8...

So I don't understand this. It's a really old multimeter and perhaps it is not capable of reading PWM waves?

So, perhaps someone here have a clue to help me get started. I have tried many different settings, not only 200/255, and other pins as well... perhaps the card is just malfunctioning? I have done some Arduino stuff for the last weeks, but it's a steep learning curve compared. Lots of settings, indeed...

The card did work for "digital out" (on/off), and both the onboard LED and an external LED on the breadboard. But no it seems that nothing effects the PWM voltage...

I'm really at beginner level when it comes to electrical engineering, and it's just a hobby. But I want to make to jump up from Arduino.

\$\endgroup\$
2
  • 1
    \$\begingroup\$ You have not ahown any code. You also complain how difficult it is but don't bother to tell are you working in assembly or using bare metal C or using CubeMX code generator and ST provided HAL or any framework similar to Arduino. Also did you at any stage start the timer or configure the timer output channel IO pin? It is difficult to understand what help you need. \$\endgroup\$
    – Justme
    Commented Sep 16 at 4:17
  • \$\begingroup\$ Apologies for the shortcomings in the original post. I'm using the CubeMX code generator in the CubeIDE. My plan is to use C, but regardless I'm not getting the "right" PWN voltage (the multimeter works for PWM on Arduino). I should get 200/255*5 V without any other coding than HAL_TIMEx_PWMN_Start(&htim3, TIM_CHANNEL_1); in the "user code 2" in main.c... I dont know assemly, but know some C and have done a lot of programming in other languages (more high level). \$\endgroup\$
    – GeekGuy
    Commented Sep 16 at 4:24

1 Answer 1

0
\$\begingroup\$

First of all, Timer 3 has no inverted channels, so you can't start any with the function you call. You need to control a timer channel and a pin that exists. Timer 3 has only non-inverted output channels.

Second, the MCU does not run at 5V so there expectation of the PWM voltage is not correct.

\$\endgroup\$
2
  • \$\begingroup\$ Thanks a lot! I began a new project and used TIM1. It didnt make any difference, but i found the error. The correct start-function is HAL_TIM_PWM_Start, not HAL_TIMEx_PWMN_Start... so now I got about 200/255 of 3.3 volts (the voltage for the MCU)! Im getting a weak voltage on the other pins as well - do you know why? Its like 0.1 volts... is that "off"? (Sorry for the "n00b" error using the wrong function for starting.) \$\endgroup\$
    – GeekGuy
    Commented Sep 16 at 5:08
  • \$\begingroup\$ @ScienceGuy It's not the wrong function, it's just not what you can use if you are not enabling the complementary channels, which the TIM3 does not even have. Also I don't know what you are measuring but it might be your multimeter, or maybe you have not even set the other pins as outputs. \$\endgroup\$
    – Justme
    Commented Sep 16 at 5:13

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.