Hello! I was trying to measure the rotation angle (of the motor) with encoders, on Teensy 4.1. The mistake was to feed the encoders with 5V power, and send encoder output to teensy pins. (Encoders needed at least 4 volts). Teensy survived though, maybe due to thin and long wires. And "standard" _Encoders_ library worked and counted approximately correct rotation. Then I added this logic level shifter https://www.pololu.com/product/2595 . to make 3.3 volts from 5 volts, and looks like it worked again somehow.
But based on this thread, https://forum.pjrc.com/threads/26803-Hardware-Quadrature-Code-for-Teensy-3-x?p=74544&viewfull=1#post74544 this kind of logic Logic Level Shifter are not OK for those tasks. But they (Pololu) claimed that it could be OK for 400 kHz I2C. And encoder signal maximum frequency in my case is less then 12 kHz. So what are good alternatives to those MOSFET logic shifters? I'm asking because the original thread about this is old. Or, maybe current MOSFET solution works OK? Then how to check if everything works fine and I'm not missing pulses because of this MOSFET hardware?
Another question: for two 12 kHz frequency encoder signals, is it OK to use "Encoder" library (using interrupts) or better to use "QuadEncoder" which may be probably faster?
Best regards!
But based on this thread, https://forum.pjrc.com/threads/26803-Hardware-Quadrature-Code-for-Teensy-3-x?p=74544&viewfull=1#post74544 this kind of logic Logic Level Shifter are not OK for those tasks. But they (Pololu) claimed that it could be OK for 400 kHz I2C. And encoder signal maximum frequency in my case is less then 12 kHz. So what are good alternatives to those MOSFET logic shifters? I'm asking because the original thread about this is old. Or, maybe current MOSFET solution works OK? Then how to check if everything works fine and I'm not missing pulses because of this MOSFET hardware?
Another question: for two 12 kHz frequency encoder signals, is it OK to use "Encoder" library (using interrupts) or better to use "QuadEncoder" which may be probably faster?
Best regards!