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
JPH0731254B2 - Digital controller - Google Patents
[go: Go Back, main page]

JPH0731254B2 - Digital controller - Google Patents

Digital controller

Info

Publication number
JPH0731254B2
JPH0731254B2 JP4073643A JP7364392A JPH0731254B2 JP H0731254 B2 JPH0731254 B2 JP H0731254B2 JP 4073643 A JP4073643 A JP 4073643A JP 7364392 A JP7364392 A JP 7364392A JP H0731254 B2 JPH0731254 B2 JP H0731254B2
Authority
JP
Japan
Prior art keywords
memory area
interrupt
time
contents
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
JP4073643A
Other languages
Japanese (ja)
Other versions
JPH0627261A (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 JP4073643A priority Critical patent/JPH0731254B2/en
Publication of JPH0627261A publication Critical patent/JPH0627261A/en
Publication of JPH0731254B2 publication Critical patent/JPH0731254B2/en
Anticipated expiration legal-status Critical
Expired - Lifetime legal-status Critical Current

Links

Landscapes

  • Measurement Of Unknown Time Intervals (AREA)
  • Debugging And Monitoring (AREA)
  • Microcomputers (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]

【課題を解決するための手段】上記の目的を達成するた
め、本発明においては、特許請求の範囲に記載するよう
に構成している。すなわち、本発明においては、中央演
算装置と、記憶装置と、上記中央演算装置とは別個に設
けられた割込み信号発生手段と、を備え、上記割込み信
号発生手段は、上記中央演算装置に割り込みを発生させ
る信号すなわち割込み信号を所定タイミング毎に発生す
るものであり、上記中央演算装置は、上記割込み信号が
与えられる毎に発生する割込みによって被制御機器の制
御量を決定するプログラムを起動させると共に、上記の
被制御機器の制御量を決定するプログラムを起動させる
割込みが発生するごとに上記記憶装置の第1のメモリエ
リアの内容を歩進させ、所定の時点における第1のメモ
リエリアの内容を第2のメモリエリアに記憶させ、第1
のメモリエリアの内容と第2のメモリエリアの内容との
差により、上記第2のメモリエリアに記憶させた時点か
らの上記割込みによって起動されるプログラムの実行回
数を計測するように構成している。
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.
The program for determining the control amount is started, and the content of the first memory area of the storage device is stepped up every time an interrupt for starting the program for determining the control amount of the controlled device is generated. The contents of the first memory area at the time point are stored in the second memory area, and
The number of executions of the program started by the interrupt from the time when the program is stored in the second memory area is measured based on the difference between the content of the second memory area and the content of the second memory area. .

【0006】[0006]

【作用】上記のように本発明においては、記憶装置内の
第1のメモリエリアの内容を、被制御機器の制御量を決
定するプログラムを起動させる割込み信号が与えられる
ごとに順次歩進させ、このメモリエリアをフリーランニ
ングカウンタとして用いる。そして、継続的に計数して
いる第1のメモリエリアの所定時点の値を第2のメモリ
エリアに記憶させ、その記憶させた値と継続して変化し
ている第1のメモリエリアの値とを比較することによ
り、第2のメモリエリアに記憶させた時点からの経過時
間を計測することが出来る。また上記の計測値と所定の
値とを比較すれば、経過時間が所定の設定値に達したか
否かを検知することが出来る。また、上記の割り込み
は、中央演算装置とは別個に設けた割込み信号発生手段
からの割込み信号によって行ない、かつその割込み信号
によって起動されるプログラムは被制御機器の制御量を
決定するプログラムであることにより、割込みの回数が
増加して割込み処理時間が増大し、他の演算処理に影響
を生じる等の問題を回避することが出来る
As described above, in the present invention, in the storage device
Determines the control amount of the controlled device based on the contents of the first memory area
Each time an interrupt signal for activating a program to be set is given , it is sequentially stepped up and this memory area is used as a free running counter. Then, the value of the first memory area that is being continuously counted at a predetermined time point is stored in the second memory area, and the stored value and the value of the first memory area that is continuously changing are stored. By comparing, it is possible to measure the elapsed time from the time of storing in the second memory area. Further, by comparing the above measured value with a predetermined value, it is possible to detect whether or not the elapsed time has reached a predetermined set value. Also, the above interrupt
Is an interrupt signal generating means provided separately from the central processing unit.
By the interrupt signal from, and the interrupt signal
The program started by the control amount of the controlled device
The number of interrupts is
Interrupt processing time increases, affecting other arithmetic processing
It is possible to avoid problems such as occurrence of .

【0007】[0007]

【実施例】図1は本発明の一実施例のブロック図であ
る。図1において、5はメモリであり、M1〜Mnはそれ
ぞれタイマ動作に用いるメモリエリアである。また6は
クロックパルス発生器である。クロックパルス発生器6
は、所定時間毎(例えば10ms毎)にクロックパルスS
2を出力し、このクロックパルスS2によってCPU1へ
割込み要求を発生する。なお、この割込み要求は演算開
始用の割込みであって通常の演算過程で発生するもので
ある。CPU1は上記の割込み要求に応じて演算ルーチ
ンを実行するが、この演算ルーチンの内において計時動
作を行なわせる。まず、メモリ5内の所定のメモリエリ
ア(例えばM1)内容を、割込み要求があるごとに順次
歩進させ、このメモリエリアM1をフリーランニングカ
ウンタとして用いる。次に、継続的に計数しているメモ
リエリアM1の所定時点の値を他のメモリエリア(例え
ばM2)に記憶させ、その記憶させた値と継続して変化
しているメモリエリアM1の値とを比較することによ
り、メモリエリアM2に記憶させた時点からの経過時間
を計測することが出来る。また上記の計測値と所定の値
とを比較すれば、経過時間が所定の設定値に達したか否
かを検知することが出来る。上記の構成によれば、計時
動作が全てマイクロコンピュータ内部で行なわれるの
で、メモリエリア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 a predetermined memory area (for example, M 1 ) in the memory 5 are sequentially stepped up each time there is an interrupt request, and this memory area M 1 is used as a free running counter. Next, the value at a predetermined time point in the memory area M 1 that is continuously counted is stored in another memory area (for example, M 2 ), and the memory area M 1 that continuously changes from the stored value. By comparing with the value of, the elapsed time from the time of storing in the memory area M 2 can be measured. Further, by comparing the above measured value 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, all the clocking operation is performed inside the microcomputer, so that it is sufficient to prepare the number of memory areas M 1 to M n by the required number of timer functions, and the configuration is greatly simplified. You can do it.

【0008】次に実際の演算内容の一実施例を図2に示
す。図2は、内燃機関の燃料噴射量の演算において、機
関始動時に所定時間(例えば3秒間)のあいだ燃料増量
を行なう場合のフローチャートである。すなわちこの場
合には、始動開始時点から3秒間経過したか否かを計測
することが必要となる。この実施例の場合には、特定の
メモリエリア、例えばメモリエリアM1をフリーランニ
ングカウンタ(所定値までカウントすると0に復帰し、
自動的に再びカウントを開始するカウンタ)として用
い、割込み要求の回数を継続的に計数させておく。図2
において、まずP1において基本燃料噴射量PW1を演算
する。次にP2において、スタータモータを作動させる
スタータスイッチがONかOFFかを判定し、OFFの
場合すなわち始動中でない場合には、P3に行ってスタ
ートフラグ(始動開始時点を検出するためのフラグ)を
0にしたのち直ちにENDへ行く。一方、P2がONの
場合にはP4に行き、スタートフラグが1か0かを判定
する。P4においてスタートフラグが0の場合、すなわ
ち始動開始時点(スタータスイッチがONになった直
後)には、P5に行き、フリーランニングカウンタとし
て用いているメモリエリアM1の内容を他のメモリエリ
アM2に記憶させ、かつスタートフラグを1にしたのち
6に行く。したがってメモリエリアM2の内容は、始動
開始時点におけるM1の値になっている。一方、P4でス
タートフラグが1の場合、すなわち始動中の場合には直
ちにP6に行く。P6は経過時間の判定を行なうルーチン
であり、メモリエリアM1とM2との差、すなわち始動開
始時点からのフリーランニングカウンタのカウント値が
3秒以上か未満かを判定する。例えばクロックパルスS
2の周期が10msであれば、メモリエリアM1とM2との
差が300の場合に3秒に相当する。P6でYESの場
合、すなわち始動開始時点から3秒以上経過している場
合には、燃料増量を行なわずに直ちにENDへ行く。P
6がNOの場合、すなわち3秒未満の場合にはP7で所定
の燃料増量(PW2=PW1×K)を行なってからEND
へ行く。上記のように、或るメモリエリアM1をフリー
ランニングカウンタとしてその内容を一定時間毎に歩進
させ、継続的に計数しているメモリエリアM1の所定時
点の値を他のメモリエリアM2に記憶させ、その記憶さ
せた値と継続して変化しているメモリエリアM1の値と
を比較することにより、メモリエリアM2に記憶させた
時点からの経過時間を計測することが出来る。なお、カ
ウント中にフリーランニングカウンタが0に復帰した場
合は、キャリィ信号を出力させてそれまでのカウント値
を追加させる。
FIG. 2 shows an example of the actual contents of calculation. FIG. 2 is a flowchart in the case where the fuel injection amount of the internal combustion engine is calculated, the fuel amount is increased 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 the case of this embodiment, a specific memory area, for example, the memory area M 1 is free-running counter (when it reaches a predetermined value, it returns to 0,
It is used as a counter which automatically starts counting again, and continuously counts the number of interrupt requests. Figure 2
First, at P 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. When the start flag is 0 in P 4 , that is, at the start of starting (immediately after the starter switch is turned on), the program goes to P 5 and the content of the memory area M 1 used as the free running counter is changed to another memory area. After storing it in M 2 and setting the start flag to 1, go to P 6 . Therefore, the content of the memory area M 2 is the value of M 1 at the start of starting. 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 it is determined whether the difference between the memory areas M 1 and M 2 , that is, the count value of the free running counter from the start of starting is 3 seconds or more or less. For example, clock pulse S
If the period of 2 is 10 ms, it corresponds to 3 seconds when the difference between the memory areas M 1 and M 2 is 300. In the case of YES in P 6 , that is, in the case where 3 seconds or more has elapsed from the start of starting, immediately go to END without increasing the fuel amount. P
If 6 is NO, that is, if it is less than 3 seconds, a predetermined fuel amount increase (PW 2 = PW 1 × K) is performed at P 7 , and then END
Go to As described above, the content of a certain memory area M 1 is used as a free-running counter and the content is incremented at regular time intervals, and the value at a predetermined time point of the continuously counting memory area M 1 is changed to another memory area M 2. is stored in, by comparing the value of the memory area M 1 is changing continuously as the value obtained by the storage, it is possible to measure the elapsed time from the time when stored in the memory area M 2. When the free running counter returns to 0 during counting, a carry signal is output to add the count value up to that point.

【0009】[0009]

【発明の効果】以上説明したごとく本発明によれば、マ
イクロコンピュータ内の演算のみよって経過時間の計測
を行なうように構成したので、従来のように余分な割込
み要求が増加することがなく、演算処理時間を短縮する
ことが出来る。また、ラッチやカウンタ等の付加装置が
不要なので、構成が簡略で安価になる等の効果がある。
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のメモリエリアの内容を歩進させ、所定の時
点における第1のメモリエリアの内容を第2のメモリエ
リアに記憶させ、第1のメモリエリアの内容と第2のメ
モリエリアの内容との差により、上記第2のメモリエリ
アに記憶させた時点からの上記割込みによって起動され
るプログラムの実行回数を計測することを特徴とするデ
ィジタル制御装置。
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, by stepping the first contents of the memory area of the storage device each time the interrupt to activate the flop <br/> program to determine the control amount of the control target equipment occurs, first at a given time The contents of the first memory area are stored in the second memory area, and the difference from the contents of the first memory area and the contents of the second memory area causes the contents to be stored in the second memory area. A digital control device characterized by measuring the number of executions of a program activated by an interrupt.
JP4073643A 1992-03-30 1992-03-30 Digital controller Expired - Lifetime JPH0731254B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP4073643A JPH0731254B2 (en) 1992-03-30 1992-03-30 Digital controller

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP4073643A JPH0731254B2 (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
JPH0627261A JPH0627261A (en) 1994-02-04
JPH0731254B2 true JPH0731254B2 (en) 1995-04-10

Family

ID=13524181

Family Applications (1)

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

Country Status (1)

Country Link
JP (1) JPH0731254B2 (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
JPH0627261A (en) 1994-02-04

Similar Documents

Publication Publication Date Title
US4350950A (en) Frequency measuring method and apparatus
JPH0238791B2 (en)
KR950000220B1 (en) Engine control system
JPS6158841B2 (en)
JPH0589261A (en) Microcomputer
JPH0797321B2 (en) Interrupt signal processing method
JPS6060022B2 (en) Internal combustion engine control device
JPH0731254B2 (en) Digital controller
JPH0844594A (en) Data processor
JPH0731253B2 (en) Digital controller
JPH0534474A (en) Measurement timer device
JP2773546B2 (en) Pulse generation circuit
JPH0337153B2 (en)
JP2737645B2 (en) Program debug device
CN115166284B (en) Frequency signal acquisition system and frequency signal acquisition method
JPS6025166Y2 (en) counting device
JP4345200B2 (en) Programmable controller I/O unit
JP2604562B2 (en) Pulse interval measuring device
JPH0464099B2 (en)
JP2686282B2 (en) Centralized control equipment for pachinko halls
JP3224554B2 (en) Schedule control device
JP2001281370A (en) Electronic apparatus having power source-off function
KR950013602B1 (en) Frequency measuring device
JP2831031B2 (en) Period generator
JPS6241276Y2 (en)