Looks like U3 causes increased rise time both times they feed through the chip. Possibly a counterfeit TI chip as the specifications for the real chip is a max of 12.5ns from low to high with a max propagation delay of 50ns. It is also possible that C140 is making the problem worse.
U3 pin 5(from 328p MOSI pin), 33.81ns rise:
U3 Pin 13, 2.26us rise:
U3 Pin 11(to Spindle PWM Pin), 13.94us rise:
It’s worth noting that these findings are intriguing, particularly in light of C3D’s previous statement about the need for signal conditioning from the spindle port due to optocoupler use. However, it’s important to highlight that a properly specified optocoupler should not necessitate signal conditioning, and if anything, it should already condition the signal with a Schmitt trigger.
The post I am referencing above can be found here: