I connected STM32 F334R8 microcontroller to L298 H-bridge. I made some measurements. The problem is output signal on L298 has quite slow slopes and is not as sharp as input signal. I do not understand why the distortion occurs. As you can see the frequency is very low - only 10 Hz.
Pink color = L298 output signal,
Yellow color = L298's Enable pin (STM32's PWM output),
Green color = L298's Input 1 (STM32's output),
Blue color = L298's Input 2 (STM32's output),
Input 1 and Input 2 determine direction of output current.
Also when we increase the frequency of PWM to 25 kHz and change duty cycle dynamically to achieve stepped sinusoidal signal, then output not always follows the input:
Not sure are the distortions showed on 1 and 2 related.
Note 1: Oscilloscope waveform acquire is in Hi-Res to average signals.
Note 2: On PWM output (yellow) I am generating abs(stepped_sin(x)). Then to make stepped_sin() on the L298 output I am changing Input 1 and Input 2 (just inverting current direction).
I'm just curious what's the reason of such strange behavior.
L298 logic supply voltage is 5 V, power supply voltage is 8 V. Output load is 4Ω power resistor.
I have already checked L298 datasheet and typical PWM switching frequency is 25 kHz. Also input's logical high starts with 2.3 V. My microcontroller uses 3.3 V logic so it should be sufficient, isn't it?