JPH09244713A - Programmable controller - Google Patents

Programmable controller

Info

Publication number
JPH09244713A
JPH09244713A JP4923496A JP4923496A JPH09244713A JP H09244713 A JPH09244713 A JP H09244713A JP 4923496 A JP4923496 A JP 4923496A JP 4923496 A JP4923496 A JP 4923496A JP H09244713 A JPH09244713 A JP H09244713A
Authority
JP
Japan
Prior art keywords
main cpu
cpu
clock signal
arithmetic processing
data
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.)
Granted
Application number
JP4923496A
Other languages
Japanese (ja)
Other versions
JP3627352B2 (en
Inventor
Masaru Nakai
大 中井
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.)
Panasonic Electric Works Co Ltd
Original Assignee
Matsushita Electric Works 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 Matsushita Electric Works Ltd filed Critical Matsushita Electric Works Ltd
Priority to JP04923496A priority Critical patent/JP3627352B2/en
Publication of JPH09244713A publication Critical patent/JPH09244713A/en
Application granted granted Critical
Publication of JP3627352B2 publication Critical patent/JP3627352B2/en
Anticipated expiration legal-status Critical
Expired - Fee Related legal-status Critical Current

Links

Abstract

PROBLEM TO BE SOLVED: To reduce the cost without lowering the throughput of data transfer. SOLUTION: The clock signal generated by a timer part 4 is outputted to an interruption control part 7 and a dedicated CPU 2. If the clock signal is inputted while the dedicated CPU 2 is performing a specific arithmetic process, the dedicated CPU 2 interrupts the process and puts a main CPU 1 in a hold state back to an operation state. Namely, the control is returned to the main CPU 1 in every cycle (500μs) of the clock signal even while the dedicated CPU 2 is performing the arithmetic process. Further, the cycle of the clock signal is set shorter than time intervals of a data transfer request from a serial control part 3, so data can be transferred to a memory part without using a DMA controller like before, thereby lowering the cost.

Description

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

【0001】[0001]

【発明の属する技術分野】本発明は、プログラムを実行
し演算処理を行う主CPUと、前記主CPUにて行う演
算処理のうちで特定の演算処理を前記主CPUからの指
令により代行する専用CPUとを備えたプログラマブル
コントローラに関するものである。
BACKGROUND OF THE INVENTION 1. Field of the Invention The present invention relates to a main CPU that executes programs and performs arithmetic processing, and a dedicated CPU that substitutes specific arithmetic processing among the arithmetic processing performed by the main CPU by a command from the main CPU. And a programmable controller having and.

【0002】[0002]

【従来の技術】従来より、主CPUの負担軽減や処理時
間短縮のため、主CPUにて行う演算処理のうちで特定
の演算処理を代行する専用CPUを備えたプログラマブ
ルコントローラが提供されており、図6はこのような従
来例の構成を示すブロック図である。専用CPU11は
高速演算用のCPUであって、特定の演算処理について
主CPU10の代わりにその演算処理を実行するもので
ある。ここで、主CPU10が特定の演算処理に必要な
各種パタメータを専用CPU11の有するレジスタ(図
示せず)に設定することによって専用CPU11が起動
し、専用CPU11から主CPU10に対してホールド
(HOLD)信号が出力される。主CPU10ではこの
ホールド信号の入力があると応答信号(ACK)を専用
CPU11に出力し、その動作を停止状態(ホールド状
態)とする。そして、この間に専用CPU11が演算処
理を実行し、その処理が終了すれば専用CPU11は主
CPU10のホールド状態を解除する信号を出力する。
これにより、主CPU10のホールド状態が解除され、
主CPU10が他の演算処理を実行する。また、演算処
理を実行中に、専用CPU11が自ら実行不可能な命令
(主CPU10でのみ実行可能な命令)を読み出した場
合や、外部から専用CPU11に対して停止要求信号が
入力された場合にも、専用CPU11は処理を中断して
主CPU10のホールド状態を解除する。
2. Description of the Related Art Conventionally, in order to reduce the load on the main CPU and reduce the processing time, there has been provided a programmable controller having a dedicated CPU that substitutes a specific arithmetic process among the arithmetic processes performed by the main CPU. FIG. 6 is a block diagram showing the configuration of such a conventional example. The dedicated CPU 11 is a high-speed arithmetic CPU, and executes specific arithmetic processing instead of the main CPU 10. Here, the main CPU 10 activates the special CPU 11 by setting various parameters required for specific arithmetic processing in a register (not shown) of the special CPU 11, and the special CPU 11 sends a hold (HOLD) signal to the main CPU 10. Is output. When the main CPU 10 receives the hold signal, the main CPU 10 outputs a response signal (ACK) to the dedicated CPU 11 to bring the operation into a stopped state (hold state). Then, during this period, the dedicated CPU 11 executes arithmetic processing, and when the processing is completed, the dedicated CPU 11 outputs a signal for releasing the hold state of the main CPU 10.
This releases the hold state of the main CPU 10,
The main CPU 10 executes other arithmetic processing. Further, when the dedicated CPU 11 reads out an instruction that cannot be executed by itself (instruction that can be executed only by the main CPU 10) during execution of the arithmetic processing, or when a stop request signal is input to the dedicated CPU 11 from the outside. Also, the dedicated CPU 11 suspends the processing and releases the hold state of the main CPU 10.

【0003】また、上記従来例では、タイマ部12から
の内部タイミングクロック信号(以下、「クロック信
号」と略す)が主CPU10の割込ポートintと専用
CPU11とに入力されている。すなわち、主CPU1
0がホールド状態の場合には割込要求が受け付けられな
いので、主CPU10で実行するタイマ命令の経過時間
を測定するためには、クロック信号を停止要求信号とし
て専用CPU11に入力し、一旦主CPU10のホール
ド状態を解除した上で主CPU10にクロック信号によ
る割込要求を行ない、カウンタ(図示せず)のカウント
値をインクリメントする処理(タイマ割込処理)を行わ
なければならない。例えば、上記従来例では10msの
タイマ命令の経過時間を精度4分の1で測定するため
に、クロック信号の周期を2.5msに設定している
(図7参照)。
Further, in the above-mentioned conventional example, an internal timing clock signal (hereinafter abbreviated as "clock signal") from the timer section 12 is inputted to the interrupt port int of the main CPU 10 and the dedicated CPU 11. That is, the main CPU 1
When 0 is in the hold state, the interrupt request cannot be accepted. Therefore, in order to measure the elapsed time of the timer instruction executed by the main CPU 10, the clock signal is input to the dedicated CPU 11 as the stop request signal and the main CPU 10 once After the hold state is released, an interrupt request is issued to the main CPU 10 by a clock signal, and a process (timer interrupt process) for incrementing the count value of a counter (not shown) must be performed. For example, in the above-mentioned conventional example, the period of the clock signal is set to 2.5 ms in order to measure the elapsed time of the timer command of 10 ms with a precision of 1/4 (see FIG. 7).

【0004】ところで、上記従来例においては、プログ
ラミング装置等の周辺機器(外部機器)とのデータ通信
を行うために、通信用のシリアルコントロール部13が
アドレスデータバス14によって主CPU10や専用C
PU11等と接続されている。また、上記アドレスデー
タバス14にはRAM(書込/消去可能なメモリ)から
成るメモリ部15と、主CPU10に代わってメモリ部
15とシリアルコントロール部13との間のデータ転送
を制御するDMA(ダイレクト・メモリ・アクセス)コ
ントローラ部(以下、「DMA部16」と略す)が接続
されており、外部へ送信するデータのメモリ部15から
の読み出し及び外部から受信したデータのメモリ部15
への書込みは、全てDMA部16によって制御されてい
る。このように、シリアルコントロール部13とメモリ
部15との間のデータ転送をDMA部16によって制御
することにより、シリアルコントロール部13から主C
PU10への割込処理用のプログラム等が必要でないた
め、ソフトウェアの負担と全体の処理時間や処理効率が
向上することになる。
By the way, in the above-mentioned conventional example, in order to perform data communication with a peripheral device (external device) such as a programming device, the serial controller 13 for communication uses the address data bus 14 for the main CPU 10 and the dedicated C.
It is connected to the PU 11 and the like. Further, the address data bus 14 has a memory unit 15 including a RAM (writable / erasable memory), and a DMA (which controls data transfer between the memory unit 15 and the serial control unit 13 in place of the main CPU 10). A direct memory access) controller unit (hereinafter abbreviated as “DMA unit 16”) is connected to the memory unit 15 for reading data to be transmitted to the outside from the memory unit 15 and for receiving data from the outside.
All writing to is controlled by the DMA unit 16. In this way, by controlling the data transfer between the serial control unit 13 and the memory unit 15 by the DMA unit 16, the serial control unit 13 causes the main C
Since a program or the like for interrupt processing to the PU 10 is not required, the load of software and the overall processing time and processing efficiency are improved.

【0005】[0005]

【発明が解決しようとする課題】ところが、上記従来例
のようにDMA部16を用いた場合には、種々の利点は
あるもののDMA部16が比較的に高価であるため、コ
ストダウンが困難であって割高になるという問題があっ
た。本発明は上記問題点の解決を目的とするものであ
り、データ転送の処理効率を低下させることなくコスト
ダウンが可能なプログラマブルコントローラを提供しよ
うとするものである。
However, when the DMA unit 16 is used as in the above-mentioned conventional example, the DMA unit 16 is relatively expensive although there are various advantages, so that it is difficult to reduce the cost. There was a problem that it was expensive. The present invention is intended to solve the above problems, and an object of the present invention is to provide a programmable controller capable of cost reduction without lowering the processing efficiency of data transfer.

【0006】[0006]

【課題を解決するための手段】請求項1の発明は、上記
目的を達成するために、プログラムを実行し演算処理を
行う主CPUと、前記主CPUにて行う演算処理のうち
で特定の演算処理を前記主CPUからの指令により代行
する専用CPUとを備え、前記専用CPUは、前記特定
の演算処理を行っている間は前記主CPUを動作停止状
態とし、前記特定の演算処理が終了したときあるいは前
記特定の演算処理以外の演算処理を行う必要が生じたと
き若しくは外部からの停止要求信号入力があったときに
前記主CPUの動作停止状態を解除するようにして成る
プログラマブルコントローラにおいて、外部機器とのデ
ータ通信を行うとともに所定の一区切りのデータを受信
する毎に前記主CPUに割り込み要求を行うシリアルコ
ントロール部と、前記主CPUの動作用のクロック信号
を発生するとともに該クロック信号を前記停止要求信号
として前記専用CPUに出力するタイマ部と、前記シリ
アルコントロール部からの割り込み要求を受けた前記主
CPUによって転送制御が行われて外部機器から受信し
たデータが格納されるメモリ部とを備え、前記シリアル
コントロール部にて前記一区切りのデータを受信するの
に要する受信時間以下の値に前記クロック信号の周期を
設定したものであり、専用CPUにおける特定の演算処
理の実行中にも前記クロック信号に同期して主CPUの
動作停止状態が解除され、しかも、シリアルコントロー
ル部からの割込要求が発生する時間間隔すなわちシリア
ルコントロール部にて前記一区切りのデータを受信する
のに要する受信時間よりも短い時間間隔で主CPUが動
作可能状態となり、主CPUによってシリアルコントロ
ール部とメモリ部との間のデータ転送を制御することが
できる。つまり、従来例のように高価なDMAコントロ
ーラを用いることなく、専用CPUの演算処理実行中に
もシリアルコントロール部とメモリ部との間でデータ転
送が行え、データ転送の処理効率を低下させることなく
コストダウンが可能となる。
In order to achieve the above-mentioned object, a main CPU for executing a program and performing arithmetic processing, and a specific arithmetic operation in the arithmetic processing performed by the main CPU are provided. A dedicated CPU that substitutes the processing in response to a command from the main CPU is provided, and the dedicated CPU suspends the operation of the main CPU while performing the specific arithmetic processing, and the specific arithmetic processing ends. In the programmable controller configured to release the operation stop state of the main CPU when or when it becomes necessary to perform an arithmetic process other than the specific arithmetic process or when a stop request signal is input from the outside, A serial control unit that performs data communication with the device and issues an interrupt request to the main CPU each time a predetermined segment of data is received; The transfer control is performed by a timer unit that generates a clock signal for operating the main CPU and outputs the clock signal to the dedicated CPU as the stop request signal, and the main CPU that receives an interrupt request from the serial control unit. And a memory unit for storing data received from an external device, wherein the serial control unit sets the cycle of the clock signal to a value equal to or less than a reception time required to receive the delimited data. In addition, the operation stop state of the main CPU is released in synchronization with the clock signal even during the execution of the specific arithmetic processing in the dedicated CPU, and the time interval at which the interrupt request from the serial control unit is generated, that is, the serial control is performed. Time shorter than the reception time required to receive the data in one section The main CPU is ready for operation at intervals, it is possible to control the data transfer between the serial controller and the memory unit by the main CPU. That is, data transfer can be performed between the serial control unit and the memory unit even during execution of arithmetic processing of the dedicated CPU without using an expensive DMA controller as in the conventional example, and the processing efficiency of data transfer is not deteriorated. Cost reduction is possible.

【0007】請求項2の発明は、請求項1の発明におい
て、前記主CPUが実行するタイマ命令におけるタイマ
時間の約数に前記クロック信号の周期を設定したもので
あり、主CPUが動作可能状態となる周期がタイマ命令
のための時間測定の周期と一致することになり、係る時
間測定が所定の精度で容易に行うことができる。請求項
3の発明は、請求項2の発明において、前記シリアルコ
ントロール部におけるデータ通信の通信速度を1920
0ビット毎秒とするとともに前記一区切りのデータのデ
ータ長を10ビット以上とし併せて前記クロック信号の
周期を約500μ秒として成るものであり、主CPUは
約500μ秒毎に動作可能状態に戻ることから、シリア
ルコントロール部が最短で約520.8μ秒毎に割込要
求を行うような上記通信フォーマットにおいても、DM
Aコントローラを用いずにデータ転送処理を効率良く行
うことができる。
According to a second aspect of the present invention, in the first aspect of the present invention, the cycle of the clock signal is set to a divisor of the timer time in the timer instruction executed by the main CPU, and the main CPU is in an operable state. Therefore, the period of time becomes equal to the period of time measurement for the timer command, and the time measurement can be easily performed with a predetermined accuracy. According to a third aspect of the present invention, in the second aspect, the communication speed of data communication in the serial control unit is 1920.
The bit length is 0 bit per second, and the data length of the delimited data is 10 bits or more, and the cycle of the clock signal is about 500 μsec. Since the main CPU returns to the operable state about every 500 μsec. Even in the above communication format in which the serial control unit issues an interrupt request every approximately 520.8 μsec at the shortest, DM
The data transfer process can be efficiently performed without using the A controller.

【0008】[0008]

【発明の実施の形態】以下、本発明の実施形態を図面を
参照して詳細に説明する。図1は本実施形態のプログラ
マブルコントローラの基本構成を示すブロック図であ
り、プログラムを実行し演算処理を行う主CPU1と、
主CPU1にて行う演算処理のうちで特定の演算処理を
主CPU1からの指令により代行する専用CPU2と、
外部機器とのデータ通信を行うとともに所定の一区切り
のデータを受信する毎に主CPU1に割り込み要求を行
うシリアルコントロール部3と、主CPU1の動作用の
クロック信号を発生するタイマ部4と、シリアルコント
ロール部3からの割り込み要求を受けた主CPUによっ
て転送制御が行われて外部機器から受信したデータが格
納されるメモリ部5とを備えている。なお、これら各部
はアドレスデータバス6によって主CPU1及び専用C
PU2に各々接続されている。また、タイマ部4のクロ
ック信号及びシリアルコントロール部3の割込要求信号
が割込コントロール部7に入力されており、割込コント
ロール部7が有するレジスタの所定のビットがクロック
信号並びに割込要求信号によって変化することにより、
主CPU1がタイマ部4とシリアルコントロール部3の
割込要求を個別に認識することができる。
BEST MODE FOR CARRYING OUT THE INVENTION Embodiments of the present invention will be described in detail below with reference to the drawings. FIG. 1 is a block diagram showing the basic configuration of the programmable controller of the present embodiment, which includes a main CPU 1 that executes a program and performs arithmetic processing,
A dedicated CPU 2 which substitutes a specific arithmetic processing among the arithmetic processing performed by the main CPU 1 by a command from the main CPU 1;
A serial control unit 3 that performs data communication with an external device and issues an interrupt request to the main CPU 1 each time a predetermined segment of data is received, a timer unit 4 that generates a clock signal for the operation of the main CPU 1, and a serial control The memory unit 5 stores the data received from the external device under the transfer control by the main CPU that receives the interrupt request from the unit 3. It should be noted that these units are connected to the main CPU 1 and the dedicated C by the address data bus 6.
Each is connected to PU2. Further, the clock signal of the timer unit 4 and the interrupt request signal of the serial control unit 3 are input to the interrupt control unit 7, and the predetermined bits of the register included in the interrupt control unit 7 are the clock signal and the interrupt request signal. By changing
The main CPU 1 can individually recognize the interrupt requests of the timer unit 4 and the serial control unit 3.

【0009】専用CPU2は、従来例で説明したよう
に、特定の演算処理を主CPU1に代わって実行するの
であって、専用CPU2が演算処理を行っている間は主
CPU1がホールド状態(動作停止状態)となり、専用
CPU2の演算処理が終了したとき、あるいは専用CP
U2が主CPU1にて実行すべき命令を読み出した場合
のように特定の演算処理以外の演算処理を行う必要が生
じたとき、若しくは外部からの停止要求信号入力があっ
たときに主CPU1のホールド状態を解除するようにし
てある。なお、主CPU1がホールド状態にあるときに
は、割込コントロール部7からの割込要求は受け付けら
れない。
As described in the conventional example, the dedicated CPU 2 executes a specific arithmetic processing in place of the main CPU 1. Therefore, while the dedicated CPU 2 is performing the arithmetic processing, the main CPU 1 is in a hold state (stops operation). State) and the arithmetic processing of the dedicated CPU 2 is completed, or the dedicated CP
Hold of the main CPU 1 when it becomes necessary to perform arithmetic processing other than specific arithmetic processing, such as when U2 reads an instruction to be executed by the main CPU 1, or when a stop request signal is input from the outside. The condition is canceled. When the main CPU 1 is in the hold state, the interrupt request from the interrupt control unit 7 cannot be accepted.

【0010】アドレスデータバス6に接続されたメモリ
部5は、例えばRAMのような書込/消去可能な半導体
メモリで構成されている。また、後述するように、本実
施形態の場合にはDMAコントローラを具備しておら
ず、シリアルコントロール部3とメモリ部5との間のデ
ータ転送は主CPU1によって制御される。シリアルコ
ントロール部3はプログラミング装置等の外部機器との
間でデータ通信を行うものであって、例えば1バイトの
バッファを有しており、バッファに1バイトのデータを
受信する毎に割込要求を行い、アドレスデータバス6へ
1ビットずつデータを送出したり、あるいは1ビットず
つデータを取込む。
The memory section 5 connected to the address data bus 6 is composed of a writable / erasable semiconductor memory such as a RAM. Further, as will be described later, the present embodiment does not include a DMA controller, and data transfer between the serial control unit 3 and the memory unit 5 is controlled by the main CPU 1. The serial control unit 3 performs data communication with an external device such as a programming device and has, for example, a 1-byte buffer, and issues an interrupt request each time 1-byte data is received in the buffer. Then, the data is sent to the address data bus 6 bit by bit, or the data is fetched bit by bit.

【0011】タイマ部4は、一定周期のパルス信号から
成るクロック信号を発生し、割込コントロール部7と専
用CPU2とに出力している。ここで、専用CPU2に
入力されるクロック信号は停止要求信号となり、例え
ば、クロック信号がHレベルに立ち上がる毎に専用CP
U2が実行中の演算処理を中断するとともに主CPU1
のホールド状態を解除するのである。一方、割込コント
ロール部7にクロック信号が入力されることにより、ホ
ールド状態が解除された主CPU1にタイマ部4からの
割込要求(以下、「タイマ割込要求」と呼ぶ)が行われ
る。但し、上記動作は専用CPU2にて特定の演算処理
が実行されている場合であって、専用CPU2が動作せ
ずに主CPU1が演算処理を実行している場合には、タ
イマ割込要求のみが行われる。
The timer section 4 generates a clock signal composed of a pulse signal of a constant cycle and outputs it to the interrupt control section 7 and the dedicated CPU 2. Here, the clock signal input to the dedicated CPU 2 becomes a stop request signal, and for example, every time the clock signal rises to the H level, the dedicated CP
U2 interrupts the arithmetic processing being executed and the main CPU1
The hold state of is released. On the other hand, when the clock signal is input to the interrupt control unit 7, an interrupt request (hereinafter, referred to as “timer interrupt request”) from the timer unit 4 is issued to the main CPU 1 whose hold state has been released. However, the above operation is performed when the specific arithmetic processing is executed by the dedicated CPU 2, and when the main CPU 1 is executing the arithmetic processing without the dedicated CPU 2 operating, only the timer interrupt request is issued. Done.

【0012】次に、本実施形態の動作について図2〜図
5のフローチャートを参照して説明する。まず、図2は
全体動作を示すフローチャートであり、プログラマブル
コントローラの一般的な動作と同様に、電源投入により
各種のハードウェアやパラメータ等の初期化を行なった
後、ユーザプログラムを実行してI/Oリフレッシュ、
演算処理、通信コマンドの実行処理を繰り返すものであ
る。
Next, the operation of this embodiment will be described with reference to the flow charts of FIGS. First, FIG. 2 is a flow chart showing the entire operation. As with the general operation of a programmable controller, various hardware and parameters are initialized by turning on the power, and then a user program is executed to execute I / O. O refresh,
The calculation process and the communication command execution process are repeated.

【0013】図3は主CPU1の演算処理のうちで、特
に高速な処理が必要となるような特定の演算処理を専用
CPU2にて実行する場合の主CPU1と専用CPU2
のそれぞれの動作を示すフローチャートである。まず、
主CPU1は、専用CPU2で処理させる命令(コマン
ド)を読み出すと、専用CPU2のレジスタに各種パラ
メータを設定し、専用CPU2に起動をかける。
FIG. 3 shows the main CPU 1 and the special CPU 2 when the special CPU 2 executes a particular calculation process that requires particularly high speed processing among the main CPU 1.
3 is a flowchart showing each operation of First,
When the main CPU 1 reads an instruction (command) to be processed by the dedicated CPU 2, it sets various parameters in the register of the dedicated CPU 2 and activates the dedicated CPU 2.

【0014】一方、起動した専用CPU2から主CPU
1へHOLD信号が出力され、主CPU1がホールド状
態となる。なお、HOLD信号を受け取った応答とし
て、主CPU1から専用CPU2へはACK信号(アク
ノリッジ信号)が出力される。そして、専用CPU2は
読み出した命令が実行可能な命令であれば演算処理を行
ない、実行不可能な命令(例えば、主CPU1で実行す
べき命令)を読み出した場合には演算処理を中断し、主
CPU1のホールド状態を解除して制御を主CPU1に
戻す。また、専用CPU2が演算処理を実行中に外部か
らの停止要求信号あるいはタイマ部4からのクロック信
号が入力されれば、同様に主CPU1のホールド状態を
解除する。反対に、停止要求信号やクロック信号が入力
されなければ、その間は特定の演算処理を終了まで続行
し、終了すれば主CPU1のホールド状態を解除して制
御を主CPU1に戻す。
On the other hand, from the activated dedicated CPU 2 to the main CPU
The HOLD signal is output to 1 and the main CPU 1 enters the hold state. As a response to receiving the HOLD signal, an ACK signal (acknowledge signal) is output from the main CPU 1 to the dedicated CPU 2. Then, the dedicated CPU 2 performs arithmetic processing if the read instruction is an executable instruction, and interrupts the arithmetic processing when an unexecutable instruction (for example, an instruction to be executed by the main CPU 1) is read. The hold state of the CPU 1 is released and the control is returned to the main CPU 1. If a stop request signal or a clock signal from the timer unit 4 is input from the outside while the dedicated CPU 2 is executing the arithmetic processing, the hold state of the main CPU 1 is similarly released. On the other hand, if the stop request signal or the clock signal is not input, the specific arithmetic processing is continued until the end, and when it is ended, the hold state of the main CPU 1 is released and the control is returned to the main CPU 1.

【0015】それに対して、主CPU1はホールド状態
が解除されるとその解除の要因を調べ、主CPU1の実
行命令であればその演算処理を行う。このとき、主CP
U1は、割込コントロール部7からのタイマ割込要求若
しくはシリアルコントロール部3からの割込要求(以
下、これを「データ転送割込要求」という)の有無を調
べ、割込要求に応じて各々のルーチン、すなわちタイマ
割込処理ルーチン若しくはデータ転送処理ルーチンを実
行する。そして、各ルーチンの処理終了後は再び専用C
PU2を起動することにより、専用CPU2が中断した
演算処理を続行する。
On the other hand, when the hold state is released, the main CPU 1 investigates the cause of the release, and if it is an execution instruction of the main CPU 1, executes its arithmetic processing. At this time, the main CP
U1 checks whether there is a timer interrupt request from the interrupt control unit 7 or an interrupt request from the serial control unit 3 (hereinafter referred to as "data transfer interrupt request"), and responds to each interrupt request. 2), that is, the timer interrupt processing routine or the data transfer processing routine is executed. After the processing of each routine is completed, the dedicated C is again used.
By starting the PU2, the arithmetic processing interrupted by the dedicated CPU2 is continued.

【0016】図4はタイマ割込処理ルーチンのフローチ
ャートである。主CPU1は補助カウンタ(図示せず)
をデクリメントし、そのカウント値がゼロでなければタ
イマ割込処理ルーチンを終了して元の処理に戻る。一
方、補助カウンタのカウント値がゼロであれば、補助カ
ウンタに初期値(=5)を設定するとともに2.5ms
カウンタ(図示せず)をインクリメントした後、タイマ
割込処理ルーチンを終了して元の処理に戻る。つまり、
本実施形態ではタイマ部5のクロック信号の周期を50
0μsに設定しているため、主CPU1はクロック信号
の周期(500μs)に同期してタイマ割込処理ルーチ
ンを実行することになり、タイマ割込処理ルーチンを1
回実行する毎に補助カウンタのカウント値を初期値(=
5)から0までデクリメントすることになる。その結
果、主CPU1は500μs×5=2.5msの時間測
定を行っており、従来例と同様に10msタイマ命令の
ための経過時間測定を4分の1の精度で実行可能として
いる。
FIG. 4 is a flow chart of the timer interrupt processing routine. Main CPU 1 is an auxiliary counter (not shown)
Is decremented, and if the count value is not zero, the timer interrupt processing routine is terminated and the original processing is returned to. On the other hand, if the count value of the auxiliary counter is zero, set the initial value (= 5) to the auxiliary counter and
After incrementing the counter (not shown), the timer interrupt processing routine is terminated and the original processing is returned to. That is,
In this embodiment, the cycle of the clock signal of the timer unit 5 is set to 50.
Since it is set to 0 μs, the main CPU 1 executes the timer interrupt processing routine in synchronization with the cycle of the clock signal (500 μs).
The count value of the auxiliary counter is reset to the initial value (=
Decrement from 5) to 0. As a result, the main CPU 1 measures the time of 500 μs × 5 = 2.5 ms, and it is possible to measure the elapsed time for the 10 ms timer command with a precision of 1/4 as in the conventional example.

【0017】図5はデータ転送処理ルーチンのフローチ
ャートである。主CPU1は、データ転送割込要求があ
ればデータ転送処理ルーチンに分岐し、シリアルコント
ロール部3より受信データを1バイト読み出すととも
に、受信バッファ(図示せず)のポインタを読み出す。
このポインタはメモリ部5のアドレスを示しており、主
CPU1は、読み出したポインタのアドレスに受信デー
タをセットすることにより、受信データをメモリ部5に
記憶する。その後、次の受信データのセットに備えて、
主CPU1は受信ポインタをインクリメントしてデータ
転送処理ルーチンを終了し、元の処理に戻る。
FIG. 5 is a flowchart of the data transfer processing routine. If there is a data transfer interrupt request, the main CPU 1 branches to a data transfer processing routine, reads 1 byte of received data from the serial control unit 3, and reads a pointer of a reception buffer (not shown).
This pointer indicates the address of the memory unit 5, and the main CPU 1 stores the received data in the memory unit 5 by setting the received data at the read address of the pointer. Then, in preparation for the next set of received data,
The main CPU 1 increments the reception pointer, ends the data transfer processing routine, and returns to the original processing.

【0018】ここで、外部機器とシリアルコントロール
部3との間で行うデータ通信のフォーマットは、例え
ば、調歩同期通信であって、スタートビットが1ビッ
ト、データ長が8ビット、パリティ奇数、ストップビッ
トが1ビットで通信速度が19200bpsである。こ
の場合、シリアルコントロール部3で一区切りのデータ
を受信してから次の一区切りのデータを受信完了するま
での時間間隔、すなわち、シリアルコントロール部3か
らのデータ転送割込要求の発生時間間隔は、1÷192
00×(1+8+1+1)=572.9μsとなる。ま
た、別のフォーマット(ストップビットが1ビット、デ
ータ長が7ビット、パリティ寄数、ストップビットが1
ビット)の場合には、その時間間隔は1÷19200×
(1+7+1+1)=520.8μsとなる。
Here, the format of the data communication performed between the external device and the serial control unit 3 is, for example, asynchronous communication, with a start bit of 1 bit, a data length of 8 bits, a parity odd number, and a stop bit. Is 1 bit and the communication speed is 19200 bps. In this case, the time interval from the reception of one segment of data by the serial control unit 3 until the reception of the next segment of data is completed, that is, the time interval of the data transfer interrupt request from the serial control unit 3 is 1 ÷ 192
00 × (1 + 8 + 1 + 1) = 572.9 μs. Also, another format (1 stop bit, 7 data length, parity parameter, 1 stop bit)
Bit), the time interval is 1 ÷ 19200 ×
(1 + 7 + 1 + 1) = 520.8 μs.

【0019】そこで、通信速度が19200bpsであ
って、一区切りのデータが10ビット以上である通信フ
ォーマットの場合には、シリアルコントロール部3から
のデータ転送割込要求が520.8μsよりも短い時間
間隔で行われることはないから、これよりも短い時間間
隔で主CPU1を動作可能な状態に戻すようにすれば、
従来例のようにDMAコントローラを用いなくても、主
CPU1がシリアルコントロール部3とメモリ部5との
間のデータ転送を制御することができ、高価なDMAコ
ントローラを使用しないことでコストダウンが図れる。
そのために、本実施形態ではタイマ部4のクロック信号
の周期を500μsに設定し、クロック信号を専用CP
U2の停止要求信号としている。さらに、クロック信号
の周期を500μsとしたことにより、クロック信号の
周期が10msタイマ命令の経過時間を測定するための
2.5msカウンタのカウント時間(2.5ms)の約
数となり、従来例と同様にタイマ命令の経過時間測定が
行えるのである。
Therefore, in the case of a communication format in which the communication speed is 19200 bps and the data of one segment is 10 bits or more, the data transfer interrupt request from the serial control unit 3 is made at a time interval shorter than 520.8 μs. Since it is not performed, if the main CPU 1 is returned to the operable state at a time interval shorter than this,
The main CPU 1 can control the data transfer between the serial control unit 3 and the memory unit 5 without using a DMA controller as in the conventional example, and the cost can be reduced by not using an expensive DMA controller. .
Therefore, in this embodiment, the cycle of the clock signal of the timer unit 4 is set to 500 μs and the clock signal is set to the dedicated CP.
It is used as a stop request signal for U2. Further, by setting the cycle of the clock signal to 500 μs, the cycle of the clock signal becomes a divisor of the count time (2.5 ms) of the 2.5 ms counter for measuring the elapsed time of the 10 ms timer command, which is the same as the conventional example. Moreover, the elapsed time of the timer command can be measured.

【0020】上述のように、本実施形態では、シリアル
コントロール部3にて一区切りのデータを受信するのに
要する受信時間(520.8μs)以下であって、且つ
主CPU1が実行するタイマ命令におけるタイマ時間
(2.5ms)の約数(最大公約数)である500μs
にタイマ部4のクロック信号の周期を設定したため、専
用CPU2による演算処理実行中であっても、クロック
信号の周期に同期して主CPU1がホールド状態から動
作可能な状態へ復帰して、この間にシリアルコントロー
ル部3からのデータ転送割込要求があればデータ転送処
理ルーチンを実行して受信データをシリアルコントロー
ル部3からメモリ部5へ転送することができる。すなわ
ち、DMAコントローラを使わずにコストダウンを図る
とともに、ソフトウェアの割込回数を最小とすることで
主CPU1への負荷も減少させることができるのであ
る。
As described above, in the present embodiment, the timer in the timer command executed by the main CPU 1 is less than or equal to the reception time (520.8 μs) required for the serial control unit 3 to receive one segment of data. 500 μs, which is a divisor (maximum common divisor) of time (2.5 ms)
Since the period of the clock signal of the timer unit 4 is set to, the main CPU 1 returns from the hold state to the operable state in synchronization with the period of the clock signal even during execution of the arithmetic processing by the dedicated CPU 2, and during this period. If there is a data transfer interrupt request from the serial control unit 3, the data transfer processing routine can be executed to transfer the received data from the serial control unit 3 to the memory unit 5. That is, the cost can be reduced without using the DMA controller, and the load on the main CPU 1 can be reduced by minimizing the number of software interrupts.

【0021】[0021]

【発明の効果】請求項1の発明は、プログラムを実行し
演算処理を行う主CPUと、前記主CPUにて行う演算
処理のうちで特定の演算処理を前記主CPUからの指令
により代行する専用CPUとを備え、前記専用CPU
は、前記特定の演算処理を行っている間は前記主CPU
を動作停止状態とし、前記特定の演算処理が終了したと
きあるいは前記特定の演算処理以外の演算処理を行う必
要が生じたとき若しくは外部からの停止要求信号入力が
あったときに前記主CPUの動作停止状態を解除するよ
うにして成るプログラマブルコントローラにおいて、外
部機器とのデータ通信を行うとともに所定の一区切りの
データを受信する毎に前記主CPUに割り込み要求を行
うシリアルコントロール部と、前記主CPUの動作用の
クロック信号を発生するとともに該クロック信号を前記
停止要求信号として前記専用CPUに出力するタイマ部
と、前記シリアルコントロール部からの割り込み要求を
受けた前記主CPUによって転送制御が行われて外部機
器から受信したデータが格納されるメモリ部とを備え、
前記シリアルコントロール部にて前記一区切りのデータ
を受信するのに要する受信時間以下の値に前記クロック
信号の周期を設定したので、専用CPUにおける特定の
演算処理の実行中にも前記クロック信号に同期して主C
PUの動作停止状態が解除され、しかも、シリアルコン
トロール部からの割込要求が発生する時間間隔すなわち
シリアルコントロール部にて前記一区切りのデータを受
信するのに要する受信時間よりも短い時間間隔で主CP
Uが動作可能状態となり、主CPUによってシリアルコ
ントロール部とメモリ部との間のデータ転送を制御する
ことができ、従来例のように高価なDMAコントローラ
を用いることなく、専用CPUの演算処理実行中にもシ
リアルコントロール部とメモリ部との間でデータ転送が
行え、データ転送の処理効率を低下させることなくコス
トダウンが可能となるという効果がある。
According to the first aspect of the present invention, a main CPU that executes a program and performs arithmetic processing, and a dedicated arithmetic processing among the arithmetic processing performed by the main CPU are executed by a command from the main CPU. CPU, and the dedicated CPU
Is the main CPU while performing the specific arithmetic processing.
The operation of the main CPU when the specific arithmetic processing is completed or when it is necessary to perform an arithmetic processing other than the specific arithmetic processing or when a stop request signal is input from the outside. In a programmable controller configured to release a stopped state, a serial control unit that performs data communication with an external device and issues an interrupt request to the main CPU each time a predetermined segment of data is received, and the operation of the main CPU And a timer unit that generates a clock signal for use as a stop request signal and outputs the clock signal to the dedicated CPU, and the main CPU that receives an interrupt request from the serial control unit performs external transfer control. A memory unit for storing the data received from
Since the cycle of the clock signal is set to a value that is less than or equal to the reception time required to receive the one segment of data in the serial control unit, it is synchronized with the clock signal even during execution of a specific arithmetic process in the dedicated CPU. Master C
The main CP is released at a time interval when the operation stop state of the PU is released and the interrupt request from the serial control unit is generated, that is, a time interval which is shorter than the reception time required for the serial control unit to receive the delimited data.
U becomes operable, the data transfer between the serial control unit and the memory unit can be controlled by the main CPU, and the arithmetic processing of the dedicated CPU is being executed without using an expensive DMA controller as in the conventional example. Moreover, there is an effect that data transfer can be performed between the serial control unit and the memory unit, and the cost can be reduced without lowering the processing efficiency of the data transfer.

【0022】請求項2の発明は、前記主CPUが実行す
るタイマ命令におけるタイマ時間の約数に前記クロック
信号の周期を設定したので、主CPUが動作可能状態と
なる周期がタイマ命令のための時間測定の周期と一致す
ることになり、係る時間測定が所定の精度で容易に行う
ことができるという効果がある。請求項3の発明は、前
記シリアルコントロール部におけるデータ通信の通信速
度を19200ビット毎秒とするとともに前記一区切り
のデータのデータ長を10ビット以上とし併せて前記ク
ロック信号の周期を約500μ秒として成るので、主C
PUは約500μ秒毎に動作可能状態に戻ることから、
シリアルコントロール部が最短で約520.8μ秒毎に
割込要求を行うような上記通信フォーマットにおいて
も、DMAコントローラを用いずにデータ転送処理を効
率良く行うことができるという効果がある。
According to the second aspect of the present invention, the cycle of the clock signal is set to a divisor of the timer time in the timer instruction executed by the main CPU, so that the cycle in which the main CPU becomes operable is for the timer instruction. This coincides with the period of time measurement, and there is an effect that such time measurement can be easily performed with predetermined accuracy. According to a third aspect of the present invention, the communication speed of the data communication in the serial control unit is 19200 bits per second, and the data length of the delimited data is 10 bits or more, and the cycle of the clock signal is about 500 μsec. , Lord C
Since the PU returns to the operable state about every 500 μsec,
Even in the above communication format in which the serial control unit issues an interrupt request every 520.8 μsec at the shortest, the data transfer process can be efficiently performed without using the DMA controller.

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

【図1】実施形態を示すブロック図である。FIG. 1 is a block diagram showing an embodiment.

【図2】同上の動作を説明するためのフローチャートで
ある。
FIG. 2 is a flowchart for explaining the operation of the above.

【図3】同上の動作を説明するためのフローチャートで
ある。
FIG. 3 is a flowchart for explaining the operation of the above.

【図4】同上の動作を説明するためのフローチャートで
ある。
FIG. 4 is a flowchart for explaining the operation of the above.

【図5】同上の動作を説明するためのフローチャートで
ある。
FIG. 5 is a flowchart for explaining the operation of the above.

【図6】従来例を示すブロック図である。FIG. 6 is a block diagram showing a conventional example.

【図7】同上の動作を説明するためのフローチャートで
ある。
FIG. 7 is a flowchart for explaining the operation of the above.

【符号の説明】 1 主CPU 2 専用CPU 3 シリアルコントロール部 4 タイマ部 5 メモリ部 6 アドレスデータバス 7 割込コントロール部[Explanation of symbols] 1 main CPU 2 dedicated CPU 3 serial control unit 4 timer unit 5 memory unit 6 address data bus 7 interrupt control unit

Claims (3)

【特許請求の範囲】[Claims] 【請求項1】 プログラムを実行し演算処理を行う主C
PUと、前記主CPUにて行う演算処理のうちで特定の
演算処理を前記主CPUからの指令により代行する専用
CPUとを備え、前記専用CPUは、前記特定の演算処
理を行っている間は前記主CPUを動作停止状態とし、
前記特定の演算処理が終了したときあるいは前記特定の
演算処理以外の演算処理を行う必要が生じたとき若しく
は外部からの停止要求信号入力があったときに前記主C
PUの動作停止状態を解除するようにして成るプログラ
マブルコントローラにおいて、外部機器とのデータ通信
を行うとともに所定の一区切りのデータを受信する毎に
前記主CPUに割り込み要求を行うシリアルコントロー
ル部と、前記主CPUの動作用のクロック信号を発生す
るとともに該クロック信号を前記停止要求信号として前
記専用CPUに出力するタイマ部と、前記シリアルコン
トロール部からの割り込み要求を受けた前記主CPUに
よって転送制御が行われて外部機器から受信したデータ
が格納されるメモリ部とを備え、前記シリアルコントロ
ール部にて前記一区切りのデータを受信するのに要する
受信時間以下の値に前記クロック信号の周期を設定した
ことを特徴とするプログラマブルコントローラ。
1. A main C for executing a program and performing arithmetic processing.
The CPU includes a PU and a dedicated CPU that substitutes specific arithmetic processing among the arithmetic processing performed by the main CPU in response to a command from the main CPU. The dedicated CPU is provided while performing the specific arithmetic processing. Putting the main CPU into an inoperative state,
When the specific arithmetic processing is completed, or when it becomes necessary to perform arithmetic processing other than the specific arithmetic processing, or when a stop request signal is input from the outside, the main C
In a programmable controller configured to release the operation stop state of a PU, a serial control unit that performs data communication with an external device and issues an interrupt request to the main CPU every time a predetermined segment of data is received; Transfer control is performed by a timer unit that generates a clock signal for operating the CPU and outputs the clock signal as the stop request signal to the dedicated CPU, and the main CPU that receives an interrupt request from the serial control unit. And a memory unit for storing data received from an external device, and the cycle of the clock signal is set to a value equal to or less than a reception time required to receive the delimited data in the serial control unit. And programmable controller.
【請求項2】 前記主CPUが実行するタイマ命令にお
けるタイマ時間の約数に前記クロック信号の周期を設定
したことを特徴とする請求項1記載のプログラマブルコ
ントローラ。
2. The programmable controller according to claim 1, wherein a cycle of the clock signal is set to a divisor of a timer time in a timer instruction executed by the main CPU.
【請求項3】 前記シリアルコントロール部におけるデ
ータ通信の通信速度を19200ビット毎秒とするとと
もに前記一区切りのデータのデータ長を10ビット以上
とし併せて前記クロック信号の周期を約500μ秒とし
て成ることを特徴とする請求項2記載のプログラマブル
コントローラ。
3. The serial control unit has a data communication speed of 19200 bits per second, and the data length of the delimiter data is 10 bits or more, and the cycle of the clock signal is about 500 μsec. The programmable controller according to claim 2.
JP04923496A 1996-03-06 1996-03-06 Programmable controller Expired - Fee Related JP3627352B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP04923496A JP3627352B2 (en) 1996-03-06 1996-03-06 Programmable controller

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP04923496A JP3627352B2 (en) 1996-03-06 1996-03-06 Programmable controller

Publications (2)

Publication Number Publication Date
JPH09244713A true JPH09244713A (en) 1997-09-19
JP3627352B2 JP3627352B2 (en) 2005-03-09

Family

ID=12825215

Family Applications (1)

Application Number Title Priority Date Filing Date
JP04923496A Expired - Fee Related JP3627352B2 (en) 1996-03-06 1996-03-06 Programmable controller

Country Status (1)

Country Link
JP (1) JP3627352B2 (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2009093392A (en) * 2007-10-09 2009-04-30 Meidensha Corp Control method of data equivalence, system thereof, and programmable controller
US11759956B2 (en) 2019-12-12 2023-09-19 Seiko Epson Corporation Robot system and control method for robot system

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2009093392A (en) * 2007-10-09 2009-04-30 Meidensha Corp Control method of data equivalence, system thereof, and programmable controller
US11759956B2 (en) 2019-12-12 2023-09-19 Seiko Epson Corporation Robot system and control method for robot system

Also Published As

Publication number Publication date
JP3627352B2 (en) 2005-03-09

Similar Documents

Publication Publication Date Title
US4782439A (en) Direct memory access system for microcontroller
JP3055917B2 (en) Data transfer control device
US5287471A (en) Data transfer controller using direct memory access method
JP2661222B2 (en) Pulse output device
JPH0731621B2 (en) Method for transferring data between a microprocessor and a memory and an apparatus for implementing the method
JP3627352B2 (en) Programmable controller
JPH05108548A (en) Dma controller
EP0208287B1 (en) Direct memory access controller
US20050149771A1 (en) Processor control circuit, information processing apparatus, and central processing unit
WO1997033233A1 (en) Programmable controller
JPH0143392B2 (en)
EP0410382A2 (en) Data transfer controller using direct memory access method
JP2819705B2 (en) Data transfer control device
JP2536102B2 (en) Data processing device
JP2623501B2 (en) Direct memory access control circuit
JP3265582B2 (en) Microcomputer
JP2844624B2 (en) Data processing device
JPS60205652A (en) Dma transfer system
JP2625573B2 (en) Direct memory access controller
CN115729863A (en) Data transmission method, device, electronic equipment and medium
JPS6342547A (en) Line control unit
JPS6395551A (en) Serial data processor
JPH04306754A (en) Dma controller
JPH02263256A (en) Microcomputer and controller
JP2001117862A (en) Microcomputer

Legal Events

Date Code Title Description
A977 Report on retrieval

Free format text: JAPANESE INTERMEDIATE CODE: A971007

Effective date: 20041112

TRDD Decision of grant or rejection written
A01 Written decision to grant a patent or to grant a registration (utility model)

Free format text: JAPANESE INTERMEDIATE CODE: A01

Effective date: 20041116

A61 First payment of annual fees (during grant procedure)

Effective date: 20041129

Free format text: JAPANESE INTERMEDIATE CODE: A61

FPAY Renewal fee payment (prs date is renewal date of database)

Year of fee payment: 3

Free format text: PAYMENT UNTIL: 20071217

FPAY Renewal fee payment (prs date is renewal date of database)

Free format text: PAYMENT UNTIL: 20081217

Year of fee payment: 4

FPAY Renewal fee payment (prs date is renewal date of database)

Free format text: PAYMENT UNTIL: 20081217

Year of fee payment: 4

S533 Written request for registration of change of name

Free format text: JAPANESE INTERMEDIATE CODE: R313533

FPAY Renewal fee payment (prs date is renewal date of database)

Year of fee payment: 4

Free format text: PAYMENT UNTIL: 20081217

R350 Written notification of registration of transfer

Free format text: JAPANESE INTERMEDIATE CODE: R350

LAPS Cancellation because of no payment of annual fees