Hello Every and One!
I’m using a custom board based on STM32F103RB chip with developer version of STM32 Arduino wth core STM32Duino (it is here GitHub - platformio/platform-ststm32: ST STM32: development platform for PlatformIO). Using genericSTM32F103RB as a board.
I have two problems that seems to be connected:
-
I can’t do analogWrite to PA4 and PA5 pins. If I set them via analogWrite to something less than 2000 items (I use 12 bit resolution) than I receive zero PWM, if I set the value to something more than 2000 then I receive 100% of load. PA4 is physical pin 20 and PA5 is 21. As I understand analogWrite works with Arduino analog enabled pins and/or with hardware PWM supported pins. It seems that PA4 and PA5 are HW-supported but their behaviour more looks like digital pin. The behaviour is the same regardless to pinMode(PA4, OUTPUT).
What can be wrong and/or shall I use PWM_start routine from analog.h? -
I can’t do analogRead from pins PA6 and PA7. Actually I can do analogRead from them but I always receive 4095 and 2017 values (12bit resolution) from these two pins whatever I connect to them. At the same time I receive correct values from the same sketch and the same board but from PB0 and PB1.
What can be wrong? Pin mapping? How can I check the mapping? I assume that PA6 is 22 HW-pin and PA7 is 23.