KR0175563B1 - Clock line check device of I2C bus - Google Patents

Clock line check device of I2C bus Download PDF

Info

Publication number
KR0175563B1
KR0175563B1 KR1019960037432A KR19960037432A KR0175563B1 KR 0175563 B1 KR0175563 B1 KR 0175563B1 KR 1019960037432 A KR1019960037432 A KR 1019960037432A KR 19960037432 A KR19960037432 A KR 19960037432A KR 0175563 B1 KR0175563 B1 KR 0175563B1
Authority
KR
South Korea
Prior art keywords
clock
clock line
bus
line
cpu
Prior art date
Application number
KR1019960037432A
Other languages
Korean (ko)
Other versions
KR19980017639A (en
Inventor
정성학
Original Assignee
배순훈
대우전자주식회사
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by 배순훈, 대우전자주식회사 filed Critical 배순훈
Priority to KR1019960037432A priority Critical patent/KR0175563B1/en
Publication of KR19980017639A publication Critical patent/KR19980017639A/en
Application granted granted Critical
Publication of KR0175563B1 publication Critical patent/KR0175563B1/en

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/22Detection or location of defective computer hardware by testing during standby operation or during idle time, e.g. start-up testing
    • G06F11/2205Detection or location of defective computer hardware by testing during standby operation or during idle time, e.g. start-up testing using arrangements specific to the hardware being tested
    • G06F11/221Detection or location of defective computer hardware by testing during standby operation or during idle time, e.g. start-up testing using arrangements specific to the hardware being tested to test buses, lines or interfaces, e.g. stuck-at or open line faults

Landscapes

  • Engineering & Computer Science (AREA)
  • General Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Computer Hardware Design (AREA)
  • Quality & Reliability (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Debugging And Monitoring (AREA)

Abstract

본 발명은 타이머를 사용하여 I2C 버스상에서 클럭 라인의 이상 유무를 점검하는 I2C 버스의 클럭 라인 점검 장치에 관한 것으로, I2C 버스의 데이타 라인(SDA)와 클럭 라인(SCL)을 통해 전송되는 신호를 검출하여 데이타 전송의 시작 및 종결 상태를 나타내는 시작 및 종결 조건을 검출하는 시작 및 종결 조건 검출 수단(100) ; 상기 시작 및 종결 조건 검출 수단(100)으로 부터 출력되는 신호에 따라 클럭 라인의 상태를 점검하도록 제어하는 CPU(200) ; 및 상기 CPU(200)의 제어에 따라 상기 I2C 버스의 클럭 라인(SCL)의 상태를 감지하여 상기 클럭 라인(SCL)이 일정한 상태를 일정 기간 이상 유지하는 경우 상기 CPU(200)로 인터럽트를 출력하는 클럭 라인 상태 감지 수단(300)으로 구성된다.The present invention relates to an I 2 C bus clock line check apparatus for checking whether a clock line is abnormal on an I 2 C bus by using a timer, and a data line (SDA) and a clock line (SCL) of an I 2 C bus A start and end condition detecting means (100) for detecting a start and end condition indicating a start and end condition of data transmission by detecting a signal transmitted through the start and end condition of data transmission; A CPU (200) for controlling the state of the clock line according to a signal output from the start and end condition detecting means (100); And the CPU 200 senses the state of the clock line SCL of the I 2 C bus and interrupts the CPU 200 if the state of the clock line SCL is maintained for a predetermined period or longer And a clock line state detecting means 300 for outputting the clock line state.

따라서 본 발명은 I2C 버스상에서 클럭 라인의 이상 상태를 점검하여 클럭 라인의 구동을 방지하여 전송 데이타의 에러 발생을 막고, 신속하게 클럭 라인을 복구시켜 전송 효율을 향상시키는 효과가 있다.Therefore, the present invention has an effect of improving transmission efficiency by preventing an error of transmission data and restoring a clock line by preventing an operation of a clock line by checking an abnormal state of a clock line on an I 2 C bus.

Description

I2C 버스의 클럭 라인 점검 장치Clock line check device of I2C bus

본 발명 I2C 버스상에서 클럭 라인의 이상 유무를 점검하는 I2C 버스의 클럭 라인 점검 장치에 관한 것이다.The present invention relates to a clock line of the I 2 C bus checking device that checks the presence of error in the clock on the line I 2 C bus.

일반적으로 I2C 버스는 제1도에 도시한 바와 같이 각 부분(A, B, C, D), 예를 들어 CPU, 메모리, I/O 기기간의 데이타 전송을 위해 사용하는 데이타 선로로, 2개의 선, 즉 데이타와 클럭을 각각 전송하는 2개의 선으로 통신이 가능하다. 또한, I2C 버스에 연결된 기기는 소프트웨어적으로 접근이 가능하고 다중 마스터가 동시에 같은 버스에 존재할 수 있다. 즉, I2C 버스에 연결된 각 부분(A, B, C, D)은 클럭을 발생하게 되면 모두 마스터가 될 수 있다.Generally, the I 2 C bus is a data line used for data transfer between each part (A, B, C, and D), for example, a CPU, a memory, and an I / O device as shown in FIG. Two lines transmitting data and clock, respectively. Devices connected to the I 2 C bus are also software accessible and multiple masters can be on the same bus at the same time. In other words, each part (A, B, C, D) connected to the I 2 C bus can become a master when a clock is generated.

예를 들어, 한 부분(A)이 클럭을 발생하여 마스터가 되면 나머지 부분(B, C, D)은 슬레이브가 되고, 다른 한 부분(B)이 클럭을 발생하여 마스터가 되면 나머지 부분(A, C, D)은 슬레이브가 되고, 또 다른 한 부분(C)이 클럭을 발생하여 마스터가 되면 나머지 부분(A, B, D)은 슬레이브가 되고, 또 다른 한 부분(D)이 클럭을 발생하여 마스터가 되면 나머지 부분(A, B, C)은 슬레이브가 된다.For example, when a part A generates a clock and becomes a master, the remaining parts B, C, and D become slaves. When the other part B generates a clock and becomes a master, C and D becomes a slave and another part C generates a clock and becomes a master, the remaining parts A, B and D become a slave and another part D generates a clock When it becomes master, the remaining parts (A, B, C) become slave.

또한, I2C 버스는 100Kbps에서 400Kbps 까지 데이타 전송이 가능함져 캐패시터가 400pF를 초과하지 않는 한도내에서 다수의 기기(A, B, C, D)가 동일 버스에 연결될 수 있다.In addition, the I 2 C bus can transmit data from 100 Kbps to 400 Kbps, so that multiple devices (A, B, C, and D) can be connected to the same bus as long as the capacitor does not exceed 400 pF.

I2C 버스는 2개의 라인, 즉 데이타를 전송하는 하나의 데이타 라인(SDA)와 클럭을 전송하는 하나의 클럭 라인(SCL)으로 이루어진다. 따라서 마스터에서 클럭 라인(SCL)을 통해 클럭을 전송하면 슬레이브에서는 클럭 라인(SCL)을 통해 전송된 클럭에 동기되어 데이타 라인(SDA)을 통해 데이타를 전송하거나 수신하게 된다.The I 2 C bus consists of two lines: one data line (SDA) for transmitting data and one clock line (SCL) for transmitting the clock. Therefore, when the master transmits the clock through the clock line SCL, the slave transmits or receives data through the data line SDA in synchronization with the clock transmitted through the clock line SCL.

그런데, 잡음이나 마스터 또는 슬레이브의 상태에 의해 I2C 버스의 클럭 라인(SCL)에 스투크(Stuck) 현상이 발생할 수 있다. 즉, 잡음이나 마스터 또는 슬레이브의 상태에 의해 정상적인 클럭 라인의 상태가 아닌 경우가 발생될 수 있다.However, a stuck phenomenon may occur in the clock line (SCL) of the I 2 C bus due to a noise or a state of a master or a slave. That is, there may be a case where the state of the clock line is not normal due to the noise or the state of the master or the slave.

특히 I2C 버스는 와이어드 앤드(Wired AND)이므로 마스터 또는 슬레이브의 상태가 '0'이 되면 I2C 버스로의 클럭 전송이 어려워지고 이에 따라 전송 오류가 발생하게 되는 문제점이 있었다.In particular, since the I 2 C bus is wired AND, when the state of the master or the slave is '0', it is difficult to transmit clocks to the I 2 C bus, thereby causing a transmission error.

상기 문제점을 개선하기 위한 본 발명은 타이머를 이용하여 I2C 버스의 클럭 라인의 상태를 점검하여 I2C 버스의 클럭 라인이 항상 정상 동작을 할 수 있도록 하기 위한 I2C 버스의 클럭 라인 점검 장치를 제공함에 그 목적이 있다Present invention to improve the above problems by using a timer, I 2 C bus to check the status of the clock line and the clock line of the I 2 C bus for allowing the clock line of the I 2 C bus is always to be a normal operation check The purpose is to provide a device

제1도는 일반적인 I2C 버스의 구조도.FIG. 1 is a schematic diagram of a general I 2 C bus. FIG.

제2도는 본 발명에 의한 클럭 라인 점검 장치의 구성도.FIG. 2 is a block diagram of a clock line checking apparatus according to the present invention; FIG.

제3도는 시작 조건 및 종결 조건을 설명하기 위한 신호 파형도.FIG. 3 is a signal waveform diagram for explaining a start condition and a termination condition; FIG.

제4도는 본 발명의 동작을 설명하기 위한 흐름도.FIG. 4 is a flow chart for explaining the operation of the present invention; FIG.

제5도는 제2도의 시작 및 종결 조건 검출부의 세부 구성도.FIG. 5 is a detailed configuration diagram of the start and end condition detection unit of FIG. 2; FIG.

제6도는 제2도의 클럭 라인 검사부의 세부 구성도.FIG. 6 is a detailed configuration diagram of a clock line checking unit of FIG. 2;

* 도면의 주요부분에 대한 부호의 설명DESCRIPTION OF THE REFERENCE NUMERALS

100 : 시작 및 종결 조건 검출부 200 : CPU100: start and end condition detection unit 200: CPU

300 : 클럭 라인 상태 감지부 310 : 클럭 라인 검사부300: clock line state detection unit 310: clock line check unit

320 : 타이머 330 : 내부 클럭 발생부320: Timer 330: Internal clock generator

331 : 프리스케일러 332 : 진동자331: Prescaler 332: Oscillator

335 : I2C 제어기 410, 420, 430, 450, 530 : 비교기335: I 2 C controller 410, 420, 430, 450, 530: comparator

440 : 인버터 510, 520 : 플립플롭440: inverter 510, 520: flip-flop

본 발명은 I2C 버스상에서 클럭 라인의 이상 유무를 점검하는 I2C 버스의 클럭 라인 점검 장치에 관한 것이다.The present invention relates to a clock line of the I 2 C bus checking device that checks the presence of error in the clock on the line I 2 C bus.

상기 목적을 달성하기 위해 본 발명에 의한 I2C 버스의 클럭 라인 점검 장치는 I2C 버스의 데이타 라인과 클럭 라인을 통해 전송되는 신호를 검출하여 데이타 전송의 시작 및 종결 상태를 나타내는 시작 및 종결 조건을 검출하는 시작 및 종결 검출 수단 ; 상기 시작 및 종결 조건 검출 수단으로 부터 출력되는 신호에 따라 클럭 라인의 상태를 점검하도록 제어하는 CPU ; 및 상기 CPU의 제어에 따라 상기 I2C 버스의 클럭 라인의 상태를 감지하여 상기 클럭 라인이 일정한 상태를 일정 기간 이상 유지하는 경우 상기 CPU로 인터럽트를 출력하는 클럭 라인 상태 감지 수단을 포함하여 구성됨을 특징으로 한다.In order to achieve the above object, an I 2 C bus clock line checking apparatus according to the present invention detects a signal transmitted through a data line and a clock line of an I 2 C bus, Start and end detection means for detecting a condition; A CPU for controlling the state of the clock line according to a signal output from the start and end condition detection means; And a clock line state detecting unit for detecting a state of a clock line of the I 2 C bus under the control of the CPU and outputting an interrupt to the CPU when the clock line maintains a predetermined state for a predetermined period or longer .

이하 첨부한 도면을 참조하여 본 발명의 실시예를 상세히 설명한다.Hereinafter, embodiments of the present invention will be described in detail with reference to the accompanying drawings.

본 발명에 의한 I2C 버스의 클럭 라인 점검 장치는 제2도네 도시한 바와 같이 시작 및 종결 조건 검출부(100), CPU(200), 클럭 라인 상태 감지부(300), 및 I2C 제어기(335)로 구성된다.The apparatus for checking the clock line of the I 2 C bus according to the present invention includes a start and end condition detecting unit 100, a CPU 200, a clock line state detecting unit 300, and an I 2 C controller 335).

시작 및 종결 조건 검출부(100)는 I2C 버스의 데이타 라인(SDA)와 클럭 라인(SCL)을 통해 전송되는 신호를 검출하여 데이타 전송의 시작 및 종결 상태를 나타내는 시작 및 종결 조건을 검출한다.The start and end condition detection unit 100 detects a signal transmitted through the data line SDA and the clock line SCL of the I 2 C bus and detects start and end conditions indicating the start and end states of data transmission.

CPU(200)는 상기 시작 및 종결 조건 검출부(100)으로 부터 출력되는 신호에 따라 클럭 라인의 상태를 점검하도록 제어한다.The CPU 200 controls the state of the clock line according to a signal output from the start and end condition detector 100. [

클럭 라인 상태 감지부(300)는 상기 CPU(200)의 제어에 따라 상기 I2C 버스의 클럭 라인(SCL)의 상태를 감지하여 상기 클럭 라인(SCL)이 일정한 상태를 일정 기간 이상 유지하는 경우 상기 CPU(200)로 인터럽트를 출력하는 것으로, 일정한 주기의 내부 클럭(CLK)을 발생하는 내부 클럭 발생부(330), 상기 내부 클럭 발생부(330)로 부터 출력되는 내부 클럭에 따라 상기 I2C 버스의 클럭 라인(SCL)의 상태의 변화를 검사하여 상기 CPU(200)로 출력하는 클럭 라인 검사부(310), 및 상기 CPU(200)의 제어에 따라 내부 클럭 발생부(330)로 부터 출력되는 내부 클럭(CLK)을 카운팅하여 상기 CPU(200)로 인터럽트(INT)를 출력하는 타이머(320)로 구성된다.The clock line state sensing unit 300 senses the state of the clock line SCL of the I 2 C bus under the control of the CPU 200 so that the clock line SCL maintains a constant state for a predetermined period of time to output the interrupt to the CPU (200), the I 2 according to the internal clock that is output from the internal clock generating unit 330, the internal clock generating unit 330 for generating an internal clock (CLK) of a constant cycle A clock line checking unit 310 for checking the state of the clock line SCL of the C bus and outputting the checked result to the CPU 200 and a control unit 310 for controlling the output from the internal clock generating unit 330 And a timer 320 for counting an internal clock CLK and outputting an interrupt (INT) to the CPU 200.

여기서, 상기 내부 클럭(CLK)의 주기는 I2C 버스의 클럭 라인을 통해 전송되는 클럭의 주기의 1/N(N은 정수)이다.Here, the period of the internal clock CLK is 1 / N (N is an integer) of the period of the clock transmitted through the clock line of the I 2 C bus.

상기 내부 클럭 발생부(330)은 진동자(Oscillator)(332), 및 상기 진동자(332)로 부터 출력되는 클럭을 분주하여 상기 클럭 라인 검사부(310)와 타이머(320)로 출력하는 프리스케일러(331)로 구성된다.The internal clock generating unit 330 includes an oscillator 332 and a prescaler 331 for dividing the clock output from the oscillator 332 and outputting the clock to the clock line checking unit 310 and the timer 320. [ .

I2C 제어기(335)는 상기 CPU(200)의 제어에 따라 상기 클럭 라인(SCL)을 릴리즈(Release)한다.The I 2 C controller 335 releases the clock line SCL under the control of the CPU 200.

이와 같이 구성되는 본 발명에 의한 I2C 버스의 클럭 라인 점검 장치의 동작을 제3도 및 4도를 참조하여 설명한다.The operation of the clock line checking apparatus of the I 2 C bus according to the present invention will be described with reference to FIGS. 3 and 4.

먼저, 시작 및 종결 조건 검출부(100)에서 I2C 버스의 데이타 라인(SDA)와 클럭 라인(SCL)을 통해 전송되는 신호를 검출하여 시작 조건을 검출한다(340). 즉, 시작 조건을 제3도에 도시한 바와 같이 클럭 라인(SCL)을 통해 전송되는 클럭이 '1'인 상태에서 데이타 라인(SDA)이 '1'에서 '0'으로 천이하는 경우이므로, 시작 및 종결 조건 검출부(100)에서는 클럭 라인(SCL)을 통해 전송되는 클럭이 '1'일때 데이타 라인(SCL)을 통해 전송되는 데이타가 '1'에서 '0'으로 천이하는 경우를 검출하여 CPU(200)로 출력한다.First, a start condition is detected by detecting a signal transmitted through a data line SDA and a clock line SCL of the I 2 C bus in the start and end condition detecting unit 100. That is, as shown in FIG. 3, since the data line SDA transitions from '1' to '0' in a state where the clock transmitted through the clock line SCL is '1' And the termination condition detection unit 100 detect when the data transmitted through the data line SCL transits from '1' to '0' when the clock transmitted through the clock line SCL is '1' 200).

이와 같이 시작 조건이 검출되어 시작 조건 검출 신호를 CPU(200)로 출력하면 CPU(200)에서는 클럭 라인 상태 감지부(300)의 클럭 라인 검사부(310)를 동작시켜서 클럭 라인(SCL)의 상태가 변화되었는지를 검사하도록 한다(341).When the start condition is detected and the start condition detection signal is output to the CPU 200, the CPU 200 operates the clock line checking unit 310 of the clock line state detecting unit 300 to detect the state of the clock line SCL (341).

즉, 클럭 라인 검사부(310)에서는 CPU(200)의 제어에 따라 시작 조건이 발생되면 동작하여 내부 클럭 발생부(330)로 부터 출력되는 내부 클럭(CLK)에 따라 클럭 라인(SCL)이 '0'이나 '1'로 값이 천이하는지를 검사하여 CPU(200)로 출력한다.That is, in the clock line checking unit 310, when the start condition is generated under the control of the CPU 200, the clock line SCL is set to '0' according to the internal clock CLK output from the internal clock generating unit 330 Quot; 1 " or " 1 ", and outputs the checked value to the CPU 200. [

다시 말해서, 내부 클럭 발생부(330)에서는 진동자(332)와 프리스케일러(331)를 이용하여 클럭 라인(SCL)을 통해 전송되는 클럭의 주기의 1/N배인 내부 클럭(CLK)을 발생하여 클럭 라인 검사부(310)로 출력하는데, 상기 클럭 라인 검사부(310)에서는 상기 내부 클럭 발생부(330)에서 발생된 내부 클럭(CLK)의 주기에 따라 클럭 라인(SCL)으로 전송되는 클럭의 변화를 검사하여 CPU(200)로 출력하게 된다.In other words, the internal clock generator 330 generates the internal clock CLK, which is 1 / N times the period of the clock transmitted through the clock line SCL using the oscillator 332 and the prescaler 331, The clock line checking unit 310 checks the change of the clock transmitted to the clock line SCL according to the period of the internal clock CLK generated by the internal clock generating unit 330 And outputs it to the CPU 200.

이때, 클럭 라인(SCL)으로 전송되는 클럭이 '0'이나 '1'로 천이하게 되면 다시 종결 조건이 검출되었는지를 CPU(200)에서 판단한다(342).At this time, if the clock transmitted to the clock line SCL transits to '0' or '1', the CPU 200 determines whether a termination condition is detected again (342).

즉, 시작 및 종결 조건 검출부(100)에서는 시작 조건 검출부 계속해서 종결 조건을 검출하는데, 종결 조건은 제3도에 도시한 바와 같이 클럭 라인(SCL)을 통해 전송되는 클럭이 '1'인 상태에서 데이타 라인(SDA)이 '0'에서 '1'로 천이하는 경우이므로, 시작 및 종결 조건 검출부(100)에서는 클럭 라인(SCL)을 통해 전송되는 클럭이 '1'일때 데이타 라인(SCL)을 통해 전송되는 데이타가 '0'에서 '1'로 천이하는 경우를 검출하여 CPU(200)로 출력한다.That is, in the start and end condition detecting unit 100, the start condition detecting unit detects a termination condition. As shown in FIG. 3, in a state where the clock transmitted through the clock line SCL is '1' The start and end condition detection unit 100 detects the start and end conditions of the data line SDA through the data line SCL when the clock transmitted through the clock line SCL is '1' because the data line SDA transitions from '0' Detects the case where the transmitted data transits from '0' to '1', and outputs the detected data to the CPU 200.

이때, 시작 및 종결 조건 검출부(100)에서 종결 조건이 검출되면 CPU(200)에서는 클럭 라인 검사부(310)의 동작을 정지시키고 다시 시작 조건이 검출될때까지 클럭 라인의 이상 유무를 점검하는 동작을 정지시킨다.At this time, when the termination condition is detected in the start and end condition detecting unit 100, the CPU 200 stops the operation of the clock line checking unit 310 and stops the operation of checking the abnormality of the clock line until the start condition is detected again .

한편, 종결 조건이 검출되지 않으면 CPU(200)에서는 클럭 라인 검사부(310)에서의 검사 결과에 따라 클럭 라인이 변화될때 카운터로 구성된 타이머(320)를 초기값으로 세팅시키고(343), 타이머(320)에서는 상기 내부 클럭 발생부(330)로 부터 출력되는 내부 클럭(CLK)을 입력으로 세팅된 값으로 부터 '0'이 될 때까지 감소시키면서 카운팅을 하게 된다(344).If the termination condition is not detected, the CPU 200 sets (343) the timer 320 configured as a counter when the clock line is changed according to the inspection result of the clock line checking unit 310, The internal clock CLK output from the internal clock generator 330 is counted while decreasing from the set value to '0' (operation 344).

이때, 타이머(320)의 값이 '0'이 되면 타이머(320)에서는 인터럽트를 발생하여 CPU(200)로 출력한다(345, 346).At this time, when the value of the timer 320 becomes '0', the timer 320 generates an interrupt and outputs it to the CPU 200 (345, 346).

즉, 클럭 라인 검사부(310)에서 '0'이나 '1'의 상태가 오래 지속되는 스투크(Stuck)를 점검하기 위해서 타이머(320)는 CPU(200)에 의해 초기값을 저장하고 내부 클럭 발생부(330)로부터 출력되는 내부 클럭(CLK)에 따라 그 값을 감소시키게 된다. 이때 타이머(320)에서 감소된 값이 '0'이 되면 CPU(200)로 인터럽트를 걸어 준다.That is, in order to check a stuck state in which the state of '0' or '1' lasts in the clock line checking unit 310, the timer 320 stores the initial value by the CPU 200, And decreases its value according to the internal clock CLK output from the unit 330. At this time, if the decremented value of the timer 320 becomes '0', the CPU 200 interrupts.

한편, 타이머(320)의 초기값은 CPU(200)에 의해 세팅되는데, 이 초기값은 사용자가 미리 입력하여 ROM과 같은 메모리에 저장하여 CPU(200)가 타이머(320)를 세팅시킬 수 있도록 한다.The initial value of the timer 320 is set by the CPU 200. The initial value is input by the user in advance and stored in a memory such as a ROM so that the CPU 200 can set the timer 320 .

이와 같이 타이머(320)에서 인터럽트가 출력되면 CPU(200)에서는 I2C 제어기(335)를 제어하여 클럭 라인(SCL)을 릴리즈시키도록 한다(347).When an interrupt is output from the timer 320, the CPU 200 controls the I 2 C controller 335 to release the clock line SCL (347).

한편, 타이머값이 '0'이 되지 않았으면 계속해서 클럭 라인 검사부(310)에서 클럭 라인의 값이 변동되었는지 검사하도록 하고(341), 클럭 라인의 값이 변동되지 않았으면 계속해서 타이머(320)의 값을 감소시킨다(344).If the timer value is not 0, the clock line check unit 310 checks whether the value of the clock line is changed 341. If the value of the clock line is not changed, (344).

이와 같은 동작을 제4도에 따라 개략적으로 설명하면 다음과 같다.This operation will be schematically described with reference to FIG. 4 as follows.

시작 조건이 검출되고(340) 클럭 라인의 값이 변하면(341) 타이머(320)를 초기값으로 세팅하고(343) 발생된 내부 클럭(CLK)에 따라 타이머 값이 '0'이 될때까지 타이머(320)의 값을 감소시킨다(344, 345). 이때 타이머값이 '0'이 되면(345) 인터럽트를 발생하여 클럭 라인을 릴리즈시키다(346, 347).If the start condition is detected 340 and the value of the clock line is changed 341 the timer 320 is set to the initial value 343 and the timer is reset to '0' according to the generated internal clock CLK 320) (344, 345). At this time, if the timer value becomes '0' (345), an interrupt is generated to release the clock line (346, 347).

또한, 클럭 라인의 값이 변동하면(341) 타이머를 다시 초기값으로 세팅하고 타이머값을 감소시키는 동작을 반복한다.Also, if the value of the clock line fluctuates (341), the timer is reset to the initial value and the timer value is decremented.

한편 클럭 라인(SCL)의 상태를 점검하는 동작은 시작 조건이 발생한 시점으로 부터 종결 조건이 발생할 때까지이므로, 종결 조건이 발생되면 시작 조건이 발생될 때까지 클럭 라인을 점검하기 위한 동작을 중단한다.On the other hand, the operation of checking the state of the clock line SCL is from the time when the start condition occurs to the time when the end condition occurs, so that the operation for checking the clock line is stopped until the start condition is generated .

상기 시작 및 종결 조건 검출부(100)는 제5도에 도시한 바와 같이 상기 I2C 버스의 클럭 라인(SCL)을 통해 전송되는 신호에 따라 인에이블되어 상기 데이타 라인(SDA)을 통해 전송되는 신호와 '0'을 비교하는 비교기(410), 상기 I2C 버스의 클럭 라인(SCL)을 통해 전송되는 신호에 따라 인에이블되어 상기 비교기(410)의 출력 신호와 상기 데이타 라인(SDA)을 통해 전송되는 신호를 비교하여 종결 조건 신호를 상기 CPU(200)로 출력하는 비교기(420), 상기 I2C 버스의 클럭 라인(SCL)을 통해 전송되는 신호에 따라 인에이블되어 상기 데이타 라인(SDA)을 통해 전송되는 신호와 '1'을 비교하는 비교기(430), 상기 비교기(430)의 출력 신호를 반전시키는 인버터(440), 및 상기 I2C 버스의 클럭 라인(SCL)을 통해 전송되는 신호에 따라 인에이블되어 상기 인버터(440)의 출력 신호와 상기 데이타 라인(SDA)을 통해 전송되는 신호를 비교하여 시작 조건 신호를 상기 CPU(200)로 출력하는 비교기(450)로 구성된다.As shown in FIG. 5, the start and end condition detecting unit 100 is enabled according to a signal transmitted through a clock line (SCL) of the I 2 C bus and outputs a signal transmitted through the data line SDA And a comparator 410 for comparing the output signal of the comparator 410 and the data line SDA according to a signal transmitted through a clock line SCL of the I 2 C bus. A comparator 420 which compares the transmitted signals and outputs a termination condition signal to the CPU 200, a comparator 420 which is enabled in response to a signal transmitted through a clock line SCL of the I 2 C bus and outputs the data line SDA, And an inverter 440 for inverting the output signal of the comparator 430 and a signal transmitted through a clock line SCL of the I 2 C bus, And the output signal of the inverter 440 and the And a comparator 450 comparing the signals transmitted through the data line SDA and outputting a start condition signal to the CPU 200. [

이와 같이 구성되는 시작 및 종결 조건 검출부(100)의 동작을 설명한다.The operation of the start and end condition detecting unit 100 configured as described above will be described.

I2C 버스의 클럭 라인(SCL)을 통해 전송되는 클럭이 '1'인 경우 비교기(410, 420, 430, 450)가 인에이블된다.When the clock transmitted through the clock line SCL of the I 2 C bus is '1', the comparators 410, 420, 430 and 450 are enabled.

이때, 시작 조건을 검출하기 위해 I2C 버스의 데이타 라인(SDA)을 통해 전송되는 데이타와 '1'을 비교기(430)에서 비교하여 출력한다.At this time, the comparator 430 compares '1' with the data transmitted through the data line SDA of the I 2 C bus in order to detect the start condition.

여기서, I2C 버스의 데이타 라인(SDA)을 통해 전송되는 데이타가 '1'인 경우에는 비교기(430)에서 '1'을 출력하게 되고 비교기(430)에서 출력된 신호는 인버터(440)에서 반전되어 '0'이 된다.Here, if the data transmitted through the data line SDA of the I 2 C bus is '1', the comparator 430 outputs '1' and the comparator 430 outputs the signal from the inverter 440 Is inverted and becomes '0'.

이때 다시 비교기(450)에서는 I2C 버스의 데이타 라인(SDA)을 통해 전송되는 데이타와 인버터(440)로부터 출력되는 '0'을 비교하여 CPU(200)로 출력하게 된다.At this time, the comparator 450 compares the data transmitted through the data line (SDA) of the I 2 C bus with '0' output from the inverter 440 and outputs the data to the CPU 200.

여기서, I2C 버스의 데이타 라인(SDA)을 통해 전송되는 데이타가 '0'인 경우에는 비교기(450)에서 '1'을 출력하게 되어 시작 조건임을 CPU(200)에 알린다.Here, if the data transmitted through the data line SDA of the I 2 C bus is '0', the comparator 450 outputs '1' to inform the CPU 200 of the start condition.

한편, 종결 조건을 검출하기 위해 I2C 버스의 데이타 라인(SDA)을 통해 전송되는 데이타와 '0'을 비교기(410)에서 비교하여 출력한다.On the other hand, in order to detect the termination condition, the comparator 410 compares the data transmitted through the data line SDA of the I 2 C bus with '0'.

여기서, I2C 버스의 데이타 라인(SDA)을 통해 전송되는 데이타가 '0'인 경우에는 비교기(410)에서 '1'을 출력하게 되고 비교기(410)에서 출력된 신호는 다시 비교기(420)에서 I2C 버스의 데이타 라인(SDA)을 통해 전송되는 데이타와 비교되어 CPU(200)로 출력되게 된다.When the data transmitted through the data line SDA of the I 2 C bus is '0', the comparator 410 outputs '1', and the comparator 410 outputs the signal again to the comparator 420. To the data transmitted through the data line (SDA) of the I 2 C bus and output to the CPU 200.

여기서, I2C 버스의 데이타 라인(SDA)을 통해 전송되는 데이타가 '1'인 경우에는 비교기(420)에서 '1'을 출력하게 되어 종결 조건임을 CPU(200)에 알린다.Here, if the data transmitted through the data line SDA of the I 2 C bus is '1', the comparator 420 outputs '1' to inform the CPU 200 of the termination condition.

한편, I2C 버스의 클럭 라인(SCL)을 통해 전송되는 클럭이 '1'이 아닌 경우에는 시작 조건 및 종결 조건을 검출하지 않게 된다.On the other hand, when the clock transmitted through the clock line SCL of the I 2 C bus is not '1', the start condition and the end condition are not detected.

상기 클럭 라인 검사부(310)는 제6도에 도시한 바와 같이 상기 내부 클럭 발생부(330)로 부터 출력되는 내부 클럭(CLK)을 클럭 입력으로 하고 상기 I2C 버스의 클럭 라인(SCL)을 통해 전송되는 신호를 데이타 입력으로 하는 플립플롭(510), 상기 내부 클럭 발생부(330)로 부터 출력되는 내부 클럭(CLK)을 클럭 입력으로 하고 상기 플립플롭(510)의 출력을 데이타 입력으로 하는 플립플롭(510), 및 상기 플립플롭(510, 520)의 출력을 비교하여 상기 CPU(200)로 출력하는 비교기(530)로 구성된다.As shown in FIG. 6, the clock line checking unit 310 receives the internal clock CLK output from the internal clock generating unit 330 as a clock input, and outputs the clock line SCL of the I 2 C bus A flip-flop 510 for receiving a signal transmitted through the flip-flop 510 as a data input, an internal clock CLK output from the internal clock generator 330 as a clock input, and an output of the flip- And a comparator 530 for comparing the outputs of the flip-flops 510 and 520 and outputting the comparison results to the CPU 200. The flip-

이와 같이 구성되는 클럭 라인 검사부(310)의 동작을 설명한다.The operation of the clock line checking unit 310 configured as described above will be described.

내부 클럭 발생부(330)로 부터 출력되는 내부 클럭(CLK)이 입력되면 플립플롭(510)은 클럭 라인(SCL)을 통해 전송되는 신호를 입력으로 받고, 다시 내부 클럭(CLK)이 인가되면 플립플롭(510)은 클럭 라인(SCL)으로 전송되는 신호를 입력으로 받으면서 이전 클럭에서 입력을 받은 신호를 플립플롭(520)으로 출력한다.When the internal clock CLK output from the internal clock generator 330 is input, the flip-flop 510 receives a signal transmitted through the clock line SCL. When the internal clock CLK is applied again, Flop 510 receives a signal transmitted to a clock line SCL as an input, and outputs a signal received from a previous clock to a flip-flop 520. [

따라서 플립플롭(510, 520)에는 클럭 라인(SCL)을 통해 전송된 신호가 내부 클럭(CLK)에 동기되어 래치되게 된다. 이와 같이 플립플롭(510, 520)에 래치된 신호, 즉 내부 클럭(CLK)의 2주기 동안 클럭 라인(SCL)을 통해 전송된 신호는 비교기(530)에 입력되어 비교된다.Therefore, the signals transmitted through the clock line SCL are latched in the flip-flops 510 and 520 in synchronization with the internal clock CLK. Signals latched in the flip-flops 510 and 520, that is, signals transmitted through the clock line SCL for two cycles of the internal clock CLK are input to the comparator 530 and compared.

이때 클럭 라인(SCL)을 통해 전송된 신호가 내부 클럭(CLK)의 2주기 동안 변화되었다면 비교기(530)로 부터 '0'이 CPU(200)로 출력되어 클럭 라인(SCL)의 값의 변화를 알리게 된다. 또한, 클럭 라인(SCL)을 통해 전송된 신호가 내부 클럭(CLK)의 2주기 동안 변화되지 않았다면 비교기(530)로 부터 '1'이 CPU(200)로 출력되어 클럭 라인(SCL)의 값이 변화되지 않았음을 알리게 된다.At this time, if the signal transmitted through the clock line SCL has changed for two cycles of the internal clock CLK, '0' is outputted from the comparator 530 to the CPU 200 to change the value of the clock line SCL Will be announced. If the signal transmitted through the clock line SCL has not been changed for two cycles of the internal clock CLK, a value of '1' is output from the comparator 530 to the CPU 200 so that the value of the clock line SCL is It is not changed.

이상에서 설명한 바와 같이 본 발명에 의한 I2C 버스의 클럭 라인 점검 장치는 I2C 버스상에서 클럭 라인의 이상 상태를 점검하여 클럭 라인의 구동을 방지하여 전송 데이타의 에러 발생을 막고, 신속하에 클럭 라인을 복구시켜 전송 효율을 향상시키는 효과가 있다.As described above, the I 2 C bus clock line checking apparatus according to the present invention checks the abnormal state of the clock line on the I 2 C bus to prevent the occurrence of errors in the transmission data by preventing the clock line from being driven, Thereby improving the transmission efficiency by restoring the line.

본 발명의 목적은 I2C 버스상에서 클럭 라인의 이상 유무를 점검하여 클럭 라인을 구동하지 않도록 하기 위한 I2C 버스의 클럭 라인 점검 장치를 제공함에 있다.An object of the present invention is a clock line inspection apparatus of the I 2 C bus to ensure that checks the presence of error in the clock line to drive the clock lines on the I 2 C bus to provide.

Claims (7)

I2C 버스의 데이타 라인(SDA)와 클럭 라인(SCL)을 통해 전송되는 신호를 검출하여 데이타 전송의 시작 및 종결 상태를 나타내는 시작 및 종결 조건을 검출하는 시작 및 종결 조건 검출 수단(100) ; 상기 시작 및 종결 조건 검출 수단(100)으로 부터 출력되는 신호에 따라 클럭 라인의 상태를 점검하도록 제어하는 CPU(200) ; 및 상기 CPU(200)의 제어에 따라 상기 I2C 버스의 클럭 라인(SCL)의 상태를 감지하여 상기 클럭 라인(SCL)이 일정한 상태를 일정 기간 이상 유지하는 경우 상기 CPU(200)로 인터럽트를 출력하는 클럭 라인 상태 감지 수단(300)을 포함하여 구성됨을 특징으로 하는 I2C 버스의 클럭 라인 점검 장치.A start and end condition detection means (100) for detecting a signal transmitted through a data line (SDA) and a clock line (SCL) of the I 2 C bus and detecting a start and end condition indicating a start and end status of data transmission; A CPU (200) for controlling the state of the clock line according to a signal output from the start and end condition detecting means (100); And the CPU 200 senses the state of the clock line SCL of the I 2 C bus and interrupts the CPU 200 if the state of the clock line SCL is maintained for a predetermined period or longer And a clock line state detecting means (300) for outputting the clock line state of the I 2 C bus. 제1항에 있어서, 상기 CPU(200)이 제어에 따라 상기 클럭 라인(SCL)을 릴리즈(Release)하는 I2C 제어기(335)를 더 포함하여 구성됨을 특징으로 하는 I2C 버스의 클럭 라인 점검 장치.2. The I 2 C bus according to claim 1, further comprising an I 2 C controller (335) for releasing the clock line (SCL) under control of the CPU (200) Check device. 제1항에 있어서, 상기 클럭 라인 상태 감지 수단(300)은 일정한 주기의 내부 클럭(CLK)을 발생하는 내부 클럭 발생부(330) ; 상기 내부 클럭 발생부(330)로 부터 출력되는 내부 클럭에 따라 상기 I2C 버스의 클럭 라인(SCL)이 상태의 변화를 검사하여 상기 CPU(200)로 출력하는 클럭 라인 검사부(310) ; 및 상기 CPU(200)의 제어에 따라 내부 클럭 발생부(330)로 부터 출력되는 내부 클럭(CLK)을 카운팅하여 상기 CPU(200)로 인터럽트(INT)를 출력하는 타이머(320)를 포함하여 구성됨을 특징으로 하는 I2C 버스의 클럭 라인 점검 장치.The apparatus of claim 1, wherein the clock line state sensing means (300) comprises: an internal clock generator (330) generating an internal clock (CLK) of a predetermined period; A clock line checking unit 310 for checking a state change of the clock line SCL of the I 2 C bus according to an internal clock output from the internal clock generating unit 330 and outputting the checked result to the CPU 200; And a timer 320 for counting an internal clock CLK output from the internal clock generator 330 under the control of the CPU 200 and outputting an interrupt (INT) to the CPU 200 A clock line check device for an I < 2 > C bus. 제3항에 있어서, 상기 내부 클럭(CLK)의 주기는 I2C 버스의 클럭 라인을 통해 전송되는 클럭의 주기의 1/N(N은 정수)임을 특징으로 하는 I2C 버스의 클럭 라인 점검 장치.The method of claim 3, wherein said internal clock (CLK) cycle is 1 / N of the cycle of the clock transmitted over the clock line of the I 2 C bus, checking (N is an integer) the clock line of the I 2 C bus, characterized in that the Device. 제4항에 있어서, 상기 내부 클럭 발생부(330)는 진동자(Oscillator)(332) ; 및 상기 진동자(332)로 부터 출력되는 클럭을 분주하여 상기 클럭 라인 검사부(310)와 타이머(320)로 출력하는 프리스케일러(331)로 구성됨을 특징으로 하는 I2C 버스의 클럭 라인 점검 장치.5. The apparatus of claim 4, wherein the internal clock generator (330) comprises: an oscillator (332); And a clock line inspection apparatus of the I 2 C bus, characterized by consisting of a prescaler 331 that divides the clock output from the oscillator 332 output to the clock line inspection section 310 and the timer 320. 제3항에 있어서, 상기 클럭 라인 검사부(310)는 상기 내부 클럭 발생부(330)로 부터 출력되는 내부 클럭(CLK)을 클럭 입력으로 하고 상기 I2C 버스의 클럭 라인(SCL)을 통해 전송되는 신호를 데이타 입력으로 하는 제1 플립플롭(510) ; 상기 내부 클럭 발생부(330)로 부터 출력되는 내부 클럭(CLK)을 클럭 입력으로 하고 상기 제1 플립플롭(510)의 출력을 데이타 입력으로 하는 제2 플립플롭(520) ; 및 상기 제1 및 제2 플립플롭(510, 520)의 출력을 비교하여 상기 CPU(200)로 출력하는 비교기(530)를 포함하여 구성됨을 특징으로 하는 I2C 버스의 클럭 라인 점검 장치.The method of claim 3, wherein the clock line checking unit 310 sends the internal clock (CLK) output from the internal clock generating unit 330 to the clock input through a clock line (SCL) of the I 2 C bus, A first flip-flop 510 for receiving a signal input from the first flip-flop 510 as a data input; A second flip-flop 520 for taking the internal clock CLK output from the internal clock generator 330 as a clock input and the output of the first flip-flop 510 as a data input; And said first and second flip-flops (510, 520) by comparing its output to the clock line inspection apparatus of the I 2 C bus, characterized by comprised a comparator 530 for outputting to the CPU (200) of. 제1항에 있어서, 상기 시작 및 종결 조건 검출 수단(100)은 상기 I2C 버스의 클럭 라인(SCL)을 통해 전송되는 신호에 따라 인에이블되어 상기 데이타 라인(SCL)을 통해 전송되는 신호와 '0'을 비교하는 제1 비교기(410) ; 상기 I2C 버스의 클럭 라인(SCL)을 통해 전송되는 신호에 따라 인에이블되어 상기 제1 비교기(410)의 출력 신호와 상기 데이타 라인(SDA)을 통해 전송되는 신호를 비교하여 종결 조건 신호를 상기 CPU(200)로 출력하는 제2 비교기(420) ; 상기 I2C 버스의 클럭 라인(SCL)을 통해 전송되는 신호에 따라 인에이블되어 상기 데이타 라인(SDA)을 통해 전송되는 신호와 '1'을 비교하는 제3 비교기(430) ; 상기 제3 비교기(430)의 출력 신호를 반전시키는 인버터(440) ; 및 상기 I2C 버스의 클럭 라인(SCL)을 통해 전송되는 신호에 따라 인에이블되어 상기 인버터(440)의 출력 신호와 상기 데이타 라인(SDA)을 통해 전송되는 신호를 비교하여 시작 조건 신호를 상기 CPU(200)로 출력하는 제4 비교기(450)를 포함하여 구성됨을 특징으로 하는 I2C 버스의 클럭 라인 점검 장치.2. The apparatus of claim 1, wherein the start and end condition detection means (100) is enabled according to a signal transmitted through a clock line (SCL) of the I < 2 & A first comparator 410 for comparing '0'; And is enabled according to a signal transmitted through a clock line (SCL) of the I 2 C bus to compare an output signal of the first comparator 410 with a signal transmitted through the data line (SDA) A second comparator 420 for outputting to the CPU 200; A third comparator 430 which is enabled according to a signal transmitted through the clock line SCL of the I 2 C bus and compares '1' with a signal transmitted through the data line SDA; An inverter 440 for inverting an output signal of the third comparator 430; And a clock signal line (SCL) of the I < 2 > C bus to compare the output signal of the inverter (440) with a signal transmitted through the data line (SDA) the fourth comparator 450, the clock line inspection apparatus of the I 2 C bus, characterized by configured to output, including a CPU (200).
KR1019960037432A 1996-08-31 1996-08-31 Clock line check device of I2C bus KR0175563B1 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
KR1019960037432A KR0175563B1 (en) 1996-08-31 1996-08-31 Clock line check device of I2C bus

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
KR1019960037432A KR0175563B1 (en) 1996-08-31 1996-08-31 Clock line check device of I2C bus

Publications (2)

Publication Number Publication Date
KR19980017639A KR19980017639A (en) 1998-06-05
KR0175563B1 true KR0175563B1 (en) 1999-04-01

Family

ID=19472188

Family Applications (1)

Application Number Title Priority Date Filing Date
KR1019960037432A KR0175563B1 (en) 1996-08-31 1996-08-31 Clock line check device of I2C bus

Country Status (1)

Country Link
KR (1) KR0175563B1 (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
KR19980072411A (en) * 1997-03-05 1998-11-05 김영환 Communication line inspection device and inspection method of BUS system

Also Published As

Publication number Publication date
KR19980017639A (en) 1998-06-05

Similar Documents

Publication Publication Date Title
GB2065939A (en) Arrangement having a programmabel electrical circuit and monitoring menas
KR970071268A (en) Monitoring system for electronic control device
EP1237282B1 (en) Circuit for the detection of clock signal period abnormalities
WO2005119448A1 (en) Error recovery scheme for i2c slave
CN108369565A (en) Communication device, communication means, program and communication system
KR900702688A (en) Disconnection position detection device of serial controller
KR0175563B1 (en) Clock line check device of I2C bus
KR19980069779A (en) Serial data transmission device
JP3465889B2 (en) Serial data transfer device, control method therefor, and communication device
KR100306349B1 (en) Data communication systems and devices for them
KR0167938B1 (en) Communicated state sensing circuit of data network
US11764771B2 (en) Event detection control device and method for circuit system controlled by pulse wave modulation signal
KR0167937B1 (en) Starting signal discriminating system of data network
JPS5825654Y2 (en) Time division remote control device
JPH0273451A (en) Controller
KR100209192B1 (en) Interrupt generating apparatus of i2c bus
JPS5818727A (en) Method and apparatus for self-control of dispersion type priority competition
JPH1051515A (en) Communication abnormality detector
JP2799753B2 (en) Pulse width modulation controller
JPH0637741A (en) Synchronization transmitter
KR100221496B1 (en) Synchronizing state monitoring circuit
KR100240248B1 (en) Data transmit/receive apparatus and data transmit/receive method
KR960016274B1 (en) Home bus interface apparatus
JPH0632049B2 (en) Microcomputer equipment
KR19980050669U (en) Ring signal detection circuit in personal computer

Legal Events

Date Code Title Description
A201 Request for examination
E701 Decision to grant or registration of patent right
GRNT Written decision to grant
FPAY Annual fee payment

Payment date: 20121101

Year of fee payment: 15

LAPS Lapse due to unpaid annual fee