I have two open-collector outputs, one from a PS2 keyboard and one from a DS3231 Real Time Clock.
I am, successfully, throwing an arduino ATMEGA1884p into sleep mode with a set_sleep_mode(SLEEP_MODE_PWR_DOWN);
However, I would like to raise it out of sleep mode by, either, pressing on the Ps-2 keyboard OR if the alarm 1 on the Real Time Clock goes off. Both seem to be an open collector output that is high, and is going to a low on interrupt (but I don't know if the keyboard already has a 5V pullup resistor on that line inside the keyboard).
Both intertupts are being called with a FALLING flag, such as the one in the PS2Keyboard.cpp file where it is calling: attachInterrupt(irq_num, ps2interrupt, FALLING);
I need to connect the SQW pin and the IRQ pin of the PS2 in some way in order that I get a Wired-OR condition (not an AND condition).
I would like to not use an OR gate.
I know I should be able to do such a thing by properly manipulating the interrupt to trigger on the RISING rather than the FALLING edge; and by using diodes in one of the two possible polarities tied to the interrupt on pin 2 (possibly using negative logic in some fashion, because a negative logic Wired-AND might do it).
If I connect the PS-2 Interrupt through a diode with the diode's line end towards the keyboard, it still works fine.
Anybody know what the right thing to do in such a case would be in order that both outputs properly trigger the Interrupt without using a logic gate?
Possibly the use of a pull-down resistor, turning off the pull up resistor on that INTERRUPT pin and putting it through diodes with the opposite polarity?
I have some 1N914 diodes to experiment with.