I have a one off hobby project which involves taking a possibly irregular pulse train from a switch, debouncing it and generating a pulse train at a different frequency so than for any run,
N*count_in-M*count_out tends to zero and F_in/Fout ~ M/N.
(where M and N are integer constants for any run)
The maximum input pulse rate is less than 200 Hz and the duty cycle is between 10% and 50%.
The input(s) are on a PIC microcontroller with a 5 V supply and the output is via an optocoupler so no concerns there.
The fly in the ointment is the sensor generating the pulse train. It is a reed switch potted in a sensing head on the end of about 10 metres of normal two core PVC insulated mains flex IMMERSED IN SEAWATER, so it is absolutely critical that the sensing circuit is fully DC isolated from the vessels other systems to avoid electrolytic corrosion due to long term moisture permeation of the insulation and it would also be desirable to either sense with AC or reverse the polarity regularly for the same reason. Sensor replacement would be extremely difficult and avoiding sensor damage is top priority.
I had considered capacitive isolation of the sensor with the uC generating a sensing pulse on one lead and the return feeding a charge pump driving an uC input, but the resolution I need and the minimum contact closure time seems to require a minimum frequency of the order of 10 KHz and I have concerns about the cable self capacitance and capacitance to the water and interference from and to other equipment.
(Other equipment uses high amplitude pulsed 150 KHz and 200 Khz signals, and 4800 baud data. There is also a marine VHF tranceiver and a normal automotive alternator which may or may not be running while this device is operating. Any significant additional interference to VHF FM or AM (from LW broadcast band up to SW) radio reception is unacceptable.)
I am now considering an isolated DC-DC converter for the uC supply and connection of the sensor to two pins, with one driven low and the other used as the input with a pull-up. On every contact closure, the function of the two pins will swap after the debounce time which should average to no net DC through the sensor.
Obviously, series resistors and clamping diodes would be advisable, but the conflicting requirements of adequate margins on the logic levels, the output drive capabilities of a mid range Microchip PIC16F uC and the need to maintain an adequate current through the reed switch for reliability makes choosing a circuit configuration and component values more difficult than it would otherwise be.
If anyone has any suggested (online) reading for this type of problem or cares to post ASCII circuits or suggestions, their advice would be most welcome. I don't have any prior hands-on experience with CMOS input protection in an automotive environment, my constraints are somewhat non-standard and a quick Google gives over 50K results with little indication of where they stand on the scale from total garbage to overkill for a space rated application, so please be kind!
I cant get any binaries group so you'll need to put any binary files on the web somewhere for me to look at. I'd prefer to keep the discussion here initially rather than going to email as I find the consensus of opinion valuable. I'll be out of touch over the weekend so please don't expect any further input from me much before Monday.