Deprecated: The each() function is deprecated. This message will be suppressed on further calls in /home/zhenxiangba/zhenxiangba.com/public_html/phproxy-improved-master/index.php on line 456
JPH0731253B2 - Digital controller - Google Patents
[go: Go Back, main page]

JPH0731253B2 - Digital controller - Google Patents

Digital controller

Info

Publication number
JPH0731253B2
JPH0731253B2 JP4073640A JP7364092A JPH0731253B2 JP H0731253 B2 JPH0731253 B2 JP H0731253B2 JP 4073640 A JP4073640 A JP 4073640A JP 7364092 A JP7364092 A JP 7364092A JP H0731253 B2 JPH0731253 B2 JP H0731253B2
Authority
JP
Japan
Prior art keywords
interrupt
time
memory area
interrupt signal
program
Prior art date
Legal status (The legal status 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 status listed.)
Expired - Lifetime
Application number
JP4073640A
Other languages
Japanese (ja)
Other versions
JPH0627260A (en
Inventor
貞雄 高瀬
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Nissan Motor Co Ltd
Original Assignee
Nissan Motor Co Ltd
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 Nissan Motor Co Ltd filed Critical Nissan Motor Co Ltd
Priority to JP4073640A priority Critical patent/JPH0731253B2/en
Publication of JPH0627260A publication Critical patent/JPH0627260A/en
Publication of JPH0731253B2 publication Critical patent/JPH0731253B2/en
Anticipated expiration legal-status Critical
Expired - Lifetime legal-status Critical Current

Links

Landscapes

  • Microcomputers (AREA)
  • Measurement Of Unknown Time Intervals (AREA)
  • Debugging And Monitoring (AREA)

Description

【発明の詳細な説明】Detailed Description of the Invention

【0001】[0001]

【産業上の利用分野】本発明はマイクロコンピュータを
用いたディジタル制御装置に関し、特に経過時間の計測
機能(いわゆるプログラマブル・タイマ)に関する。
BACKGROUND OF THE INVENTION 1. Field of the Invention The present invention relates to a digital controller using a microcomputer, and more particularly to a function of measuring elapsed time (so-called programmable timer).

【0002】[0002]

【従来の技術】マイクロコンピュータを用いたディジタ
ル制御装置、例えば内燃機関の制御装置においては、或
る時点からの経過時間に応じて制御内容(燃料噴射量
等)を切り換えることが頻繁に行なわれる。そのため経
過時間を計測する手段が必要であるが、従来は例えば図
3に示すごときタイマ(計時手段)が用いられていた。
図3において、1はマイクロコンピュータの中央演算装
置(以下CPUと記す)、2は適当なビットのアドレッ
シング可能なラッチ、3は同ビットのアドレッシング可
能なカウンタ、4はデータバスである。通常、ラッチ2
へ書き込み動作を行なうことによってリセットすると共
にカウンタ3を所定の値にプリセットし、その時点から
カウンタ3は、クロックパルスS1が入力するごとにプ
リセットされた内容からクロックパルス数を順次減算
し、内容が0になったとき、すなわちクロックパルス数
がプリセットした所定値に達したとき信号を発生する。
この信号を用いて適当なインタラプトフラグをセット
し、CPU1に対して割込みをかけるように構成されて
いる。
2. Description of the Related Art In a digital control device using a microcomputer, for example, a control device for an internal combustion engine, control contents (fuel injection amount, etc.) are frequently switched according to the elapsed time from a certain time. Therefore, a means for measuring the elapsed time is required, but in the past, for example, a timer (time measuring means) as shown in FIG. 3 has been used.
In FIG. 3, 1 is a central processing unit (hereinafter referred to as CPU) of a microcomputer, 2 is a latch capable of addressing an appropriate bit, 3 is a counter capable of addressing the same bit, and 4 is a data bus. Usually latch 2
The counter 3 is reset by performing a write operation to the counter 3 and preset to a predetermined value. From that point, the counter 3 sequentially subtracts the number of clock pulses from the preset content every time the clock pulse S 1 is input, When 0, that is, when the number of clock pulses reaches a preset predetermined value, a signal is generated.
This signal is used to set an appropriate interrupt flag and interrupt the CPU 1.

【0003】[0003]

【発明が解決しようとする課題】しかし上記のごとき従
来のタイマにおいては、タイマ動作の数及び動作モード
に対応した数だけのラッチ及びカウンタが必要となるの
で、装置が複雑で高価となり、また計測時間を割込み動
作によってCPUに入力するため、タイマ動作を多く用
いる場合には割込み回数が多くなって割込み処理時間が
増加し、他の演算処理に影響を生じるという問題があ
る。
However, in the conventional timer as described above, the number of latches and counters corresponding to the number of timer operations and operation modes is required, so that the apparatus is complicated and expensive, and the measurement is also difficult. Since the time is input to the CPU by the interrupt operation, when many timer operations are used, there is a problem that the number of interrupts increases and the interrupt processing time increases, which affects other arithmetic processing.

【0004】本発明は上記のごとき従来技術の問題を解
決するためになされたものであり、装置を簡略化し、か
つタイマ動作に伴う割込み回数の増加等の問題を解消し
たディジタル制御装置を提供することを目的とする。
The present invention has been made in order to solve the problems of the prior art as described above, and provides a digital control device which simplifies the device and solves the problems such as the increase in the number of interrupts accompanying the timer operation. The purpose is to

【0005】[0005]

【課題を解決するための手段】上記の目的を達成するた
め、本発明においては、特許請求の範囲に記載するよう
に構成している。すなわち、本発明においては、中央演
算装置と、記憶装置と、上記中央演算装置とは別個に設
けられた割込み信号発生手段と、を備え、上記割込み信
号発生手段は、上記中央演算装置に割り込みを発生させ
る信号すなわち割込み信号を所定タイミング毎に発生す
るものであり、上記中央演算装置は、上記割込み信号が
与えられる毎に発生する割込みによって被制御機器の制
御量を決定するプログラムを起動させると共に、上記記
憶装置の所定のメモリエリアの内容を上記割込み信号
基づいて所定時点でクリアし、上記の被制御機器の制御
量を決定するプログラムを起動させる割込みが発生する
ごとに上記メモリエリアの内容を歩進させ、上記メモリ
エリアの内容により、上記クリアした時点からの上記割
込みによって起動されるプログラムの実行回数を計測す
る、ように構成している。
In order to achieve the above object, the present invention is constructed as described in the claims. That is, in the present invention, the central performance
The arithmetic unit, the storage unit, and the central processing unit are installed separately.
Interrupt signal generating means, and
The signal generating means causes the central processing unit to generate an interrupt.
Signal, that is, an interrupt signal, is generated at a predetermined timing
In the central processing unit, the interrupt signal is
The controlled device is controlled by an interrupt that occurs each time it is given.
A program for determining the control amount is started, and the contents of a predetermined memory area of the storage device are cleared at a predetermined time point based on the interrupt signal to control the controlled device .
The content of the memory area is stepped up each time an interrupt for activating the program for determining the amount is generated, and the number of executions of the program started by the interrupt from the point of clearing is measured by the content of the memory area. , Is configured.

【0006】[0006]

【作用】上記のように、記憶装置内の所定のメモリエリ
アの内容を、被制御機器の制御量を決定するプログラム
を起動させる割込み信号に基づいて所定時点でクリア
し、割込み要求があるごとに順次歩進させれば、上記の
メモリエリアには上記クリアした時点からの一定時間毎
に与えられる割込み要求の回数が計数されて記憶され
る。したがって一つの演算ルーチンにおいて上記のメモ
リエリアの内容を読み出せば、経過時間を知ることが出
来る。また上記内容と所定の値とを比較すれば、経過時
間が所定の設定値に達したか否かを検知することが出来
る。また、上記の割り込みは、中央演算装置とは別個に
設けた割込み信号発生手段からの割込み信号によって行
ない、かつその割込み信号によって起動されるプログラ
ムは被制御機器の制御量を決定するプログラムであるこ
とにより、割込みの回数が増加して割込み処理時間が増
大し、他の演算処理に影響を生じる等の問題を回避する
ことが出来る
As described above, the content of the predetermined memory area in the storage device is cleared at a predetermined time point based on the interrupt signal that activates the program that determines the control amount of the controlled device , and every time there is an interrupt request. When the steps are sequentially performed, the number of interrupt requests given at every constant time from the time of the clear is counted and stored in the memory area. Therefore, the elapsed time can be known by reading the contents of the above memory area in one arithmetic routine. Further, by comparing the above contents with a predetermined value, it is possible to detect whether or not the elapsed time has reached a predetermined set value. In addition, the above interrupt is independent of the central processing unit.
Depending on the interrupt signal from the provided interrupt signal generation means
Program that is not activated by the interrupt signal
Is a program that determines the controlled variable of the controlled device.
Causes the number of interrupts to increase and interrupt processing time to increase.
To avoid problems such as affecting other arithmetic processing
You can

【0007】[0007]

【実施例】図1は本発明の一実施例のブロック図であ
る。図1において、5はメモリであり、M1〜Mnはそれ
ぞれタイマ動作に用いるメモリエリアである。また6は
クロックパルス発生器である。クロックパルス発生器6
は、所定時間毎(例えば10ms毎)にクロックパルスS
2を出力し、このクロックパルスS2によってCPU1へ
割込み要求を発生する。なお、この割込み要求は演算開
始用の割込みであって通常の演算過程で発生するもので
ある。CPU1は上記の割込み要求に応じて演算ルーチ
ンを実行するが、この演算ルーチンの内において計時動
作を行なわせる。まず、メモリ5内の所定のメモリエリ
アM1〜Mnの内容を、上記の割込みを発生させる信号に
基づいて所定時点でクリアし、割込み要求があるごとに
順次歩進させる。したがってメモリエリアM1〜Mnには
クリアした時点以後の一定時間毎に与えられる割込み要
求の回数が計数されて記憶される。次に一つの演算ルー
チンにおいてメモリエリアM1〜Mn中の特定のメモリエ
リアの内容を読み出せば、経過時間を知ることが出来
る。また上記内容と所定の値とを比較すれば、経過時間
が所定の設定値に達したか否かを検知することが出来
る。上記の構成によれば、計時動作が全てマイクロコン
ピュータ内部で行なわれるので、メモリエリアM1〜Mn
の個数を必要なタイマ機能の数だけ用意すれば良いこと
になり、構成を大幅に簡略化することが出来る。
FIG. 1 is a block diagram of an embodiment of the present invention. In FIG. 1, 5 is a memory, and M 1 to M n are memory areas used for timer operations. Reference numeral 6 is a clock pulse generator. Clock pulse generator 6
Is a clock pulse S every predetermined time (eg, every 10 ms)
2 is output, and an interrupt request is generated to the CPU 1 by this clock pulse S 2 . It should be noted that this interrupt request is an interrupt for starting a calculation and is generated in a normal calculation process. The CPU 1 executes an arithmetic routine in response to the above interrupt request, and causes the time counting operation to be performed within this arithmetic routine. First, the contents of predetermined memory area M 1 ~M n in the memory 5, and cleared by a predetermined time on the basis of a signal for generating the interrupt, is sequentially incremented each time an interrupt request. Therefore, in the memory areas M 1 to M n , the number of interrupt requests given at every constant time after the time of clearing is counted and stored. Next, in one calculation routine to read out specific contents of the memory area in the memory area M 1 ~M n, it is possible to know the elapsed time. Further, by comparing the above contents with a predetermined value, it is possible to detect whether or not the elapsed time has reached a predetermined set value. According to the above configuration, since all the timekeeping operations are performed inside the microcomputer, the memory areas M 1 to M n are
It is only necessary to prepare as many as necessary timer functions, and the configuration can be greatly simplified.

【0008】次に実際の演算内容の一実施例を図2に示
す。
FIG. 2 shows an example of the actual contents of calculation.

【0009】図2は、内燃機関の燃料噴射量の演算にお
いて、機関始動時に所定時間(例えば3秒間)のあいだ
燃料増量を行なう場合のフローチャートである。すなわ
ちこの場合には、始動開始時点から3秒間経過したか否
かを計測することが必要となる。図2において、まずP
1において基本燃料噴射量PW1を演算する。次にP2
おいて、スタータモータを作動させるスタータスイッチ
がONかOFFかを判定し、OFFの場合すなわち始動
中でない場合には、P3に行ってスタートフラグ(始動
開始時点を検出するためのフラグ)を0にしたのち直ち
にENDへ行く。一方、P2がONの場合にはP4に行
き、スタートフラグが1か0かを判定する。P4におい
てスタートフラグが0の場合、すなわち始動開始時点
(スタータスイッチがONになった直後)には、P5
行ってメモリエリアM1(この場合にタイマとして動作
するメモリエリア)をクリアし、かつスタートフラグを
1にしたのちP6に行く。一方、P4でスタートフラグが
1の場合、すなわち始動中の場合には直ちにP6に行
く。P6は経過時間の判定を行なうルーチンであり、メ
モリエリアM1の内容を所定値と比較して3秒以上か未
満かを判定する。例えばクロックパルスS2の周期が1
0msであれば、メモリエリアM1の内容が300の場合
に3秒に相当する。
FIG. 2 is a flow chart in the case of calculating the fuel injection amount of the internal combustion engine in the case of increasing the fuel amount for a predetermined time (for example, 3 seconds) at the time of starting the engine. That is, in this case, it is necessary to measure whether or not 3 seconds have elapsed from the start of starting. In FIG. 2, first, P
At 1 , the basic fuel injection amount PW 1 is calculated. Next, in P 2, a starter switch for actuating the starter motor, it is determined whether ON or OFF, and if not set to OFF namely in startup, flag for detecting the start flag (the start beginning to go to P 3 ) Is set to 0, and immediately goes to END. On the other hand, when P 2 is ON, it goes to P 4 and determines whether the start flag is 1 or 0. If the start flag is 0 at P 4 , that is, at the start of starting (immediately after the starter switch is turned on), go to P 5 and clear the memory area M 1 (in this case, the memory area that operates as a timer). , And after setting the start flag to 1, go to P 6 . On the other hand, if the start flag is 1 at P 4 , that is, if the engine is being started, the program immediately goes to P 6 . P 6 is a routine for determining the elapsed time, and compares the content of the memory area M 1 with a predetermined value to determine whether it is 3 seconds or more or less. For example, the cycle of the clock pulse S 2 is 1
When it is 0 ms, it corresponds to 3 seconds when the content of the memory area M 1 is 300.

【0010】P6でYESの場合、すなわち始動開始時
点から3秒以上経過している場合には、燃料増量を行な
わずに直ちにENDへ行く。P6がNOの場合、すなわ
ち3秒未満の場合にはP7で所定の燃料増量(PW2=P
1×K)を行なってからENDへ行く。上記のよう
に、メモリ内の特定のメモリエリアの内容を一定時間毎
に歩進させ、かつそのメモリエリアの内容を所定値と比
較すれば、クリアした時点から所定時間経過したか否か
を判別することが出来る。
If P 6 is YES, that is, if 3 seconds or more have elapsed from the start of the engine start, the fuel consumption is not increased and the engine immediately goes to END. When P 6 is NO, that is, when it is less than 3 seconds, the predetermined fuel amount is increased at P 7 (PW 2 = P
W 1 go × K) are performed, and then to END. As described above, if the content of a specific memory area in the memory is stepped at regular intervals and the content of the memory area is compared with a predetermined value, it is determined whether or not a predetermined time has passed from the time of clearing. You can do it.

【0011】[0011]

【発明の効果】以上説明したごとく本発明によれば、マ
イクロコンピュータ内の演算のみよって経過時間の計測
を行なうように構成したので、従来のように余分な割込
み要求が増加することがなく、演算処理時間を短縮する
ことが出来る。また、ラッチやカウンタ等の付加装置が
不要なので、構成が簡略で安価になる等の効果がある。
As described above, according to the present invention, since the elapsed time is measured only by the calculation in the microcomputer, there is no increase in extra interrupt request as in the conventional case, and the calculation is not performed. The processing time can be shortened. Moreover, since an additional device such as a latch or a counter is not required, there is an effect that the configuration is simple and the cost is low.

【図面の簡単な説明】[Brief description of drawings]

【図1】本発明の一実施例のブロック図。FIG. 1 is a block diagram of an embodiment of the present invention.

【図2】本発明の演算過程を示すフローチャートの一実
施例図。
FIG. 2 is an embodiment of a flowchart showing a calculation process of the present invention.

【図3】従来装置の一例のブロック図。FIG. 3 is a block diagram of an example of a conventional device.

【符号の説明】[Explanation of symbols]

1…マイクロコンピュータの中央演算装置(CPU) 2…アドレッシング可能なラッチ 3…アドレッシング可能なカウンタ 4…データバス 5…メモリ 6…クロックパルス発生器 S1、S2…クロックパルス M1〜Mn…タイマ動作に用いるメモリエリア1 ... central processing unit of a microcomputer (CPU) 2 ... addressable latch 3 ... addressable counter 4 ... data bus 5 ... memory 6 ... clock pulse generator S 1, S 2 ... clock pulse M 1 ~M n ... Memory area used for timer operation

Claims (1)

【特許請求の範囲】[Claims] 【請求項1】中央演算装置と、 記憶装置と、 上記中央演
算装置とは別個に設けられた割込み信号発生手段と、
備え、 上記割込み信号発生手段は、上記中央演算装置に
割り込みを発生させる信号すなわち割込み信号を所定タ
イミング毎に発生するものであり、 上記中央演算装置
は、上記割込み信号が与えられる毎に発生する割込みに
よって被制御機器の制御量を決定するプログラムを起動
させると共に、上記記憶装置の所定のメモリエリアの内
容を上記割込み信号に基づいて所定時点でクリアし、上
記の被制御機器の制御量を決定するプログラムを起動さ
せる割込みが発生するごとに上記メモリエリアの内容を
歩進させ、上記メモリエリアの内容により、上記クリア
した時点からの上記割込みによって起動されるプログラ
ムの実行回数を計測する、ものであることを特徴とする
ディジタル制御装置。
1. A central processing unit, a storage unit, and the central operating unit.
An interrupt signal generating means which is provided separately from the calculation unit, the
The interrupt signal generating means is provided in the central processing unit.
A signal that causes an interrupt, that is, an interrupt signal, is
The above central processing unit
Is an interrupt generated each time the above interrupt signal is given.
Therefore, start the program that determines the controlled variable of the controlled device.
Together is, the memory area each time the interrupt to activate the program a predetermined content of the memory area of the storage device based on the interrupt signal is cleared at a predetermined time, determines a control amount of the control target equipment is generated The digital control device is characterized in that the number of executions of the program started by the interrupt from the time of the clear is measured based on the content of the memory area.
JP4073640A 1992-03-30 1992-03-30 Digital controller Expired - Lifetime JPH0731253B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP4073640A JPH0731253B2 (en) 1992-03-30 1992-03-30 Digital controller

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP4073640A JPH0731253B2 (en) 1992-03-30 1992-03-30 Digital controller

Related Parent Applications (1)

Application Number Title Priority Date Filing Date
JP6771479A Division JPS55159183A (en) 1979-05-31 1979-05-31 Digital control unit

Publications (2)

Publication Number Publication Date
JPH0627260A JPH0627260A (en) 1994-02-04
JPH0731253B2 true JPH0731253B2 (en) 1995-04-10

Family

ID=13524097

Family Applications (1)

Application Number Title Priority Date Filing Date
JP4073640A Expired - Lifetime JPH0731253B2 (en) 1992-03-30 1992-03-30 Digital controller

Country Status (1)

Country Link
JP (1) JPH0731253B2 (en)

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPS52146667A (en) * 1976-06-01 1977-12-06 Seiko Instr & Electronics Ltd Digital electronic watch

Also Published As

Publication number Publication date
JPH0627260A (en) 1994-02-04

Similar Documents

Publication Publication Date Title
US4350950A (en) Frequency measuring method and apparatus
US4372274A (en) Digital control system for internal combustion engine
JPH0797321B2 (en) Interrupt signal processing method
JPH0731253B2 (en) Digital controller
JPH0731254B2 (en) Digital controller
JPH0337153B2 (en)
JPH0534474A (en) Measurement timer device
JP2773546B2 (en) Pulse generation circuit
JPH03118644A (en) Program execution monitor
JPS6316579B2 (en)
JP4345200B2 (en) Programmable controller I/O unit
JPS6025166Y2 (en) counting device
JP2604562B2 (en) Pulse interval measuring device
JPH0464099B2 (en)
JP3224554B2 (en) Schedule control device
JPS60225065A (en) Vehicle speed detection
SU1612312A1 (en) Device for modeling the process of software support inspection
JP2624798B2 (en) Processing unit debugging mechanism
SU1128266A1 (en) Device for collecting statistical data concerning operation of computer programs
JPS5886619A (en) Electronic computer
JP2886766B2 (en) Oxygen sensor drive
SU646375A1 (en) Storage unit monitoring device
JPH01243140A (en) controller
JP2793425B2 (en) Data processing device
JPH02674B2 (en)