K8059 and optocoupler

Hello,
I would like to replace one switch of my K8059 by an optocoupler. That means pin 7 or pin 6, of the microprocessor will receive about 12 v in standby mode and about 0.6 volts when the optocoupler is on.
I think it is possible, but I need an advice in order to avoid the burn-out the microprocessor.
Thanks in advance for helping me.
Pierre46

Please note that the controller is a 5V device, so 12V will destroy it.

Hello,
Thanks for your reply. If instead 12 volts, I use 5 volts to supply my optocoupler, does it works without damage ?
General speaking, does pin 6 and 7 accepte positive voltage ?
Best regards
Pierre46

As long as the voltage at the input does not swing beyond +5V, it is fine.
What confuses us: the output of an optocoupler is an open collector, there is no voltage coming out of an optocoupler output ??

Hello,
Many Thanks for your reply. It should work with an optocoupler with a pull-up resistor. When diode IF current of the optocoupler is zero, the transistor part don’t conduct then the pin of the micro processor connected to the collector is at Vdd. When IF current is > 0, the transistor part conduct and the pin is at VCE_SAT about 0.6 volt because the emitter is connected to the ground.Then the optocoupler should work as a switch.
Best regards
Pierre46
PS Sorry, I don’t know how to add a schema in a post

Yes, that is correct.
As long as you pull it up to the +5V it should work fine.

Feedback to VL417
Hello,
Thanks for your help. I tried succesfully to command my k8059 with an optcoupler 4n35 with 3 volts external power supply. It works but some precaution should be taken
1- Do not replace switch 1 by a connections, because, (I guess), interference with the oscillator. It works depending on the connection lenght therefore that is risky
2- I connect pin 7 of 12f629 (used by the switch 2) with a short wire to an external connector of my new box. Connection to the optocoupler inteface was be made wiith a shielded cable. It is mandatory otherwise, led should blink without result.
Best regards
Pierre46