Page 2 of 4
Re: Updated question, How to set PA15 to GPIO Output, and PWM questions...
Posted: Wed Oct 14, 2020 1:01 pm
by stevestrong
You did not enter the correct timer channel values in the PIN_MAP table, position 5 of the rows.
The current value 0 can lead to
hang up.
Btw, you do not need to set the mode for PWM pins, it is set in the core when calling analogWrite() (see
here).
Or, as a faster alternative, you could set only once the pin mode to PWM in setup and then use
instead of
Re: Updated question, How to set PA15 to GPIO Output, and PWM questions...
Posted: Wed Oct 14, 2020 1:35 pm
by Mangy_Dog
What should the timer channels be?
Re: Updated question, How to set PA15 to GPIO Output, and PWM questions...
Posted: Wed Oct 14, 2020 1:45 pm
by stevestrong
stevestrong wrote: Wed Oct 14, 2020 12:01 pm
If you want to use those pins for PWM you have to manually add the info for each pin into the table:
PB4: TIM3 CH1 (like PA6)
PB5: TIM3 CH2 (like PA7)
PA15: TIM2 CH1 (like PA0)
1 for CH1, 2 for CH2.
Re: Updated question, How to set PA15 to GPIO Output, and PWM questions...
Posted: Wed Oct 14, 2020 1:55 pm
by Mangy_Dog
ohh stupid me
Re: Updated question, How to set PA15 to GPIO Output, and PWM questions...
Posted: Wed Oct 14, 2020 2:03 pm
by Mangy_Dog
Ok mostly working but PA1 and PA11 have stopped doing pwm... but not hanging
Re: Updated question, How to set PA15 to GPIO Output, and PWM questions...
Posted: Wed Oct 14, 2020 2:24 pm
by stevestrong
That is normal, since you have remapped the timer pin which was previously mapped to PA0.
If you check table 45 in RM0008 page 178 you will see that by remapping timer 2 channel 1 from PA0 to PA15, the timer 2 channel 2 was also automatically remapped from PA1 to PB3.
This is a HW restriction which you have to live with.
However, PA11 (TIM1_CH4) should remain unaffected from these remappings.
Re: Updated question, How to set PA15 to GPIO Output, and PWM questions...
Posted: Wed Oct 14, 2020 2:48 pm
by Mangy_Dog
well for some reason PA11, there is a PWM going on but its in the mV... The full high and low is still working on that pin so i dont think its a dead pin...
Ive also just tested on another board and getting the same thing on PA11...
As For PA1, what are my options? I need PWM control on that pin as well :/
Actually I just isolated PA11 pwm control, and there isnt a mV reading on it any more... I think that might have been noise :/
PA11 not working at all in PWM now. Even with the original pin map :/
Re: Updated question, How to set PA15 to GPIO Output, and PWM questions...
Posted: Wed Oct 14, 2020 3:14 pm
by Mangy_Dog
Ok I guess i can just hotwire PB1 to PA1 and use that pin as that still works... Gah two hotwires....... not happy but at least that would work.
Also PA11 is still not behaving :/ Last thing i need to sort out
Re: Updated question, How to set PA15 to GPIO Output, and PWM questions...
Posted: Wed Oct 14, 2020 5:19 pm
by stevestrong
Be aware that PA11 is per default a USB pin.
Re: Updated question, How to set PA15 to GPIO Output, and PWM questions...
Posted: Wed Oct 14, 2020 5:33 pm
by Mangy_Dog
I took out USB serial in the stlink upload option in the boards.txt file. Is there anything else i need to do?