Search found 7 matches

by lobivan
Thu Oct 22, 2020 1:40 pm
Forum: STM32F4 based boards
Topic: STM32f407vet6 blackboard malfunctional PWM
Replies: 13
Views: 15161

Re: STM32f407vet6 blackboard malfunctional PWM

It is important to set pin mode after timer init. Then it is recommended to attach interrupt after refresh, otherwise the interrupt will be fired by refresh. Which timer 2 pin does not work? Timer 5 was preferred over timer 2, but you can change this by editing the mapping table. I've found out tha...
by lobivan
Thu Oct 22, 2020 12:28 pm
Forum: STM32F4 based boards
Topic: STM32f407vet6 blackboard malfunctional PWM
Replies: 13
Views: 15161

Re: STM32f407vet6 blackboard malfunctional PWM

Timerx.setPeriod() is necessary if you want to output PWM signal with a specific period, not identical with your case (maximum resolution 65535). Do you know how to init different channels of timers? It can barely activate half of the pwm pins with that code and aditional LED. It seems I am missing...
by lobivan
Thu Oct 22, 2020 10:44 am
Forum: STM32F4 based boards
Topic: STM32f407vet6 blackboard malfunctional PWM
Replies: 13
Views: 15161

Re: STM32f407vet6 blackboard malfunctional PWM

It is not enough to set the pin mode. You have to setup the timer corresponding to the used pin (PA8 in your example is mapped to timer 1 channel 1, see here ). A usual setup looks like this: Timer1.init(); // initializes and stops the timer pinMode(PA8, PWM); // sets the pin mode Timer1.setPeriod(...
by lobivan
Wed Oct 21, 2020 10:59 pm
Forum: STM32F4 based boards
Topic: STM32f407vet6 blackboard malfunctional PWM
Replies: 13
Views: 15161

Re: STM32f407vet6 blackboard malfunctional PWM

fpiSTM wrote: Wed Oct 21, 2020 9:21 pm I guess it is libmaple as STM32 core does not have pwmWrite API nor PWM as argument of pin mode.
I tried both pwmWrite and analogWrite, neither works
by lobivan
Wed Oct 21, 2020 10:58 pm
Forum: STM32F4 based boards
Topic: STM32f407vet6 blackboard malfunctional PWM
Replies: 13
Views: 15161

Re: STM32f407vet6 blackboard malfunctional PWM

I use STM32 master pack as usually recommended everywhere. Exactly this one: https://github.com/rogerclarkmelbourne/Arduino_STM32 . I am much confused because in some examples the pwm is enabled in one line, in others you have to turn on timers via registers, but no one gives manual to f407, there a...
by lobivan
Wed Oct 21, 2020 6:31 pm
Forum: STM32F4 based boards
Topic: STM32f407vet6 blackboard malfunctional PWM
Replies: 13
Views: 15161

Re: STM32f407vet6 blackboard malfunctional PWM

Yes, I use Arduino IDE. Approximate code: #define PWMPin PA8 int PWMval; void setup() { Serial1.begin(9600); pinMode(PWMPin,PWM); } void loop() { PWMval = millis()%(65535); pwmWrite(PWMPin, PWMval); } Does not work also if PWMwrite is replaced with analogWrite (PWMis also replaced with OUTPUT ) or i...
by lobivan
Wed Oct 21, 2020 3:22 pm
Forum: STM32F4 based boards
Topic: STM32f407vet6 blackboard malfunctional PWM
Replies: 13
Views: 15161

STM32f407vet6 blackboard malfunctional PWM

Hello, everyone. I've bought a STM32f407vet6 blackboard from China. It seems to work mostly well when speaking about digital inputs and outputs, but I have problems with the PWM, it doesn't start at all neither with analogWrite() nor with pwmWrite() . I have checked whether pins I use include PWM an...

Go to advanced search