I am counting the pulse edges from a quadrature encoder with an FPGA and using opto-couplers as the encoder is powered with 12V and the FPGA inputs are 3.3V. The encoder is 1000ppr with 2 channels and I count both the rising and falling edges.
The opto-couplers are ILD74 (Link to ILD74 datasheet) and the inputs to the FPGA are pulled up with 10K resistors, like in the image at the bottom of the question. The FPGA inputs go through inverters to match up with the encoder outputs, as an encoder pulse pulls the FPGA input to ground.
So I am unsure if these opto-couplers switch fast enough. The encoder will run at max 4500rpm, so per channel this is an output frequency of roughly 75kHz (1000ppr * 4500rpm) / 60 = 75,000.
The ILD datasheet has a ton-toff switching times of typically 3us which is over 300kHz, so I think these opto-couplers should be ok?
Also I'm interested to hear if anyone has any recommendations to this circuit or any advice as to how encoder outputs are connected to microcontrollers / FPGAs in general.
I have added the output of my encoder at approx 5000rpm. The output frequency is around 85kHz.
I am waiting for parts to arrive and I will get back if I have anymore questions. I will close the post when I get the problem working. Thanks everyone!