Signal converting circuit

A signal converting circuit includes a voltage level converter circuit, a power circuit, a signal separation circuit, a signal modifying circuit, and a clamping circuit. The power circuit provides voltage to the signal modifying circuit and the voltage level converter circuit. The voltage level converter circuit converts signals from the RS232 interface to I2C interface compliant signals. When the I2C interface transmits signal to the RS232 interface, the signal separation circuit separates signal from the RS232 interface into two separate signals. The signal modifying circuit receives controlling signals sent from the RS232 interface and modifies the signals into a standard square wave signal, the modified standard square wave signal is sent to the clamping circuit. The clamping circuit clamps the voltage level of the signal according to the level that the I2C interface accepts.

BACKGROUND OF THE INVENTION

1. Field of the Invention

The present invention relates to signal converting circuits, and more particularly to a signal converting circuit which can interconvert RS232 (also know as EIA232) signals with I2C signals.

2. General Background

I2C (Inter-Integrated-Circuit) is a low-bandwidth, short-distance, two-wire interface for communication amongst ICs and peripherals. I2C was defined by Philips Semiconductor in the early 1980's. The BUS physically consists of 2 active wires and a ground connection. The active wires, SDA and SCL, are both bidirectional. Where SDA is the serial data line and SCL is the serial clock line. But if the transfer distance is too long, the I2C signal may suffer distortion or possibly not be received by a receiver. The RS232 model allows long distance data transmission up to 1000 meters. To obtain the advantages of long distance transmission of signals, a converting circuit is required for converting the signal from the I2C interface to the RS232 interface at the sending end and converting the signal from the RS232 interface to the I2C interface at the receiving end.

What is needed is a signal converting circuit which can interconvert RS232 signals with I2C signals.

SUMMARY

An exemplary signal converting circuit adapted for converting RS232 signals into I2C signals and vice versa, the signal converting circuit includes a voltage level converter circuit, a power circuit, a signal separation circuit, a signal modifying circuit, and a clamping circuit. The voltage level converter circuit has a first input end connected to an SDA line of an I2C interface, and an output end connected to a receiving pin of an RS232 interface. The power circuit has an input end connected to a request-to-send pin of the RS232 interface and a power supply respectively, and an output end connected to a second input end of the voltage level converter circuit. The signal separation circuit separates a signal into two separate signals, and an input end of the separation circuit is connected to a transmitted data pin of the RS232 interface. The signal modifying circuit has a first input end connected to a first output end of the signal separation circuit, a second input end connected to the output end of the power circuit, and a controlling end connected to the request-to-send pin of the RS232 interface. The clamping circuit has a first end connected to the second output end of the signal separation circuit, a second output end connected to the output end of the signal modifying circuit, a first output end connected to the SDA line of the I2C interface and the second output end connected to an SCL line of the I2C interface. The clamping circuit limits the signals sent from the signal separation circuit and the signal modifying circuit to the specific voltage of the SDA line and SCL line.

It is simple and economical to use the signal converting circuit to convert RS232 signals into I2C signals and vice versa.

DETAILED DESCRIPTION OF THE EMBODIMENT

Referring toFIG. 1, a signal converting circuit in accordance with a preferred embodiment of the present invention is shown. A signal converting circuit1is for interconverting RS232 signals with I2C signals. A RS232 interface includes a first pin31, a second pin32, a third pin33, and a fourth pin34. The first pin31is coupled to a voltage to provide power to the signal converting circuit1. The second pin32is a transmitted data pin, the third pin33is a received data pin, and the fourth pin34is a request-to-send (RTS) pin. The fourth pin34provides power to the signal converting circuit1when the RS232 interface3sends RTS signals to the I2C interface2. In this embodiment the signal converting circuit1obtains power from the first pin31and the fourth pin34of the RS232 interface3.

The signal converting circuit1includes a voltage level converter circuit10, a power circuit11, a signal separation circuit12, a signal modifying circuit13, and two clamping circuits14,15.

The first and fourth pins31,34of the RS232 interface3are connected to two inputs of the power circuit11consecutively, and the fourth pin34is also connected to an input of the signal modifying circuit13, and the second pin32is connected to an input of the signal separation circuit12. Output of the power circuit11is separately connected to inputs of the signal modifying circuit13and the voltage level converter circuit10. An output of the signal modifying circuit13is connected to an input of the clamping circuit15. An output of the clamping circuit15is connected to an SCL line of the I2C interface2. Outputs of the signal separation circuit12are connected to inputs of the signal modifying circuit13and the clamping circuit14consecutively. An output of the clamping circuit14is connected with an SDA line of the I2C interface2. The SDA line of the I2C interface2is also connected to an input of the voltage level converter circuit10. An output of the voltage level converter circuit10is connected to the third pin33of the RS232 interface3. The SDA line can send and receive signals, while the SCL line receives signals only.

Referring toFIG. 2, when the I2C interface2sends signals to the RS232 interface3, the second pin32and the fourth pin34are not active. The voltage level converter circuit10converts the signals that are received by the SDA line into RS232 interface3compliant signals, then the converted signals are transmitted to the third pin33of the RS232 interface3. The power circuit11provides voltage to the voltage level converter circuit10.

Referring toFIG. 3, when the RS232 interface3transmits signals to the I2C interface2, the fourth pin34provides voltage to the power circuit11, and the fourth pin34is also connected to the signal modifying circuit13to control the working status of the signal modifying circuit13. The second pin32of the RS232 interface3transmits signals to the signal separation circuit13. The signal separation circuit13separates the signals into two same frequency signals to send to the signal modifying circuit13and the clamping circuit14respectively. The clamping circuit14clamps the voltage level of the signal according to the level that the SDA line accepts, then sends the signals to the I2C interface2via the SDA line. The signal modifying circuit13receives controlling signals from the RS232 interface3via the fourth pin34, modifies the signal from the signal separation circuit12into a standard square wave signal, the modified standard square wave signal is sent to the clamping circuit15. The clamping circuit15clamps the voltage level of the signal according to the level that the SCL line accepts, then the signals are sent to the I2C interface2via the SCL line. The power circuit11provides voltage to the signal modifying circuit13.

Referring toFIG. 4, a detailed circuit diagram is shown according to the present invention. The voltage level converter circuit10includes a transistor Q1, two resistors R1and R2, and a capacitor C1. An end of the resistor R1is the input end of the voltage level circuit10, and is connected to the SDA line of the I2C interface2. Another end of the resistor R1is connected to the gate of the transistor Q1. The source of the transistor Q1is grounded. The drain of the transistor Q1is connected to an end of the resistor R2. The output end of the voltage level converter circuit10is at a node between the drain of the transistor Q1and the resistor R2and is connected to the third pin33of the RS232 interface3. Another end of the resistor R2is the other input end of the voltage level converter circuit10and connected to the power circuit11. An end of the capacitor C1is grounded, and the other end of the capacitor C1is connected to a drain of the transistor Q1. The power circuit11includes a diode D4, a diode D5, and a capacitor C2. An anode of the diode D4is connected to the fourth pin34of the RS232 interface3, and a cathode of the diode D4is connected to the resistor R2of the voltage level converter circuit10. An anode of the diode D5is connected to the first pin31of the RS232 interface3, and a cathode of the diode D5is connected to the resistor R2of the voltage level converter circuit10. An end of the capacitor C1is grounded, and the other end of the capacitor C1is connected to the cathode of the diode D5.

The signal separation circuit12includes a resistor R3and a diode D3. An end of the resistor R3is coupled to the second pin32of the RS232 interface3, the other end of the resistor R3is the output end of the signal separation circuit12and connected to the clamping circuit14. An anode of the diode D3is connected to the second pin32of the RS232 interface3, and the other end is the output end of the signal separation circuit12and is connected to the signal modifying circuit13. The signal modifying circuit13includes a resistor R4, a resistor R5, and a transistor Q2. An end of the resistor R4is coupled to the fourth pin34of the RS232 interface3, the other end of the resistor R4is connected to a gate of the transistor Q2. A source of the transistor Q2is grounded, a drain of the transistor Q2is connected to an end of the resistor R5, and the other end of the resistor R5is connected to the cathode of the diode D3of the signal separation circuit12. The clamping circuit14is a zener diode D1, an anode of the zener diode D1is grounded, and a cathode of the zener diode D1is connected to the SDA line and the resistor R3of the signal separation circuit12. The clamping circuit15is a zener diode D2, an anode of the zener diode D2is grounded, and a cathode of the zener diode D2is connected with the SCL line of the I2C interface2and the drain of the transistor Q2of the signal modifying circuit13.

When the I2C interface2transmits signals to the RS232 interface3, the second pin32and the fourth pin34of the RS232 interface3do not work. The first pin31is connected to a voltage, the diode D5is turned on, the voltage of the cathode of the diode D5is at a high level. Signals from the SDA line of the I2C interface2are sent to the gate of the transistor Q1via the resistor R1which limits the current flow to the gate of the transistor Q1. When the signal sent from the I2C interface2is at a low level, the transistor Q1is turned off, the voltage of the drain of the transistor Q1is equal to the voltage of the cathode of the diode D5, that is at a high level, so the voltage of the third pin33of the RS232 interface is at a high level. When the signal sent from the I2C interface2is at a high level, the transistor Q1is turned on, the voltage of the drain of the transistor Q1is at a low level, so the voltage of the third pin33of the RS232 interface is at a low level. The capacitor C1is for wave filtering.

When the RS232 interface3transmits signals to the I2C interface2, the signals are transmitted to a node between the resistor R3and the diode D3then are separated and follow two paths: one is transmitted to the resistor R3, the other transmitted to the diode D3. A signal is sent to the cathode of the zener diode D1of the clamping circuit14via the resistor R3which limits the current flow to the zener diode D1. If the signal transmitted to the zener diode D1is at a high voltage, the zener diode D1clamps the high voltage to an SDA line's specific voltage, and the signal is then sent to the SDA line. If the signal transmitted to the zener diode D1is at a low voltage, the low voltage signal is sent to the SDA line directly. In this way, the signal from the RS232 interface3is transmitted to the I2C interface2.

When the signal sent to the diode D3is high voltage, the diode D3is turned on, the cathode of the diode D3is at high level, at this time, if the signal sent from the fourth pin34is at a high level, the transistor Q2is turned on, so the signal transmitted to the SCL line is at a low level. If the signal sent from the fourth pin34is at a low level, the transistor Q2is turned off, the high voltage at the cathodes of the diodes D3and D5is sent to the cathode of the zener diode D2via the resistor R5. The high voltage is higher than the avalanche voltage of the zener diode D2, the zener diode D2clamps the high voltage to an SCL line's specific voltage, and the signal is then sent to the SDA line.

When the signal sent to the diode D3is low voltage, the diode D3is turned off, at this time, if the signal sent from the fourth pin34is at a high level, the transistor Q2is turn on, so the signal transmitted to the SCL line is at a low level. If the signal sent from the fourth pin34is at a low level, the transistor Q2is turned off, the high voltage at the cathode of the diode D5is sent to the cathode of the zener diode D2via the resistor R5. The high voltage is higher than the avalanche voltage of the zener diode D2, the zener diode D2clamps the high voltage to an SCL line's specific voltage, and the signal is then sent to the SDA line.

It is believed that the present embodiment and its advantages will be understood from the foregoing description, and it will be apparent that various changes may be made thereto without departing from the spirit and scope of the invention or sacrificing all of its material advantages, the example hereinbefore described merely being a preferred or exemplary embodiment of the invention.