4) also in pwm_Lathe()
pwm_Mill->setCaptureCompare(channelMill, duty, PERCENT_COMPARE_FORMAT);
Search found 60 matches
- Fri Jul 30, 2021 5:00 pm
- Forum: General discussion
- Topic: how to PWM Frequency stm32duino and resolution
- Replies: 19
- Views: 32374
- Fri Jul 30, 2021 4:57 pm
- Forum: General discussion
- Topic: how to PWM Frequency stm32duino and resolution
- Replies: 19
- Views: 32374
Re: how to PWM Frequency stm32duino and resolution
Hi @geekfun, There are few mistakes in your sketch: 1) in the killing line, channel should be channelMill : // MyTimMill->setPWM( channelMill , pwm_mill, 20, 1); // uncommmenting this kills abililty to change duty cycle also kills LCD 2) Because you choose 2 channels from the same timer TIM1, you sh...
- Fri Apr 23, 2021 5:37 pm
- Forum: General discussion
- Topic: Help! TIM3 hardware timer is running 10* faster than configured
- Replies: 15
- Views: 6655
Re: Help! TIM3 hardware timer is running 10* faster than configured
I'm using HardwareSerial and HardwareTimer at the same time and they are conflicting. No !! HardwareSerial and HardwareTimer are not conflicting: HardwareSerial is using UART or USART peripheral, whereas HardwareTimer is using TIM peripheral. Maybe you mean SoftwareSerial. =========================...
- Fri Apr 23, 2021 9:56 am
- Forum: General discussion
- Topic: Help! TIM3 hardware timer is running 10* faster than configured
- Replies: 15
- Views: 6655
Re: Help! TIM3 hardware timer is running 10* faster than configured
Have you test my sketch ? is it working ? void TimerCallback() { uint32_t elapsed = micros() - timestamp; Serial2.println(elapsed); timestamp = micros(); } I strongly suggest to not use print function in your interrupt callback, because is a long processing probably larger than the 62microseconds yo...
- Thu Apr 22, 2021 6:24 pm
- Forum: General discussion
- Topic: Help! TIM3 hardware timer is running 10* faster than configured
- Replies: 15
- Views: 6655
Re: Help! TIM3 hardware timer is running 10* faster than configured
Besides mlundin questions, we also miss version of core you used. Note: there is a new release 2.0 that just came out recently. I suggest you to use it. m_timer.pause(); It looks like there was some previous configuration of HardwareTimer ... So you provided some piece of you sketch, but it is much ...
- Tue Aug 04, 2020 9:14 am
- Forum: General discussion
- Topic: Changing PWM duty cycle on BluePill produces wrong output
- Replies: 9
- Views: 11097
Re: Changing PWM duty cycle on BluePill produces wrong output
Hi @Leviro, Difficult to know what appends to PWM with a voltmeter, If you can observe signal with oscilloscope that would be better. That said, setPWM() is made for simplicity to start a PWM, but it is not designed to update a running PWM because it performs a full initialisation of the timer, and ...
- Wed Jun 24, 2020 7:58 am
- Forum: STM boards (Discovery, Eval, Nucleo, ...)
- Topic: Softwareserial issue on stm32 f411re
- Replies: 8
- Views: 9280
Re: Softwareserial issue on stm32 f411re
Hi @DonGorgon, The PullRequest provides some informations about softwareSerial implementation. https://github.com/stm32duino/Arduino_Core_STM32/pull/645 As you can see, yes there is a limitation: baudrate max 57600 with 80MHzh MCU frequency. And this is for a single SoftwareSerial. Nevertheless,the ...
- Fri Jun 12, 2020 1:42 pm
- Forum: General discussion
- Topic: PWM + Encoder = Please Help :-)
- Replies: 13
- Views: 12723
Re: PWM + Encoder = Please Help :-)
STM32 Cube HAL is the StMicroelectronics official drivers. In you jroject you really need to distinguish 2 things: * PWM outuput. In your sketch it is done thanks to HardwareTimer library. This is very good. My proposal, in order to simply you things, is to use also use following function to update ...
- Fri Jun 12, 2020 12:52 pm
- Forum: General discussion
- Topic: PWM + Encoder = Please Help :-)
- Replies: 13
- Views: 12723
Re: PWM + Encoder = Please Help :-)
All API for HardwareTimer are detailed here: https://github.com/stm32duino/wiki/wiki/HardwareTimer-library#API You will found API to change period (Overflow) pulse duartion or duty cycle (CaptureCompare). No need to pause/resume timer for that (even if aPI exist if needed) You can also found some ha...
- Fri Jun 12, 2020 12:44 pm
- Forum: General discussion
- Topic: PWM + Encoder = Please Help :-)
- Replies: 13
- Views: 12723
Re: PWM + Encoder = Please Help :-)
Hi @GVisser, Unfortunately, HardwareTimer library doesn't support Encoder mode, but hardware support it: A timer can be used with 2 input signal from encoder, and timer counter will count according to encoder rotation (backward / forward). So one solution would be to use STM32 cube HAL API to benefi...