I have encountered a problem that I am unsure how to solve.
As shown in the image at the bottom of the question, I have an FPGA (Nexys A7-100T) that generates signal to run a motor connected to a L298N motor driver. The FPGA signals are forward, reverse and a 20kHz PWM signal. However as the FPGA outputs are 3.3V max and the L298N requires 5V inputs, I have used a BSS138 bi-directional FET level shifter board.
This system works perfect without the PWM signal connected to the BSS138. When the enable jumper is in the L298N and the forward or reverse input is high, the motor runs at full speed.
But when I try to use the PWM signal through the BSS138 to the L298N, all the 5V outputs sit at the same voltage as the PWM channel, which is around 2.5v (The PWM signal has a 50% duty cycle).
Is this BSS138 not suitable for PWM signals?
Or what is my mistake here?
Below is an image of the BSS138 level shifter board used:
Below is an image of the L298N board used: