I am working on a board to control a motor using a TB9051FTG motor controller chip. I would like to use a STM32F0304 to perform control of this motor.


I plan to power the TB9051FTG with 5V and the uC with 3.3V (already proved out the power supply for the uC). The four big questions I am asking at this point

  1. The PWM output voltage level will be 3.3V from the uC. Is this suitable to drive the PWM inputs on the TB9051FTG. Reading the datasheet I believe so, but can someone offer verification?
  2. How do I handle the diagnostic pin (DIAG)? TB provided this example schematic enter image description here

The motor vendors made a shield for Arduino that I am trying to refer to for guidance. They were good enough to provide their schematics. Big difference is their uC is running at 5V, where mine is running at 3.3V.

enter image description here

enter image description here

DIAG is going to be 5V level since that is what I'm going to be providing to the TB chip. I would think I need it to be 3.3V for the GPIO input? How did I accomplish this? I am guessing that resistor (5.1k in TB schematic, 10k in motor vendor schematic) is playing a role there?

  1. How do I handle the OCM output of the TB chip? Again, going to want it to be 3.3V-level input, correct?. Seems like I am going to be dealing with variable current input. TB provides this chart which shows OCM pin current response as a function of motor current draw. enter image description here

Looking at the motor vendor examples, it seems like they do an analogue read to probe the amount of current being drawn. In their schematic, M2OCM goes right to the uC. Isn't an analogue read going to read the voltage level on 0-5V basis (in case of 5V powered Arduino?) How is that circuit turning variable current from the chart into an intelligible voltage level for the uC? How should I handle this for a 3.3V-level ADC input on my ST uC?

  1. Lastly, I want to catch interrupts from vendor's Hall encoder that comes attached to the motor. I was able to to this reasonably well with Arduino and the vendor's shield. I don't have a strong feel for the electrical properties of the encoder, but I am guessing this will be similar to what I need to do for the DIAG pin? Looks like you can provide it 3.5V-20V (I will probably just do 5V) and its output will be whatever VCC is? enter image description here

I guess I need to level this down to 3.3V to create an input pin I can use to trigger interrupts?

I know this question is dragging on a bit, but any help on any of the parts is greatly appreciated!



Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.