Re: How to cope with common mode exceeding supply rails in R
Hi,
for the input, you can limit the voltage by a series resistor and 2 diodes against VDD & GND (standard CMOS input protection, but a higher resistor value, probably).
For the output (if 0 to 5V output isn't enough) you will need either an external driver, or a CMOS process that can cope with a voltage of 20 .. 25V.
I suggest to consult the datasheets of industry standard RS485 drivers and receivers, how they handle the problem. Usually, the said common mode range is considered by voltage dividers at the receiver side, so the receivers are operational over the full common mode range. The drivers in contrast are simply disconnected by series diodes, if an external applied voltage goes beyond the rails.
Humungus, due to this common mode range your receiver should have the same input common mode range. It can be easily done with voltage divider on input (to ground or to any internal reference). Resistance of voltage divider is related with number (N) of units of load (N=1 in standart, but many companies do N=8 which allows to connect more receivers on one line). Be care after attenuation the requirement to offset of comparator will increase.
This common mode range also mean that driver should be desined as high voltage tolerant buffer with current limitation at short circuit condition. To make it either you have diodes in your process with allowed forward bias or make a very complex circuit and risky design.