I have a B-G431B-ESC1 and AS5047p encoder with a 350w hoverboard motor. I need get some inputs to ESC from external arduino and As5047p. These are,
ESC A+ / PB6 → A Phase from Encoder (INPUT / Default)
ESC B+ / PB7 → B Phase from Encoder (INPUT / Default)
ESC Z+ / PB8 → Reserved for triggering external mosfet for braking resistor (OUTPUT / NOT DEFAULT)
ESC PWM / PA15 → PWM Input from arduino for setting required Torque value (INPUT / NOT DEFAULT)
I Think, these are ok, if not please warn me.
Now I need one more IO pin for sending direction signal from Arduino to ESC. It is Low / High only.
As I can see from pinout scheme, I have available some pins which are used for different purposes.
ESC CAN TX / PB9
ESC CAN RX / PA11
ESC USART2_TX / PB3
ESC USART2_RX / PB4
If there is more IO pins (solderable) exist, please warn me again.
I prefer to use CAN_RX or CAN_TX pins, not USART2 pins, because I may need them later / programing.
So the question is, can I use these free IO pins as a regular IO pins on a MCU , or special configuration is need ?
– ESC Z+ / PB8 pin as OUTPUN pin for triggering a mosfet
– ESC PWM / PA15 as PWM input for torque values from Arduino
any config changes or other things needed for ABOVE pins ?
I am using arduino ide + stm32duino pack and Simplefoc for Closed Loop Torque control.
Any help is appreciated.