KR100247218B1 - Signal generating circuit - Google Patents

Signal generating circuit Download PDF

Info

Publication number
KR100247218B1
KR100247218B1 KR1019920013684A KR920013684A KR100247218B1 KR 100247218 B1 KR100247218 B1 KR 100247218B1 KR 1019920013684 A KR1019920013684 A KR 1019920013684A KR 920013684 A KR920013684 A KR 920013684A KR 100247218 B1 KR100247218 B1 KR 100247218B1
Authority
KR
South Korea
Prior art keywords
signal
edge
timer
generating
data
Prior art date
Application number
KR1019920013684A
Other languages
Korean (ko)
Other versions
KR940003183A (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 KR1019920013684A priority Critical patent/KR100247218B1/en
Publication of KR940003183A publication Critical patent/KR940003183A/en
Application granted granted Critical
Publication of KR100247218B1 publication Critical patent/KR100247218B1/en

Links

Classifications

    • HELECTRICITY
    • H03ELECTRONIC CIRCUITRY
    • H03KPULSE TECHNIQUE
    • H03K5/00Manipulating of pulses not covered by one of the other main groups of this subclass

Landscapes

  • Physics & Mathematics (AREA)
  • Nonlinear Science (AREA)
  • Manipulation Of Pulses (AREA)
  • Microcomputers (AREA)
  • Pulse Circuits (AREA)
  • Electronic Switches (AREA)

Abstract

복합신호를 발생하는 회로가, 수신되는 클럭을 계수하여 카운트 데이터를 발생하는 수단과, 소정 타이머 주기를 설정하기 위한 기준 데이터를 발생하는 기준값 발생기와, 상기 카운트 데이터와 기준 데이터를 입력하며, 입력되는 상기 두 데이터들을 비교하여 동일할 때 타이머 신호를 발생하는 비교수단과, 소정의 신호를 수신하며, 상기 제어부에서 출력되는 에지선택신호에 의해 상기 수신되는 소정의 에지 변화를 순차적으로 검출하고, 상기 에지 검출시점에서 상기 카운트 데이터를 수신 및 저장하여 수신되는 신호를 자동적으로 캡쳐하는 수단으로 구성된다.A circuit for generating a composite signal includes means for generating count data by counting a received clock, a reference value generator for generating reference data for setting a predetermined timer period, and inputting the count data and reference data, Comparing means for comparing the two data and generating a timer signal when the data is the same, and receiving a predetermined signal, and sequentially detecting the received predetermined edge change by an edge selection signal output from the control unit. And means for automatically capturing the received signal by receiving and storing the count data at the time of detection.

Description

신호 발생 회로Signal generating circuit

본 발명은 신호 발생 회로에 관한 것으로, 특히 단일 집적회로에서 여러 기능의 신호들을 발생시킬 수 있는 회로에 관한 것이다.The present invention relates to a signal generating circuit, and more particularly to a circuit capable of generating signals of various functions in a single integrated circuit.

일반적으로 타이머/카운터 회로는 클럭 신호를 수신하여 소정 주기를 갖는 신호를 발생하는 회로로서, 제1도는 대한민국의 삼성에서 제작 및 판매하는 타이머/카운터(KS56C220/KS56C820/KS56C1620)의 구성을 도시하고 있다. 상기 제1도에 도시된 타이머/카운터는 클럭선택기(clock selector), 8비트의 타이머/카운터 모드 레지스터 TMOD, 8비트의 타이머/카운터 카운터 레지스터 TCNT, 8비트의 타이머/카운터 레퍼런스 레지스터 TREF, 8비트의 비교기(comparator), 타이머 출력 래치 TOL 등으로 구성된다.In general, a timer / counter circuit is a circuit for receiving a clock signal and generating a signal having a predetermined period. FIG. 1 illustrates a configuration of a timer / counter (KS56C220 / KS56C820 / KS56C1620) manufactured and sold by Samsung of Korea. . The timer / counter shown in FIG. 1 includes a clock selector, an 8-bit timer / counter mode register TMOD, an 8-bit timer / counter counter register TCNT, an 8-bit timer / counter reference register TREF, and 8 bits. Comparator, timer output latch TOL and the like.

상기와 같은 구성에서 TMOD.2가 세트되고, TMOD.6에 의해 상기 카운터 TCNT의 클럭 소스로서 내부 클럭이 선택되면, 타이머/카운터 기능이 수행된다. 또한 상기 레퍼런스 레지스터 TREF에 타이머의 기준 값이 세트되고 상기 모드 레지스터 TMOD에 의해 카운트 클럭 주파수가 결정된다. 이런 상태에서 타이머/카운터 인터럽트가 인에이블되고, TMOD.3이 세트되면, 상기 타이머/카운터가 구동된다. 상기 타이머/카운터가 인에이블되면, TMOD에 의해 결정된 클럭 신호가 수신될 때마다 TCNT의 값이 증가된다. 이때 비교기는 상기 TCNT와 TREF의 값을 비교하며, 두 출력 값이동일하면 타이머/카운터의 인터럽트요구 플래그 IRQT 신호를 세트시키고, 상기 TOL을 반전시켜 인터럽트신호를 발생한다. 이때 상기 TCNT의 내용은 초기화되며, 계속해서 수신되는 클럭신호에 의해 카운터를 재개한다. 그러므로 상기 TREF와 TMOD에 의해 상기 타이머 주기가 결정되면, 상기 타이머/카운터는 주기적으로 타이머 인터럽트 신호를 발생한다.In the above configuration, when TMOD.2 is set and an internal clock is selected as the clock source of the counter TCNT by TMOD.6, the timer / counter function is performed. In addition, a reference value of a timer is set in the reference register TREF and a count clock frequency is determined by the mode register TMOD. In this state, when the timer / counter interrupt is enabled and TMOD.3 is set, the timer / counter is driven. When the timer / counter is enabled, the value of TCNT is increased each time a clock signal determined by TMOD is received. At this time, the comparator compares the values of the TCNT and the TREF. If the two output values are the same, the comparator sets the interrupt request flag IRQT signal of the timer / counter and inverts the TOL to generate an interrupt signal. At this time, the contents of the TCNT are initialized, and the counter is restarted by the clock signal received continuously. Therefore, when the timer period is determined by the TREF and TMOD, the timer / counter periodically generates a timer interrupt signal.

그러나 상기와 같은 타이머/카운터는 소정의 주기를 갖는 타이머 인터럽트 신호 이외에 상기 타이머를 이용하여 다른 신호를 발생할 없었다. 이로 인해 종래에는 상기와 같은 타이머 기능을 이용하는 PWM 발생기(Pulse Width Modulator), 이벤트 카운터(event counter), 타이머 및 캡쳐 블록(capture block)을 각각 별도로 구비하여 운용하여야 했다. 그러나 상기와 같은 블록들을 복합으로 하여야하는 경우(예를 들면 A/D변환기와 같은 집적회로)에는 각각의 기능을 디스크리트하게 구비하여야 했다. 이때 상기 기능들을 집적화하는 경우 가장 큰 크기의 칩 레이 아웃(chip lay out)을 차지하는 것이 타이머이다. 그러므로 상기와 같은 타이머/카운터를 이용하면 상기 기능들을 단일 집적회로로 구성하기가 용이하며, 따라서 복합 기능을 가지며 칩 사이즈를 소형화할 수 있는 집적회로를 쉽게 구현할 수 있게 된다.However, such a timer / counter did not generate another signal using the timer other than a timer interrupt signal having a predetermined period. For this reason, in the related art, a PWM generator (Pulse Width Modulator), an event counter, an event counter, a capture block, and a capture block that use the timer function as described above have to be separately provided and operated. However, in the case where the above blocks are to be combined (for example, an integrated circuit such as an A / D converter), the respective functions must be provided in a discrete manner. In this case, when the functions are integrated, the timer occupies the largest chip lay out. Therefore, using the timer / counter as described above, it is easy to configure the functions into a single integrated circuit, and thus it is possible to easily implement an integrated circuit having a complex function and miniaturizing the chip size.

따라서 본 발명의 목적은 단일 타이머 회로를 이용하여 복합 기능을 수행할 수 있는 집적회로를 제공함에 있다.Accordingly, an object of the present invention is to provide an integrated circuit capable of performing a complex function using a single timer circuit.

본 발명의 다른 목적은 단일 타이머 회로를 이용하여 카운터 및 타이머 기능 이외에 PWM 기능 및 캡쳐 기능 등의 복합 기능을 수행할 수 있는 집적회로를 제공함에 있다.Another object of the present invention is to provide an integrated circuit capable of performing a complex function such as a PWM function and a capture function in addition to the counter and timer functions using a single timer circuit.

상기 목적을 달성하기 위한 본 발명의 실시예에 따른 복합신호 발생회로가, 제어부에서 출력되는 모드선택신호를 내부에 입력하는 입력수단과, 상기 모드선택 신호 중의 클럭 선택신호에 의해 복수개의 클럭들 중 해당하는 클럭을 선택하고, 상기 선택된 클럭을 계수하여 카운트 데이터를 발생하는 카운트수단과, 타이머 주기를 설정하기 위한 기준 데이터를 발생하는 기준값 발생기와, 상기 카운트 데이터 및 기준 데이터를 입력하며, 상기 입력되는 상기 두 데이터들을 비교하여 상기 두 데이터들이 동일해지는 시점에서 상기 타이머신호를 발생하는 비교수단과, 상기 클럭신호, 카운트 데이터, 타이머 신호 및 기준데이터들을 입력하며, 상기 카운트 데이터에 의해 1주기가 설정되고 상기 기준데이터 주기 동안 인에이블되는 PWM신호를 발생하는 수단과, 소정의 신호를 수신하며, 상기 모드 선택신호들 중의 에지선택신호에 의해 입력되는 상기 신호의 에지 변화를 순차적으로 검출하고, 상기 에지 검출 시점에서 상기 카운트 데이터를 저장하여 수신되는 신호를 자동적으로 캡쳐하는 수단으로 구성된 것을 특징으로 한다.A composite signal generating circuit according to an embodiment of the present invention for achieving the above object, of the plurality of clocks by the input means for inputting the mode selection signal output from the controller therein and the clock selection signal of the mode selection signal; A count means for generating a count data by selecting a corresponding clock, counting the selected clock, a reference value generator for generating reference data for setting a timer period, and inputting the count data and the reference data, Comparison means for generating the timer signal at the time when the two data are the same by comparing the two data, the clock signal, the count data, the timer signal and the reference data are input, and one cycle is set by the count data. Means for generating a PWM signal that is enabled during the reference data period And receiving a predetermined signal, sequentially detecting an edge change of the signal input by an edge selection signal among the mode selection signals, and automatically storing the counted data by storing the count data at the edge detection time point. It is characterized by consisting of means.

제1도는 종래의 타이머/카운터 회로의 구성도1 is a block diagram of a conventional timer / counter circuit

제2도는 본 발명에 따른 복합 신호 발생회로의 구성도2 is a block diagram of a composite signal generation circuit according to the present invention

제3도는 제2도에 의해 발생되는 신호 중 PWM신호의 발생 파형도3 is a waveform diagram of generation of the PWM signal among the signals generated by FIG.

제4도는 제2도에 의해 발생되는 신호 중 캡쳐신호의 발생 파형도4 is a waveform diagram of generation of a capture signal among the signals generated by FIG.

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

제2도는 본 발명의 실시예에 따른 복합 기능을 갖는 집적회로의 구성도이다.2 is a block diagram of an integrated circuit having a composite function according to an embodiment of the present invention.

모든 선택수단은 제어부와 연결되며, 상기 제어부에서 출력되는 클리어신호와 카운터 인에이블신호와 클럭선택신호 및 캡쳐선택신호들을 집적회로 내부에 인가하는 기능을 수행한다. 상기 모드선택수단은 모드레지스터 MOD1-MOD8로 구성되며, 상기 모드레지스터들을 각각 제어부와 연결된다. 여기서 상기 MOD1은 카운트 인에이블신호가 되며, MOD2는 본 발명의 집적회로에 대한 클리어신호가 되고, MOD3-MOD5는 클럭 소스를 선택하기 위한 신호가 되며, MOD7-MOD8은 수신되는 CAP신호의 에너지를 검출하기 위한 캡쳐선택신호가 된다.All selection means are connected to the control unit, and perform a function of applying the clear signal, the counter enable signal, the clock selection signal, and the capture selection signals output from the control unit to the integrated circuit. The mode selecting means is composed of mode registers MOD1-MOD8, and the mode registers are respectively connected to a control unit. The MOD1 is a count enable signal, the MOD2 is a clear signal for the integrated circuit of the present invention, the MOD3-MOD5 is a signal for selecting a clock source, and the MOD7-MOD8 is an energy of a received CAP signal. It becomes a capture selection signal for detection.

카운트 데이터를 발생하는 카운트 수단은 내부 클럭 및 외부 클럭들을 수신하며 상기 클럭선택신호에 의해 클럭을 선택하고 상기 카운터 인에블신호 발생시 상기 선택된 클럭을 계수하여 카운트 데이터를 발생하는 기능을 수행한다. 상기 카운터 데이터를 발생하는 수단은 제어부의 클럭과 외부 클럭을 수신하며, 상기 클럭 선택신호에 대응되는 클럭 소스를 선택하여 클럭 신호로 출력하는 클럭선택기11과, 상기 선택된 클럭을 수신하여 카운트 클럭으로 스케일링하는 2비트의 프리스케일러(pre-scaler)12와, 상기 프리스케일러12의 출력과 상기 카운트 인에이블 신호를 수신하여 논리곱하므로서, 상기 카운트 인에이블신호가 세트 상태일 시 상기 프리스케일러12의 출력을 카운트 클럭으로 인가하는 게이트13과, 상기 게이트13의 출력을 클럭으로 계수하여 카운트 데이터를 발생하는 카운터14로 구성된다.The counting means for generating the count data receives an internal clock and an external clock, selects a clock by the clock selection signal, and counts the selected clock to generate count data when the counter enable signal is generated. The means for generating the counter data receives a clock and an external clock of the control unit, a clock selector 11 for selecting a clock source corresponding to the clock selection signal and outputting the clock signal, and receiving the selected clock and scaling the count clock. A 2-bit prescaler 12 and an output of the prescaler 12 and the count enable signal are received and logically multiplied so that the output of the prescaler 12 is counted when the count enable signal is set. And a counter 14 for counting the output of the gate 13 by a clock and generating count data.

타이머신호를 발생하는 수단은 소정의 타이머신호 주기로 설정된 기준 데이터를 가지고 있으며, 상기 카운트 데이터를 수신하여 상기 기준 데이터와 비교하고 두 데이터의 값이 동일할 때 타이머 신호를 발생하는 기능을 수행한다. 상기 타이머 신호를 발생하는 수단은 소정 주기를 갖는 기준 데이터를 저장하고 있는 기준값 발생기17과, 상기 카운트 데이터와 상기 기준 데이터를 수신하며 두 데이터를 비교하여 동일한 경우 타이머 신호를 발생하는 비교기18과, 상기 비교기18의 출력과 MOD6의 신호를 수신하여 논리곱하므로서 상기 타이머 신호 발생시 타이머 인터럽트의 세트신호를 발생하는 게이트19와, 상기 게이트19의 출력을 세트 신호로 수신하고 상기 MOD2의 신호를 클리어 신호로 수신하여 상기 타이머 신호 발생시 타이머 인터럽트 신호를 발생하는 타이머 인터럽트 발생기20과, 토글래치22와 게이트 21,23,24,25 및 버퍼 26으로 구성되어 상기 비교기18을 출력하는 타이머 신호를 외부로 출력하는 수단으로 구성된다.The means for generating a timer signal has reference data set at a predetermined timer signal period, and performs the function of receiving the count data, comparing the reference data with the reference data, and generating a timer signal when the two data values are the same. The means for generating the timer signal includes a reference value generator 17 storing reference data having a predetermined period, a comparator 18 for receiving the count data and the reference data and comparing the two data to generate a timer signal if the same; Receives and multiplies the output of the comparator 18 and the signal of the MOD6 to receive a gate 19 for generating a timer interrupt set signal when the timer signal is generated, and receives the output of the gate 19 as a set signal and receives the signal of the MOD2 as a clear signal. And a timer interrupt generator 20 for generating a timer interrupt signal when the timer signal is generated, a toggle latch 22, gates 21, 23, 24, 25, and a buffer 26. The timer signal outputs the comparator 18 to the outside. It is composed.

PWM신호를 발생하는 수단은 상기 선택된 클럭과 상기 카운트 데이터와 상기 기준 데이터와 상기 타이머신호를 수신하며 상기 카운트 데이터의 주기 단위로 PWM신호의 폭으로 설정된 상기 기준 데이터에 의한 PWM신호를 발생하는 기능을 수행한다. 상기 PWM신호를 발생하는 수단은 상기 프리스케일러12의 출력과, 상기 카운터14의 출력과, 상기 비교기18의 출력과 상기 기준값 발생기17의 출력을 수신하며, 상기 카운트 주기 단위로 상기 기준 데이터에 의해 설정된 주기 동안 세트되는 PWM신호를 발생하는 PWM발생기27과, 상기 게이트23,24,25 및 버퍼26으로 구성되어 상기 PWM발생기27로부터 발생되는 PWM신호를 외부로 출력하는 수단으로 구성된다.The means for generating a PWM signal has a function of receiving the selected clock, the count data, the reference data and the timer signal and generating a PWM signal by the reference data set to a width of the PWM signal in units of periods of the count data. Perform. The means for generating the PWM signal receives the output of the prescaler 12, the output of the counter 14, the output of the comparator 18 and the output of the reference value generator 17, the period set by the reference data in units of the count period And a means for outputting the PWM signal generated from the PWM generator 27 to the outside, comprising a PWM generator 27 for generating a PWM signal set while the gate 23, 24, 25 and the buffer 26 are generated.

캡쳐신호를 발생하는 수단은 외부로부터 소정 신호를 수신하고 상기 카운트 데이터를 수신하며, 상기 캡쳐선택신호에 의해 수신되는 상기 신호의 에지들이 순차적으로 선택되고 상기 선택되는 에지와 에지 사이의 카운트 데이터를 저장하여 상기 수신되는 신호의 캡쳐신호를 발생하는 기능을 수행한다. 상기 캡쳐신호 발생수단은 캡쳐할 소정의 신호를 수신하며 상기 캡쳐선택신호에 의해 수신되는 상기 신호의 제1에지신호-제3에지신호를 순차적으로 선택하는 에지선택기28과, 상기 제1에지신호-제3에지신호에 의해 각각 순차적으로 인에이블되어 상기 카운터14로부터 수신되는 카운트 데이터를 순차적으로 저장하는 제1레지스터29-제3레지스터31과, 상기 에지선택기 28의 출력에 의해 세트되어 캡쳐 인터럽트 신호를 발생하는 캡쳐인터럽트 발생기32로 구성된다.The means for generating a capture signal receives a predetermined signal from the outside and receives the count data, the edges of the signal received by the capture selection signal are sequentially selected and store count data between the selected edge and the edge. To generate a capture signal of the received signal. The capture signal generating means receives an edge signal to be captured and an edge selector 28 and a first edge signal for sequentially selecting a first edge signal-a third edge signal of the signal received by the capture selection signal. A first register 29 to a third register 31 which are sequentially enabled by a third edge signal and sequentially store count data received from the counter 14, and an output of the edge selector 28 to capture a capture interrupt signal. It consists of a capture interrupt generator 32 that occurs.

제3도는 상기 PWM발생기27에서 출력하는 PWM신호의 파형도로서, 출력신호의 주기는 상기 카운터14의 카운트 주기에 의해 결정되고, 상기 PWM신호의 하이 듀티는 상기 기준값 발생기17의 기준값 발생기17의 기준데이터에 의해 결정된다.3 is a waveform diagram of a PWM signal output from the PWM generator 27, wherein the period of the output signal is determined by the count period of the counter 14, and the high duty of the PWM signal is the reference of the reference value generator 17 of the reference value generator 17. Determined by the data.

제4도는 캡쳐신호의 발생 파형도로서, CAP신호가 수신되면 에지선택기28이 상기 CAP신호의 에지신호 ES1-ES3검출하여 출력하며, 상기 에지신호 ES1-ES3에 의해 순차적으로 제1레지스터29-제3레지스터31이 순차적으로 인에이블되어 상기 카운터14의 카운트 데이터를 각각 저장한다.4 is a waveform diagram of the generation of the capture signal. When the CAP signal is received, the edge selector 28 detects and outputs the edge signals ES1-ES3 of the CAP signal and sequentially outputs the first register 29-by the edge signals ES1-ES3. Three registers 31 are sequentially enabled to store the count data of the counter 14, respectively.

상술한 제2도의 구성에 의거 본 발명의 실시예를 상기 제3도 및 제4도의 파형도를 참조하여 상세히 설명한다.Based on the configuration of FIG. 2 described above, an embodiment of the present invention will be described in detail with reference to the waveform diagrams of FIGS. 3 and 4.

먼저 카운터 기능, 타이머 신호 발생 기능, PWM신호 발생 기능 및 캡쳐 기능을 수행하기 위해서는 제어부가 이를 제어하기 위한 선택신호들을 출력하여야 한다. 이를 위하여 먼저 상기 제어부는 타이머신호를 발생하거나 PWM신호를 발생하기 위해서 해당 신호의 주기를 설정하기 위한 기준 데이터를 상기 기준값 발생기17에 저장시킨다. 그리고 상기와 같은 복합적인 기능을 수행하기 위하여 상기 제어부는 모드레지스터10에 설정된 기능에 대응되는 제어신호를 출력한다. 이때 상기 모드레지스터10은 MOD1-MOD8로 이루어지는데, 상기 MOD1은 상기 카운터14의 카운트 클럭의 입력을 인에이블시키거나 디스에이블시키기 위한 신호를 발생하고, MOD3-MOD5는 상기 클럭의 종류를 선택하기 위한 신호를 발생하며, MOD7-MOD8은 CAP신호의 에지를 선택하기 위한 신호를 발생한다.First, in order to perform a counter function, a timer signal generation function, a PWM signal generation function, and a capture function, the controller should output selection signals for controlling the same. To this end, the controller first stores reference data for setting a period of the corresponding signal in the reference value generator 17 in order to generate a timer signal or generate a PWM signal. The control unit outputs a control signal corresponding to the function set in the mode register 10 to perform the complex function as described above. At this time, the mode register 10 is composed of MOD1-MOD8, the MOD1 generates a signal to enable or disable the input of the count clock of the counter 14, MOD3-MOD5 for selecting the type of the clock. A signal is generated, and the MOD7-MOD8 generates a signal for selecting an edge of the CAP signal.

먼저 카운트 데이터의 발생 과정을 설명한다.First, a generation process of count data will be described.

클럭선택기11은 상기 MOD3-MOD5로부터 출력되는 클럭선택신호에 의해 수신되는 내부클럭 및 외부 클럭 중 해당하는 클럭 소스를 선택하여 프리스케일러12에 인가한다. 그러면 상기 프리스케일러12는 수신되는 클럭 소스를 스케일링하여 카운트 클럭으로 발생한다. 이때 게이트13은 상기 MOD1에서 출력되는 카운트 인에이블신호의 상태에 따라 카운트 클럭을 게이팅시키는데, 상기 카운터14는 상기 게이트13을 출력하는 카운트 클럭을 계수하여 카운트 데이터를 발생한다. 따라서 상기 카운터14는 외부의 선택에 의해 결정되는 클럭을 계수하여 카운트 데이터를 발생하며, 이로 인해 카운트 데이터의 클럭 선택을 다양화시킬 수 있다.The clock selector 11 selects a corresponding clock source among the internal clock and the external clock received by the clock selection signal output from the MOD3-MOD5 and applies it to the prescaler 12. The prescaler 12 then scales the received clock source to generate a count clock. At this time, the gate 13 gates the count clock according to the state of the count enable signal output from the MOD1, and the counter 14 counts the count clock outputting the gate 13 to generate count data. Accordingly, the counter 14 counts a clock determined by an external selection to generate count data, thereby diversifying the clock selection of the count data.

두 번째로 타이머 신호의 발생 과정을 살펴본다.Second, look at the generation process of the timer signal.

이 경우 상기 기준값 발생기17에는 상기 타이머 신호의 발생 주기를 결정하기 위해 프로그램에 의해 지정된 기준 데이터를 미리 저장시켜 놓는다. 그러면 상기 카운터14의 출력 카운트 데이터와 상기 기준 데이터를 수신하는 비교기18은 수신되는 두 데이터를 비교한 후, 두 데이터의 값이 동일한 경우에 설정된 시간이 됐음을 나타내는 타이머 신호를 발생한다. 이 경우 상기 MOD2 또는 MOD6 레지스터에 의해 타이머 모드가 설정된 상태이며, 게이트19가 상기 타이머 신호에 의해 게이팅되어 타이머인터럽트발생기20에 세트신호를 인가하게 된다. 그러면 상기 타이머 신호를 세트신호로 수신하는 타이머인터럽트발생기20은 트리거되어 상기 제어부로 타이머 인터럽트 신호가 발생됐음을 알린다. 또한 상기 비교기18을 출력하는 타이머신호는 토글래치(toggle output latch)22에 인가되며, 이로인해 토글래치22는 상기 타이머신호를 토글시키므로서, 외부로 타이머신호를 출력시킬 수 있다. 이 경우 TOE1신호는 수신되는 타이머 신호를 외부로 출력 인에이블시키기 위한 콘트롤 비트이며, P3.1신호는 상기 출력 인에이블되어 출력되는 타이머 신호를 드라이브하기 위한 신호이고, PM3.1신호는 타이머신호를 최종 출력하는 버퍼26의 상태를 인에이블/디스에이블시키기 위한 제어신호로 인가된다. 그리고 게이트21은 상기 타이머 신호의 외부 출력 기능이 선택되지 않는 경우, 상기 토글래치22에 클리어신호를 인가한다. 따라서 상기 카운터14를 타이머나 이벤트 카운터(event counter)로 사용할 수 있으며, 또한 상기 타이머로부터 발생되는 타이머신호를 타이머 인터럽트신호로 사용하거나 외부로 출력할 수 있다.In this case, the reference value generator 17 stores the reference data designated by the program in advance in order to determine the generation period of the timer signal. Then, the comparator 18 receiving the output count data of the counter 14 and the reference data compares the two received data and generates a timer signal indicating that the set time is reached when the values of the two data are the same. In this case, the timer mode is set by the MOD2 or MOD6 register, and gate 19 is gated by the timer signal to apply the set signal to the timer interrupt generator 20. Then, the timer interrupt generator 20 which receives the timer signal as a set signal is triggered to inform the controller that the timer interrupt signal has been generated. In addition, the timer signal for outputting the comparator 18 is applied to a toggle output latch 22, thereby toggling the timer signal, it is possible to output the timer signal to the outside. In this case, the TOE1 signal is a control bit for enabling the output of the received timer signal to the outside, and the P3.1 signal is a signal for driving the timer signal outputted by the output enable, and the PM3.1 signal is a timer signal. It is applied as a control signal for enabling / disabling the state of the buffer 26 to be finally output. When the external output function of the timer signal is not selected, the gate 21 applies a clear signal to the toggle latch 22. Accordingly, the counter 14 can be used as a timer or an event counter, and a timer signal generated from the timer can be used as a timer interrupt signal or output to the outside.

세 번째로 PWM신호의 발생 과정을 살펴본다.Third, look at the process of generating a PWM signal.

상기 PWM발생기27은 상기 프리스케일러12에서 출력되는 클럭과, 상기 카운터14에서 출력되는 카운트 데이터와, 상기 비교기18에서 출력되는 비교신호와, 상기 기준값 발생기17에서 출력되는 기준 데이터를 수신하여 PWM신호를 발생한다. 이때 상기 기준값 발생기17에는 상기 PWM신호의 하이 듀티를 결정하기 위한 기준 데이터값을 미리 프로그램하여 저장하여 둔다. 따라서 상기 PWM27은 상기 카운터14의 주기로 상기 기준 데이터에 의해 설정된 주기 동안 하이 듀티를 갖는 논리 신호를 발생하며, 상기 비교기18에서 상기 카운트 데이터와 기준 데이터가 동일한 신호 발생기 클리어되어 로우 듀티를 갖는 논리신호를 발생한다. 그러므로 상기 PWM발생기28은 제3도에 도시된 바와 같이 상기 기준데이터의 설정에 따라 PWM신호의 폭이 결정됨을 알 수 있다. 상기와 같은 PWM신호는 게이트23,24,25 및 버퍼26을 경유하여 외부로 출력되는데, 여기서 TOE1신호는 수신되는 PWM신호를 외부로 출력 인에이블시키기 위한 콘트롤 비트이며, P3.1신호는 상기 출력 인에이블되어 출력되는 PWM신호를 드라이브하기 위한 신호이고, PM3.1신호는 상기 PWM신호를 최종 출력하는 버퍼26의 상태를 인에이블/디스에이블시키기 위한 제어신호로 인가된다. 상기와 같이 출력되는 PWM신호는 필터 등을 통해 직류신호로 변환된 후, 모터 등의 구동신호로 인가된다.The PWM generator 27 receives the clock output from the prescaler 12, the count data output from the counter 14, the comparison signal output from the comparator 18, and the reference data output from the reference value generator 17 to generate a PWM signal. do. At this time, the reference value generator 17 stores in advance a reference data value for determining the high duty of the PWM signal. Accordingly, the PWM 27 generates a logic signal having a high duty during the period set by the reference data in the period of the counter 14, and in the comparator 18, the same signal generator with the same count data as the count data is cleared so that the logic signal having a low duty is generated. Occurs. Therefore, the PWM generator 28 can be seen that the width of the PWM signal is determined according to the setting of the reference data as shown in FIG. The PWM signal is output to the outside via the gates 23, 24, 25 and the buffer 26, where the TOE1 signal is a control bit for enabling the output of the received PWM signal to the outside, and the P3.1 signal is the output. A signal for driving a PWM signal that is enabled and output, and a PM3.1 signal is applied as a control signal for enabling / disabling a state of the buffer 26 that finally outputs the PWM signal. The PWM signal output as described above is converted into a DC signal through a filter and then applied as a drive signal such as a motor.

네 번째로 캡쳐신호의 발생 과정을 살펴본다.Fourth, the generation process of the capture signal will be described.

에지선택기28은 상기 MOD7-MOD8을 출력하는 에지선택신호에 의해 수신되는 CAP신호의 에지들을 순차적으로 검출 출력한다. 여기서 상기 CAP신호는 캡쳐 기능을 트리거시키는 신호로서, 이 신호의 트리거 구간에 대한 값을 구하면 상기 CAP신호를 캡쳐할 수 있다. 따라서 에지선택기28은 상기 에지선택신호에 의해 수신되는 CAP신호의 에지를 순차적으로 검출하는데, 여기서는 제4도에 도시된 바와 같이 제1에지신호ES1-제3에지신호ES3이 발생된다고 가정한다. 이때 상기 ES1-ES3 신호는 순차적으로 발생되며, 상기 ES1신호 발생시 제1레지스터29가 인에이블되며, 상기 ES2신호가 발생될 때 제2레지스터30이 인에이블되고, 상기 ES3신호가 발생될 때 제3레지스터31이 인에이블된다. 또한 상기 제1레지스터29-제3레지스터31은 각각 입력단이 상기 카운터14에 연결되어 있으므로, 상기 ES1-ES3신호가 발생되는 시점에서 각각 인에이블되어 해당 시점의 카운트 데이터를 저장한다. 그러므로 상기 제1레지스터29는 상기 CAP신호의 첫 번째 상승 에지(rising edge)에서 인에이블되어 그 시점에서의 카운트 데이터 CNT1을 저장하며, 상기 제2레지스터30은 상기 CAP신호의 첫번째 하강에지(falling edge)에서 인에이블되어 그 시점에서의 카운트 데이터 CNT2를 저장하며, 상기 제3레지스터31은 상기 CAP신호의 두 번째 상승 에지(rising edge)에서 인에이블되어 그 시점에서의 카운트 데이터 CNT3을 저장한다. 그리고 캡쳐 인터럽트신호를 발생하여 상기 제어부에 인가한다. 이 경우 상기 제어부는 상기 MOD7-MOD8에 상기 캡쳐선택신호를 라이트하므로써 상기 CAP신호의 각 에지 검출할 때마다 인터럽트신호를 발생할 수 있으며, 또한 상기 제1레지스터29-제3레지스터31의 저장 데이터 값이 바뀔 때마다 인터럽트 신호를 발생할 수 있다.The edge selector 28 sequentially detects and outputs edges of the CAP signal received by the edge selection signal outputting the MOD7-MOD8. Here, the CAP signal is a signal for triggering a capture function. If the value for the trigger section of the signal is obtained, the CAP signal can be captured. Therefore, the edge selector 28 sequentially detects edges of the CAP signal received by the edge selection signal. Here, it is assumed that the first edge signal ES1-third edge signal ES3 is generated as shown in FIG. In this case, the ES1-ES3 signals are sequentially generated, when the ES1 signal is generated, the first register 29 is enabled, when the ES2 signal is generated, the second register 30 is enabled, and when the ES3 signal is generated, the third register is enabled. Register 31 is enabled. In addition, since the first register 29 and the third register 31 are respectively connected to the counter 14 with their input terminals, the first register 29 and the third register 31 are enabled when the ES1-ES3 signal is generated, respectively, and store count data of the corresponding time. Therefore, the first register 29 is enabled at the first rising edge of the CAP signal to store the count data CNT1 at that time, and the second register 30 is the first falling edge of the CAP signal. Is enabled at the point of time, and stores the count data CNT2 at that time, and the third register 31 is enabled at the second rising edge of the CAP signal to store the count data CNT3 at that time. A capture interrupt signal is generated and applied to the controller. In this case, the controller may generate an interrupt signal for each edge detection of the CAP signal by writing the capture selection signal to the MOD7-MOD8, and the stored data values of the first register 29 and the third register 31 Each change can generate an interrupt signal.

상술한 바와 같이 본 발명은 단일 타이머 회로를 이용하여 카운터 기능, 타이머 신호의 발생 기능, PWM 신호의 발생 기능 및 캡쳐신호의 발생 기능을 수행하는 복합 신호를 발생하는 집적회로를 제작할 수 있으며, 이 경우 칩 레이 아웃 상의 가장 큰 면적으로 차지하는 타이머 회로를 공용으로 사용하므로써, 단일 집적회로화할 때 칩 사이즈를 작게할 수 있는 효과가 있다.As described above, the present invention can manufacture an integrated circuit that generates a composite signal that performs a counter function, a timer signal generation function, a PWM signal generation function, and a capture signal generation function by using a single timer circuit. In this case, By using a timer circuit that occupies the largest area on the chip layout in common, there is an effect that the chip size can be reduced when a single integrated circuit is used.

Claims (7)

신호발생회로에 있어서,In the signal generating circuit, 수신되는 클럭을 계수하여 카운트 데이터를 발생하는 카운트 수단과,Counting means for counting the received clock to generate count data; 소정 타이머 주기를 설정하기 위한 기준 데이터를 발생하는 기준값 발생기와,A reference value generator for generating reference data for setting a predetermined timer period; 상기 카운트 데이터와 기준 데이터를 입력하며, 입력되는 상기 두 데이터들을 비교하여 동일할 때 타이머 신호를 발생하는 비교수단과,Comparison means for inputting the count data and the reference data, and comparing the two input data and generating a timer signal when the count data and the reference data are the same; 소정의 신호를 수신하며, 상기 제어부에서 출력되는 에지선택신호에 의해 상기 수신되는 소정 신호의 에지 변화를 순차적으로 검출하고, 상기 에지 검출시점에서 상기 카운트 데이터를 수신 및 저장하여 수신되는 신호를 자동적으로 캡쳐하는 수단으로 구성되는 것을 특징으로하는 복합신호 발생회로.Receives a predetermined signal, sequentially detects the edge change of the received predetermined signal by the edge selection signal output from the control unit, and automatically receives the received signal by receiving and storing the count data at the edge detection point. A composite signal generation circuit, characterized in that consisting of means for capturing. 제4항에 있어서, 상기 카운트 수단이,The method of claim 4, wherein the counting means, 내부 및 외부 클럭들을 입력하며, 클럭 선택신호에 의해 상기 입력되는 두 클럭들 중의 해당하는 클럭을 선택하는 클럭 선택기와,A clock selector which inputs internal and external clocks and selects a corresponding one of the two input clocks by a clock selection signal; 상기 선택된 클럭을 계수하여 상기 카운트 데이터를 발생하는 카운터와,A counter for counting the selected clock to generate the count data; 상기 제어부에서 출력되는 클리어신호의 상기 타이머신호를 입력하며, 입력되는 상기 두 신호들을 논리조합하여 상기 카운터의 동작 주기를 설정하는 신호 및 상기 카운터의 초기화 신호로 인가하는 수단으로 구성된 것을 특징으로 하는 복합신호 발생회로.And a means for inputting the timer signal of the clear signal output from the control unit, and applying the signal as an initializing signal of the counter and a signal for setting the operation period of the counter by logically combining the two signals inputted. Signal generating circuit. 제6항에 있어서, 상기 비교기 수단의 출력을 세트신호로 입력하며, 상기 타이머 신호 발생시 상기 제어부에 타이머 인터럽트신호를 발생하는 수단을 더 구비한 것으로 특징으로 하는 복합신호 발생회로.7. The composite signal generation circuit according to claim 6, further comprising means for inputting the output of the comparator means as a set signal and generating a timer interrupt signal to the controller when the timer signal is generated. 제1항 내지 제3항 중의 어느 한 항에 있어서, 상기 캡쳐신호를 발생하는 수단이,According to any one of claims 1 to 3, wherein the means for generating the capture signal, 상기 제어부로부터 발생되는 에지선택신호에 의해 수신되는 신호의 제1상승 에지신호, 제1하강에지신호, 제2상승에지신호를 검출하여 순차적으로 출력하는 에지선택기와,An edge selector for detecting and sequentially outputting a first rising edge signal, a first falling edge signal, and a second rising edge signal of the signal received by the edge selection signal generated from the controller; 상기 카운트 데이터를 각각 입력하며, 각각 대응되는 상기 제1상승에지신호, 제1하강에지신호, 상기 제2상승에지신호에 의해 각각 활성화되어 해당하는 시점에서 입력되는 상기 카운트 데이터를 각각 저장하는 제1레지스터, 제2레지스터 및 제3레지스터와,A first input of the count data, each of which is activated by the corresponding first rising edge signal, first falling edge signal, and second rising edge signal to respectively store the count data input at a corresponding time; A register, a second register and a third register, 상기 에지선택기의 출력을 세트신호로 입력하며, 상기 에지검출신호가 발생될 때 캡쳐인터럽트신호를 발생하여 상기 제어부에 출력하는 수단으로 구성되는 것을 특징으로 하는 복합신호 발생회로.And means for inputting the output of the edge selector as a set signal and generating a capture interrupt signal to the controller when the edge detection signal is generated. 제어부에서 출력되는 모드선택신호를 내부에 입력하는 입력수단과,Input means for internally inputting a mode selection signal output from the control unit; 상기 모드선택신호 중의 클럭 선택신호에 의해 복수개의 클럭들 중 해당하는 클럭을 선택하고, 상기 선택된 클럭을 계수하여 카운트 데이터를 발생하는 카운트 수단과,Counting means for selecting a corresponding one of a plurality of clocks by a clock selection signal of the mode selection signal, and counting the selected clock to generate count data; 타이머 주기를 설정하기 위한 기준 데이터를 발생하는 기준값 발생기와,A reference value generator for generating reference data for setting a timer period; 상기 카운트 데이터 및 기준데이터를 입력하며, 상기 입력되는 상기 두 데이터들을 비교하여 상기 두 데이터들이 동일해지는 시점에서 상기 타이머신호를 발생하는 비교수단과,Comparison means for inputting the count data and the reference data, and comparing the two inputted data to generate the timer signal at a time point when the two data are the same; 상기 클럭신호, 카운트 데이터, 타이머 신호 및 기준데이터들을 입력하며, 상기 카운트 데이터에 의해 1주기가 설정되고 상기 기준데이터 주기 동안 인에이블되는 PWM신호를 발생하는 수단과,Means for inputting the clock signal, count data, timer signal, and reference data, and generating a PWM signal in which one cycle is set by the count data and enabled during the reference data period; 소정의 신호를 수신하며, 상기 모드선택신호들 중의 에지선택신호에 의해 입력되는 상기 신호의 에지 변화를 순차적으로 검출하고, 상기 에지 검출 시점에서 상기 카운트 데이터를 저장하여 수신되는 신호를 자동적으로 캡쳐하는 수단으로 구성된 것을 특징으로 하는 복합신호 발생회로.Receiving a predetermined signal, sequentially detecting an edge change of the signal input by an edge selection signal among the mode selection signals, and automatically storing the count data at the edge detection time point to automatically capture the received signal; A composite signal generating circuit comprising a means. 제5항에 있어서, 상기 비교수단의 출력을 세트신호로 입력하며, 상기 타이머신호가 발생될 때 타이머 인터럽트를 신호를 발생하여 상기 제어부에 출력하는 수단을 더 구비한 것을 특징으로 하는 복합신호 발생회로.The combined signal generating circuit according to claim 5, further comprising means for inputting the output of the comparing means as a set signal and generating a timer interrupt signal and outputting the signal to the controller when the timer signal is generated. . 제5항 또는 제6항에 있어서, 상기 캡쳐신호를 발생하는 수단이,The method of claim 5 or 6, wherein the means for generating the capture signal, 상기 제어부로부터 발생되는 에지선택신호에 의해 수신되는 신호의 제1상승 에지신호, 제1하강에지신호, 제2상승에지신호를 검출하여 순차적으로 출력하는 에지선택기와,An edge selector for detecting and sequentially outputting a first rising edge signal, a first falling edge signal, and a second rising edge signal of the signal received by the edge selection signal generated from the controller; 상기 카운트 데이터를 각각 입력하며, 각각 대응되는 상기 제1상승에지신호, 제1하강에지신호, 상기 제2상승에지신호에 의해 각각 활성화되어 해당하는 시점에서 입력되는 상기 카운트 데이터를 각각 저장하는 제1레지스터, 제2레지스터 및 제3레지스터와,A first input of the count data, each of which is activated by the corresponding first rising edge signal, first falling edge signal, and second rising edge signal to respectively store the count data input at a corresponding time; A register, a second register and a third register, 상기 에지선택기의 출력을 세트신호로 입력하며, 상기 에지검출신호가 발생될 때 캡쳐인터럽트신호를 발생하여 상기 제어부에 출력하는 수단으로 구성되는 것을 특징으로 하는 복합신호 발생회로.And means for inputting the output of the edge selector as a set signal and generating a capture interrupt signal to the controller when the edge detection signal is generated.
KR1019920013684A 1992-07-30 1992-07-30 Signal generating circuit KR100247218B1 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
KR1019920013684A KR100247218B1 (en) 1992-07-30 1992-07-30 Signal generating circuit

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
KR1019920013684A KR100247218B1 (en) 1992-07-30 1992-07-30 Signal generating circuit

Publications (2)

Publication Number Publication Date
KR940003183A KR940003183A (en) 1994-02-21
KR100247218B1 true KR100247218B1 (en) 2000-03-15

Family

ID=19337247

Family Applications (1)

Application Number Title Priority Date Filing Date
KR1019920013684A KR100247218B1 (en) 1992-07-30 1992-07-30 Signal generating circuit

Country Status (1)

Country Link
KR (1) KR100247218B1 (en)

Also Published As

Publication number Publication date
KR940003183A (en) 1994-02-21

Similar Documents

Publication Publication Date Title
KR970704264A (en) Digital Pulse Width Modulator with Integrated Test and Control
US4002926A (en) High speed divide-by-N circuit
EP0388131A2 (en) Random number generator
KR0151261B1 (en) Pulse width modulation circuit
KR0139764B1 (en) Pulse generator for generating a variable-width pulse having a small delay
KR100247218B1 (en) Signal generating circuit
US20050140390A1 (en) Finite state machine circuit
KR940001150A (en) Partially Decoded Test Address Generator and Count Generation Method
KR100594315B1 (en) Multiple pulse generator
JP2773546B2 (en) Pulse generation circuit
SU1695342A1 (en) Device for counting number of articles
KR100494114B1 (en) Timer circuit
RU2125341C1 (en) Square-pulse generator
SU1100721A1 (en) Device for delaying rectangular pulses
RU2337389C1 (en) Device for operational control
KR100657162B1 (en) Programmable pulse width modulation circuit
SU1185601A1 (en) Forward=backward counter
SU1012238A1 (en) Number comparison device
KR100275684B1 (en) Digital filter
SU1013954A1 (en) Pseudo-random sequency generator
JPH0534409A (en) Test mode control signal generating circuit
JPH0991056A (en) Clock driving circuit
JP3051937B2 (en) Variable counting pulse signal generator
SU1272492A1 (en) Pulse-duration discriminator
KR100384783B1 (en) Test mode enable signal generator for micom

Legal Events

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

Payment date: 20071203

Year of fee payment: 9

LAPS Lapse due to unpaid annual fee