KR960001092B1 - Clock-counting method for regular time-out interrupt - Google Patents

Clock-counting method for regular time-out interrupt Download PDF

Info

Publication number
KR960001092B1
KR960001092B1 KR1019930024330A KR930024330A KR960001092B1 KR 960001092 B1 KR960001092 B1 KR 960001092B1 KR 1019930024330 A KR1019930024330 A KR 1019930024330A KR 930024330 A KR930024330 A KR 930024330A KR 960001092 B1 KR960001092 B1 KR 960001092B1
Authority
KR
South Korea
Prior art keywords
ccr
bcr
mcr
value
clock
Prior art date
Application number
KR1019930024330A
Other languages
Korean (ko)
Other versions
KR950015032A (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 KR1019930024330A priority Critical patent/KR960001092B1/en
Publication of KR950015032A publication Critical patent/KR950015032A/en
Application granted granted Critical
Publication of KR960001092B1 publication Critical patent/KR960001092B1/en

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F1/00Details not covered by groups G06F3/00 - G06F13/00 and G06F21/00
    • G06F1/04Generating or distributing clock signals or signals derived directly therefrom
    • G06F1/06Clock generators producing several clock signals

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Electric Clocks (AREA)
  • Programmable Controllers (AREA)

Abstract

initializing a timer; repeating the above operation until a raising edge by checking the raising edge; checking a value of a CCR when a clock is at the raising edge; in case of a value "0", copying a MCR on the CCR; in case that the CCR is not 0" and a BCR is not "0", checking whether the BCR is "0" or not; in case that the CCR is "1" and the BCR is "0", copying the MCR on the CCR, and the MCR on the BCR; checking whether the CCR is not "1" and whether the BCR is "0"; in case that the BCR is "0", reducing the CCR by 1, copying it on the BCR; and in case that the BCR is not "0", reducing the value of the BCR by 1.

Description

주기적인 타임아웃 인터럽트를 위한 클럭계수 방법Clock Counting Method for Periodic Timeout Interrupts

제1도는 프로그램 가능한 타이머외 프로세서의 연결도.1 is a connection diagram of a processor other than a programmable timer.

제2도는 프로그램 가능한 타이머의 내부 레지스터의 구성도.2 is a schematic diagram of an internal register of a programmable timer.

제3도는 본 발명에 따른 흐름도.3 is a flow chart according to the present invention.

* 도면의 주요부분에 대한 부호의 설명* Explanation of symbols for main parts of the drawings

1 : 프로세서 2 : 프로세서 인터페이스회로1 processor 2 processor interface circuit

3 : 프로그램 가능한 타이머 4 : MCR3: programmable timer 4: MCR

5,9 : 보류 6 : 계수단위5,9: Reserved 6: Counting unit

7 : 최대 계수치 8 : CCR7: maximum count value 8: CCR

10 : 현재 계수치 11 : BCR10: current count value 11: BCR

본 발명은 프로그램이 가능한 타이머에서 주기적인 타임아웃 인터럽트를 발생시키기 위하여 계수치만큼 클럭을 계수하는 방법에 관한 것이다.The present invention is directed to a method of counting a clock by a count value to generate a periodic timeout interrupt in a programmable timer.

본 발명은 타이머가 마이크로프로세서에게 주기적인 타임아웃(time out) 인터럽트(interrupt)의 발생간격과 인터럽트의 발생 및 정지를 소프트웨어적으로 프로그램된 계수치 만큼 클럭을 계수할 수 있도록 하는 방법을 제공하는데 목적이 있다.SUMMARY OF THE INVENTION An object of the present invention is to provide a method for a timer to allow a microprocessor to count clocks at intervals of periodic time out interrupts and the occurrence and stop of interrupts by software programmed counts. have.

상기 목적을 달성하기 위하여 본 발명에서는 첨부된 도면에 의거 좀더 상세한 설명을 한다.In the present invention to achieve the above object will be described in more detail based on the accompanying drawings.

먼저, 제1도는 프로그램 가능한 타이머와 프로세서의 연결도를 나타낸다.First, FIG. 1 shows a connection diagram of a programmable timer and a processor.

제1도에서와같이 프로그램이 가능한 타이머(3)와 프로세서(1)는 프로세서 인터페이스 회로(2)를 통하여 연결되고, 프로세서 인터페이스 회로(2)는 두 모듈(1,3)사이이 인터페이스를 제공한다.As shown in FIG. 1, the programmable timer 3 and the processor 1 are connected via a processor interface circuit 2, and the processor interface circuit 2 provides an interface between the two modules 1,3.

상기 프로그램 가능한 타이머(3)에는 세개의 레지스터(register)가 있는데 이를 제2도에서와 같이 나타낸다.The programmable timer 3 has three registers, as shown in FIG.

이 세개의 레지스터중에 최대계수 레지스터(이하, ˝MCR˝이라 함)(4)와 현재 계수 레지스터(이하, ˝CCR˝이라 함)(8)는 프로그램에 의해서 접근이 가능한 레지스터이다.Of these three registers, the maximum coefficient register (hereinafter referred to as "MCR") (4) and the current coefficient register (hereinafter referred to as "CCR") (8) are registers accessible by a program.

상기 MCR(4)은 읽기와 쓰기가 가능하며 CCR(8)은 읽기만 가능하다.The MCR 4 can read and write, and the CCR 8 can only read.

상기 프로그램에 의해서 접근할 수 있는 레지스터는 32비트로 구성된다.The registers accessible by the program consist of 32 bits.

단위계수 레지스터(이하, ˝BCR˝이라 함)(11)는 프로그램으로 접근할 수 없다.The unit coefficient register (hereinafter referred to as "BCR") 11 cannot be accessed by the program.

상기 MCR(4)에는 최대계수치(7)와 계수단위(6)가 저장되며, 상위 4비트(5)는 정의하지 않는다.The MCR 4 stores the maximum coefficient value 7 and the coefficient unit 6, and the upper four bits 5 are not defined.

상기 CCR(8)에는 현재의 계수치(10)가 저장되며, 상위 8비트(9)는 정의하지 않는다.The current count value 10 is stored in the CCR 8, and the upper 8 bits 9 are not defined.

상기 BCR(11)에는 계수단위에 대한 현재의 계수치가 저장된다. MCR(4)의 최대계수치 항목(7)의 값은 V(MCR[23 : 0]), 계수단위의 값을 V(MCR[27 : 24])라 하고, 타이머 입력클럭의 주기를 tclk라고 하면, V(MCR[23 : 0])과 V(MCR[27 : 24])은The BCR 11 stores the current count value for the counting unit. The value of the maximum coefficient value item 7 of the MCR 4 is V (MCR [23: 0]), the value of the counting unit is V (MCR [27:24]), and the period of the timer input clock is t clk . V (MCR [23: 0]) and V (MCR [27: 24])

[수학식 1][Equation 1]

[수학식 2][Equation 2]

와 같이 구할 수 있으며, 주기적인 타임아웃 인터럽트의 시간간격을 t라 하면, t는If the time interval of the periodic timeout interrupt is t, t is

[수학식 3][Equation 3]

와 같이 계산된다.Is calculated as

그리고, 제3도는 프로그램이 가능한 타이머에서 주기적인 타임아웃 인터럽트를 발생시키기 위한 클럭계수방법을 나타낸 흐름도이다.3 is a flowchart illustrating a clock counting method for generating a periodic timeout interrupt in a programmable timer.

상기 타이머(3)를 리셋하여 초기화(단계 12)하면 타이머(3)의 내부 레지스터중에 MCR(4)과 CCR(8)의 모든 유효비트가 0이되고, 프로그래밍 인터페이스에 의해 MCR(4)에 쓰기가 수행되면 클럭의 계수가 시작된다.When the timer 3 is reset and initialized (step 12), all valid bits of the MCR 4 and the CCR 8 in the internal registers of the timer 3 are zeroed and written to the MCR 4 by a programming interface. When is performed, the counting of the clock starts.

이때, 상기 타이머(3)는 클럭이 상승에지일때 1개씩 계수한다.At this time, the timer 3 counts one by one when the clock is rising edge.

상기 클럭이 상승에지의 상태인가를 판단하여 상승에지가 아니면 클럭이 상승에지가 될때까지 기다린다(단계 13).It is determined whether the clock is in the rising edge state and waits until the clock reaches the rising edge (step 13).

한편, 상기 단계(13)에서 클럭이 상승에지가 되면 CCR[23 : 0](10)이 값을 검사한다(단계 14).On the other hand, when the clock reaches the rising edge in the step 13, the CCR [23: 0] (10) checks the value (step 14).

상기 단계(14)에서 상기 CCR[23 : 0](10)값이 0이면, MCR(4)의 최대계수치인 MCR[23 : 0](7)을 CCR[23 : 0](10)에 복사하고, MCR[27 : 24](6)를 BCR(11)에 복사하고서 단계(13)로 궤환된다(단계 15).If the value of CCR [23: 0] (10) in step 14 is 0, MCR [23: 0] (7), which is the maximum coefficient value of MCR (4), is copied to CCR [23: 0] (10). Then, the MCR [27: 24] (6) is copied to the BCR 11 and fed back to step 13 (step 15).

이와같이 상기 단계(15)는 새로운 계수를 시작하기 위한 로비동작이다.Thus step 15 is lobbying to start a new count.

상기 단계(14)에서 상기 CCR[23 : 0](10)이 0이 아니면, 상기 CCR[23 : 0](10)이 1이고, 상기 BCR(11)이 0인가를 판단한다(단계 16).If the CCR [23: 0] (10) is not 0 in the step 14, it is determined whether the CCR [23: 0] (10) is 1 and the BCR (11) is 0 (step 16). .

이 단계(16)에서 상기 CCR[23 : 0](10)이 1이고, 상기 BCR(11)이 0이면, 상기 타이머(3)가 타임아웃되는 것으로, 상기 MCR[23 : 0](7)을 CCR[23 : 0](10)에 복사하고, 계수단위인 MCR[27 : 24](6)을 BCR(11)에 복사한다(단계 17).In this step 16, if the CCR [23: 0] 10 is 1 and the BCR11 is 0, the timer 3 times out, and the MCR [23: 0] (7) Is copied to CCR [23: 0] (10), and MCR [27:24] (6), which is a counting unit, is copied to BCR11 (step 17).

상기 단계(16)에서 상기 CCR[23 : 0](10)이 1이 아니거나, 또는 상기 BCR(11)이 0이 아닌 경우에는 현재단위의 계수치인 BCR(11)이 0인가를 판단한다(단계 18).In the step 16, if the CCR [23: 0] (10) is not 1 or if the BCR (11) is not 0, it is determined whether the BCR (11) which is the coefficient value of the current unit is 0 ( Step 18).

상기 BCR(11)의 값이 0이면, 상기 CCR[23 : 0](10)의 값을 1씩 감소시켜 CCR[23 : 0](10)에 복사하고, MCR[27 : 24](6)을 BCR에 복사하고 상기 단계(13)로 궤환한다(단계 19).If the value of the BCR 11 is 0, the value of the CCR [23: 0] (10) is decreased by 1 and copied to the CCR [23: 0] (10), and the MCR [27:24] (6) Is copied to the BCR and fed back to step 13 (step 19).

상기 단계(18)에서 BCR(11)의 값이 0이 아니면 BCR(11)의 값을 1씩 감소시키고, 이 BCR(11)에 감소된 값을 복사하면서 다시 상기 단계(13)로 궤환된다(단계 20).If the value of the BCR 11 is not 0 in the step 18, the value of the BCR 11 is decreased by 1, and the feedback is returned to the step 13 while copying the reduced value to the BCR 11 ( Step 20).

그리고, 상기 식(3)에서 우측항에 1을 더한 것은, 상기 MCR(4)에 기록된 계수 단위(6)에 1을 더한 수를 계수한 것으로서 BCR(11)에 의한 계수단위의 계수를 나타낸다.In addition, in the above formula (3), the addition of 1 to the right term indicates the coefficient of the coefficient unit by the BCR 11, which is obtained by counting the number obtained by adding 1 to the coefficient unit 6 recorded in the MCR 4. .

상기 BCR(11)을 통하여 MCR(4)이 계수단위(6)에 1을 더한 값만큼의 계수가 끝날때마다 CCR(8)을 계수하고, MCR(4)의 최대 계수치(7)만큼을 계수하면 타임아웃이 되고, 다시 계수를 반복수행한다.Through the BCR 11, the MCR 4 counts the CCR 8 every time the count unit 6 adds 1 to the counting unit 6, and counts the maximum count value 7 of the MCR 4 by the count. Timeout and counting are repeated.

즉, BCR(11)을 통한 계수단위의 계수 즉, 프로그램이 가능한 타이머(3)에서 주기적인 타임아웃 인터럽트를 발생시키시 위하여 프로그램된 계수단위에 1을 더한 수를 먼저 내림순으로 계수하는 단계와 상기 CCR(8)을 통한 최대계수치의 계수 즉, 계수단위에 대한 계수가 끝나면 최대계수치를 내림순으로 계수하는 단계로 구성되는 2단계 계수과정을 반복하여 프로그램된 계수치 만큼 클럭을 계수하는 방법으로 이루어진다.In other words, counting the coefficients in the unit of count through the BCR 11, that is, in order of generating the periodic timeout interrupt in the programmable timer 3, the number of 1 plus the number of programmed units of counting in descending order. After counting the maximum count value through the CCR 8, that is, counting the maximum count value in descending order, the method counts the clock as much as the programmed count value by repeating the two-step counting process.

이상과 같은 상기 2단계의 계수과정으로 계수를 수행하면 계수단위(6)의 값을 변화시킴으로써 최대계수치를 계수하는 단위를 유연성 있게 조절하게 되어 다양한 시간 간격의 타임아웃 인터럽트를 발생시키는 효과가 있다.Performing the counting in the two-step counting process as described above allows the flexibility to adjust the unit for counting the maximum count value by changing the value of the counting unit 6, thereby generating timeout interrupts of various time intervals.

Claims (2)

프로그램이 되는 타이머(3)를 초기화시키는 단계(12)와, 상기 클럭 발생시에 상승에지인가를 판단하여 상승에지가 될때까지 상기 단계(12)가 다시 반복되는 단계 (13)와, 이 단계(13)에서 클럭이 상승에지가 되면 CCR[23 : 0](10)의 값을 판단하는 단계 (14)와, 이 단계(14)에서 상기 CCR[23 : 0](10)값이 0이면, MCR[23 : 0](7)을 CCR[23 : 0](10)에 복사하고, MCR[27 : 24](6)을 BCR(11)에 복사하고서 다시 상기 단계(13)로 궤환되는 단계(15)와, 상기 단계(14)에서 CCR[23 : 0](10)이 0이 아니면, 상기 CCR[23 : 0](10)이 1이고 상기 BCR(11)이 0이 아닌 경우에 BCR(11)이 0인가가 판단되는 단계(16)와, 이 단계(16)에서 상기 CCR[23 : 0](10)이 1이고, 상기 BCR(11)이 0이면, 상기 타이머(3)가 타임아웃되는 상태로서 MCR[23 : 0](7)을 CCR[23 : 0](10)에 복사하고, MCR[27 : 24](6)을 BCR(11)에 복사하여 상기 단계(13)로 궤환되는 단계(17)와, 상기 단계(16)에서 상기 CCR[23 : 0](10)이 1이 아니거나, 또는 상기 BCR(11)이 0인가를 판단하는 단계(18)와, 상기 BCR(11)이 0이면 CCR[23 : 0](10)의 값을 1씩 감소시켜 CCR[23 : 0](10)에 복사하고, MCR[27 : 24](16)을 BCR에 복사하여 상기 단계(13)로 궤환하는 단계(19)와, 상기 단계(18)에서 BCR(11)의 값이 0이 아니면 BCR(11)의 값을 1씩 감소시키고, 다시 상기 단계(13)로 궤환되는 단계(20)가 포함되는 것을 특징으로 하는 주기적인 타임아웃 인터럽트를 위한 클럭계수 방법.Initializing the timer 3 to be programmed (12), the step (13) is repeated again until the rising edge is determined by determining whether the rising edge at the time of clock generation, and this step (13) In step 14, if the clock reaches the rising edge, the value of CCR [23: 0] (10) is determined. If the value of CCR [23: 0] (10) is 0 in this step 14, the MCR Copying [23: 0] (7) to CCR [23: 0] (10), copying MCR [27:24] (6) to BCR (11) and fed back to step (13) ( 15) and if the CCR [23: 0] (10) is not 0 in the step 14, if the CCR [23: 0] (10) is 1 and the BCR (11) is not 0, then the BCR ( Step 16 determines whether 11) is 0, and if the CCR [23: 0] (10) is 1 and the BCR 11 is 0 in this step 16, the timer 3 times out. Copy the MCR [23: 0] (7) to the CCR [23: 0] (10) and copy the MCR [27:24] (6) to the BCR (11) to the step (13). Feedback step ( 17) and determining (18) whether the CCR [23: 0] (10) is not 1 or the BCR (11) is 0 in the step (16); If it is 0, the value of CCR [23: 0] (10) is decreased by 1 and copied to CCR [23: 0] (10), and MCR [27:24] (16) is copied to BCR. Returning to step 19, and if the value of BCR 11 is not 0 in step 18, the value of BCR 11 is decreased by 1, and step 20 is returned to step 13 again. Clock counting method for a periodic timeout interrupt, characterized in that it comprises a. 제1항에 있어서, 상기 클럭의 계수는 프로그램된 계수단위에 1을 더한수를 먼저 내림순으로 계수하고, 이 계수단위에 대한 계수가 끝나면 최대계수치를 내림순으로 계수하는 2단계 계수과정이 반복되는 것을 특징으로 하는 주기적인 타임아웃 인터럽트를 위한 클럭계수 방법.2. The two-step counting process of claim 1, wherein the clock coefficient is counted first in the descending order of the number of programmed counting units plus one. And a clock counting method for the periodic timeout interrupt.
KR1019930024330A 1993-11-16 1993-11-16 Clock-counting method for regular time-out interrupt KR960001092B1 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
KR1019930024330A KR960001092B1 (en) 1993-11-16 1993-11-16 Clock-counting method for regular time-out interrupt

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
KR1019930024330A KR960001092B1 (en) 1993-11-16 1993-11-16 Clock-counting method for regular time-out interrupt

Publications (2)

Publication Number Publication Date
KR950015032A KR950015032A (en) 1995-06-16
KR960001092B1 true KR960001092B1 (en) 1996-01-18

Family

ID=19368163

Family Applications (1)

Application Number Title Priority Date Filing Date
KR1019930024330A KR960001092B1 (en) 1993-11-16 1993-11-16 Clock-counting method for regular time-out interrupt

Country Status (1)

Country Link
KR (1) KR960001092B1 (en)

Families Citing this family (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
KR100522910B1 (en) * 1998-09-15 2005-12-21 주식회사 새 한 Manufacturing method of polyester flammable fabric with excellent refreshing feeling
KR100600137B1 (en) * 1999-12-17 2006-07-13 주식회사 휴비스 Preparation of polyester mixed twist yarn and polyester mixed twist yarn

Also Published As

Publication number Publication date
KR950015032A (en) 1995-06-16

Similar Documents

Publication Publication Date Title
US5894419A (en) System and method for robust clocking schemes for logic circuits
KR960001092B1 (en) Clock-counting method for regular time-out interrupt
KR950012505B1 (en) Method for cancelling time-out interrupt in programmable timer
AU654769B2 (en) Trigger signal generating circuit
JP3018404B2 (en) Microprocessor
KR950010831B1 (en) Activating method of time-out interrupt in timer
JP3949995B2 (en) Counter circuit
JPS6316711A (en) Timing device
JP4189729B2 (en) Asynchronous readout method of timer count value and timer
KR930005650B1 (en) Time delay method using timer
JPH07104851B2 (en) Data processing device
JPH0664483B2 (en) Pulse counter
JP2563503B2 (en) Signal generator
KR0185616B1 (en) Output resistor auto-clear circuit of cpu interface arithmetic circuit
JP2946606B2 (en) Counter circuit
JPS5911424A (en) Processing circuit of interruption signal
KR940001105Y1 (en) Device for stabilizing control of handshaking in dma
KR100446722B1 (en) Timer circuit, specially enabling a stable operation by generating a counter enable signal, and effectively conducting a test function by predicting a counting value of a timer
KR950010828B1 (en) Programing supporting method in programinable timer
KR20010106634A (en) Electronic system having direct memory access controller operating periodically
KR930002026Y1 (en) Resetting circuit for program of i/o device
KR930009798B1 (en) Reset-ready counter of numeric co-processor
JP2557785Y2 (en) Single chip microcomputer
SU1262479A1 (en) Adder-accumulator
JPS6426989A (en) Image processor

Legal Events

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

Payment date: 20080103

Year of fee payment: 13

LAPS Lapse due to unpaid annual fee