Updated question, How to set PA15 to GPIO Output, and PWM questions...

Post here all questions related to LibMaple core if you can't find a relevant section!
stevestrong
Posts: 502
Joined: Fri Dec 27, 2019 4:53 pm
Answers: 8
Location: Munich, Germany
Contact:

Re: Updated question, How to set PA15 to GPIO Output, and PWM questions...

Post 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

Code: Select all

pwmWrite(pin, duty_cycle8 * 257)
instead of

Code: Select all

analogWrite(pin, duty_cycle8).
User avatar
Mangy_Dog
Posts: 92
Joined: Sat May 02, 2020 11:45 pm
Answers: 1

Re: Updated question, How to set PA15 to GPIO Output, and PWM questions...

Post by Mangy_Dog »

What should the timer channels be?
Just a dogs body developer, mostly making props and stuff...
stevestrong
Posts: 502
Joined: Fri Dec 27, 2019 4:53 pm
Answers: 8
Location: Munich, Germany
Contact:

Re: Updated question, How to set PA15 to GPIO Output, and PWM questions...

Post 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.
User avatar
Mangy_Dog
Posts: 92
Joined: Sat May 02, 2020 11:45 pm
Answers: 1

Re: Updated question, How to set PA15 to GPIO Output, and PWM questions...

Post by Mangy_Dog »

ohh stupid me
Just a dogs body developer, mostly making props and stuff...
User avatar
Mangy_Dog
Posts: 92
Joined: Sat May 02, 2020 11:45 pm
Answers: 1

Re: Updated question, How to set PA15 to GPIO Output, and PWM questions...

Post by Mangy_Dog »

Ok mostly working but PA1 and PA11 have stopped doing pwm... but not hanging
Just a dogs body developer, mostly making props and stuff...
stevestrong
Posts: 502
Joined: Fri Dec 27, 2019 4:53 pm
Answers: 8
Location: Munich, Germany
Contact:

Re: Updated question, How to set PA15 to GPIO Output, and PWM questions...

Post 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.
User avatar
Mangy_Dog
Posts: 92
Joined: Sat May 02, 2020 11:45 pm
Answers: 1

Re: Updated question, How to set PA15 to GPIO Output, and PWM questions...

Post 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 :/
Just a dogs body developer, mostly making props and stuff...
User avatar
Mangy_Dog
Posts: 92
Joined: Sat May 02, 2020 11:45 pm
Answers: 1

Re: Updated question, How to set PA15 to GPIO Output, and PWM questions...

Post 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
Just a dogs body developer, mostly making props and stuff...
stevestrong
Posts: 502
Joined: Fri Dec 27, 2019 4:53 pm
Answers: 8
Location: Munich, Germany
Contact:

Re: Updated question, How to set PA15 to GPIO Output, and PWM questions...

Post by stevestrong »

Be aware that PA11 is per default a USB pin.
User avatar
Mangy_Dog
Posts: 92
Joined: Sat May 02, 2020 11:45 pm
Answers: 1

Re: Updated question, How to set PA15 to GPIO Output, and PWM questions...

Post 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?
Just a dogs body developer, mostly making props and stuff...
Post Reply

Return to “General discussion”