JP2005250999A - Register control circuit - Google Patents

Register control circuit Download PDF

Info

Publication number
JP2005250999A
JP2005250999A JP2004062742A JP2004062742A JP2005250999A JP 2005250999 A JP2005250999 A JP 2005250999A JP 2004062742 A JP2004062742 A JP 2004062742A JP 2004062742 A JP2004062742 A JP 2004062742A JP 2005250999 A JP2005250999 A JP 2005250999A
Authority
JP
Japan
Prior art keywords
register
time
cpu
signal
write
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.)
Withdrawn
Application number
JP2004062742A
Other languages
Japanese (ja)
Inventor
Motohiro Oki
基裕 大木
Makoto Hirano
誠 平野
Teruhiro Kono
彰宏 河野
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 Holdings Corp
Original Assignee
Matsushita Electric Industrial 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 Matsushita Electric Industrial Co Ltd filed Critical Matsushita Electric Industrial Co Ltd
Priority to JP2004062742A priority Critical patent/JP2005250999A/en
Publication of JP2005250999A publication Critical patent/JP2005250999A/en
Withdrawn legal-status Critical Current

Links

Images

Abstract

<P>PROBLEM TO BE SOLVED: To provide a resister control circuit enabling to securely access and write, with a low ratio of erroneous writing caused by runaway of a CPU 101 even when a clock frequency CK2 of a clock counter 103 is variable and a relation with a clock frequency CK1 of the CPU 1 is any kind of one. <P>SOLUTION: The register control circuit controls an access to the clock counter 103 as a register of a peripheral circuit with a larger data bus size than that of the CPU 101. An edge detection circuit 109 generates a clock counter write signal 142 by using a signal wherein an edge of a time LOAD bit 108 controllable by the CPU 101 is detected by the clock frequency CK2 of the clock counter 103, and writing in the clock counter 103 becomes possible. Furthermore, because the edge of the signal is utilized in writing control, the erroneous writing on specific CPU 101 malfunction can be prevented. <P>COPYRIGHT: (C)2005,JPO&NCIPI

Description

本発明は、レジスタ制御回路に関し、特にCPUよりも大きいデータバスサイズを持ち、且つ時間の変化に応じてデータ値が変化する周辺回路のレジスタへのアクセスを制御するレジスタ制御回路に関するものである。   The present invention relates to a register control circuit, and more particularly to a register control circuit that controls access to a register of a peripheral circuit that has a data bus size larger than that of a CPU and whose data value changes with time.

以下、従来のレジスタ制御回路について説明する。
図2は、従来のレジスタ制御回路の構成図であり、図3は、従来のレジスタ制御回路のタイミングチャートである。
A conventional register control circuit will be described below.
FIG. 2 is a configuration diagram of a conventional register control circuit, and FIG. 3 is a timing chart of the conventional register control circuit.

図2において、CPU201のデータバスサイズよりも大きく且つ時間の経過に応じてデータ値が変化する周辺回路のレジスタ、例えばカウンタ203に対するレジスタ制御回路を実現するのに、従来はCPU201から出力される32bit1回目アクセス信号206、32bit2回目アクセス信号207とアドレス212とライト信号213とリード信号214とを元にアドレスデコーダ202によりレジスタ上位ライト信号208、レジスタ下位ライト信号209とレジスタ上位リード信号210、レジスタ下位リード信号211を生成し、入力データ保持レジスタ204と出力データ保持レジスタ205を用いて、図3のタイミングチャートのように最後のライトアクセスで同時書込み301を行い、最初にリードアクセスした内容の読み出し302を行うようにした回路を実現し、レジスタへのアクセスを実現している。
特開2002−24164号公報
In FIG. 2, in order to realize a register control circuit for a peripheral circuit, for example, a counter 203, which is larger than the data bus size of the CPU 201 and whose data value changes with the passage of time, a conventional 32-bit1 output from the CPU 201 is used. Based on the second access signal 206, 32-bit second access signal 207, address 212, write signal 213, and read signal 214, the address decoder 202 causes the register upper write signal 208, the register lower write signal 209, the register upper read signal 210, and the register lower read. The signal 211 is generated, the simultaneous write 301 is performed by the last write access as shown in the timing chart of FIG. 3 using the input data holding register 204 and the output data holding register 205, and the first read access is performed. Realize a circuit in which to perform the read 302, and provide access to the register.
Japanese Patent Laid-Open No. 2002-24164

図2で示されるような従来の構成では、以下のような課題があった。
従来の回路構成のように、レジスタ上位ライト信号208、レジスタ下位ライト信号209を生成するのに32bit1回目アクセス信号206、32bit2回目アクセス信号207とアドレス212とライト信号213とを用いた場合で、周辺回路のレジスタの動作クロックCK2がCPU201の動作クロックCK1と異なり、かつ周波数の関係がCK1>CK2である時、生成されたレジスタ上位ライト信号208、レジスタ下位ライト信号209の書込み許可期間がCK2の1周期分より短くなりCK1とCK2の位相関係によってはCK2の立ち上がりでレジスタ上位ライト信号208、レジスタ下位ライト信号209の書込み許可期間を取りきれず書込みを行えない場合があるという問題があった。対策としてレジスタ上位ライト信号208、レジスタ下位ライト信号209の書込み許可期間をカウンタなどで延ばす手段があるが、CK2の周波数がCK1の周波数に比べて極めて小さい場合(CK1>>CK2)、カウンタのbit数が増大し回路が増大する。また、CK1とCK2の周波数比が可変であるシステムにおいてはさらに回路が増大する。
The conventional configuration as shown in FIG. 2 has the following problems.
When the 32-bit first access signal 206, the 32-bit second access signal 207, the address 212, and the write signal 213 are used to generate the register upper write signal 208 and the register lower write signal 209 as in the conventional circuit configuration, When the operation clock CK2 of the register of the circuit is different from the operation clock CK1 of the CPU 201 and the frequency relationship is CK1> CK2, the write permission period of the generated register upper write signal 208 and register lower write signal 209 is 1 of CK2. Depending on the phase relationship between CK1 and CK2, the write upper period of the register high-order write signal 208 and register low-order write signal 209 could not be completed at the rising edge of CK2 and writing could not be performed. As a countermeasure, there is means for extending the write permission period of the register upper write signal 208 and the register lower write signal 209 with a counter or the like. However, when the frequency of CK2 is extremely smaller than the frequency of CK1 (CK1 >> CK2), the bit of the counter The number increases and the circuit increases. Further, in a system in which the frequency ratio between CK1 and CK2 is variable, the number of circuits is further increased.

また、CPU201が何らかの原因で暴走しカウンタ203への書込みを命令してしまった場合、容易にカウンタ203への誤書込み動作を行ってしまうという問題があった。   Further, when the CPU 201 runs out of control for some reason and instructs to write to the counter 203, there is a problem that an erroneous write operation to the counter 203 is easily performed.

そこで本発明は、上記のような従来の問題点を解決するためになされたもので、周辺回路のレジスタの動作クロックが可変でかつCPUの動作クロックとの関係が如何なる場合においても、CPUよりデータバスサイズが大きい周辺回路のレジスタに、確実に書込みアクセスでき、またCPUの暴走による誤書込みを行う確率が低いレジスタ制御回路を得ることを目的とする。   Therefore, the present invention has been made to solve the above-mentioned conventional problems, and the CPU operates the data regardless of the relationship between the operation clock of the peripheral circuit registers and the CPU operation clock. It is an object of the present invention to obtain a register control circuit which can reliably access a register of a peripheral circuit having a large bus size and has a low probability of erroneous writing due to a runaway CPU.

上記課題を解決するために、本発明のレジスタ制御回路は、CPUが制御可能な設定LOADレジスタの出力信号を周辺回路のレジスタの動作クロックでエッジ検出を行いその出力信号を用いて前記周辺回路のレジスタへのライト信号を生成する回路と、少なくとも前記周辺回路のレジスタのデータバスサイズ以上の入力データ保持レジスタを用意し、前記周辺回路のレジスタへ書込みを行う値を事前に前記入力データ保持回路に書込み、前記設定LOADレジスタを変化させるように書き込むことにより書込み許可期間を発生させ、前記周辺回路のレジスタへの書込み動作を実現することを特徴とするものである。   In order to solve the above-described problem, the register control circuit of the present invention performs edge detection on the output signal of the setting LOAD register that can be controlled by the CPU using the operation clock of the register of the peripheral circuit, and uses the output signal to A circuit for generating a write signal to the register and an input data holding register at least larger than the data bus size of the register of the peripheral circuit are prepared, and a value to be written to the register of the peripheral circuit is previously stored in the input data holding circuit. Writing is performed so as to change the setting LOAD register, thereby generating a write permission period and realizing a write operation to the register of the peripheral circuit.

本発明の請求項1によるレジスタ制御回路は、CPUのデータバスサイズXより大きいデータバスサイズYを持ち、時間の変化によりデータ値が変化する周辺回路のレジスタへのアクセスを制御するレジスタ制御回路において、前記CPUが制御可能な第1のレジスタの出力を前記周辺回路のレジスタの動作クロックでエッジ検出を行い、一括書込みアクセス制御信号を生成する書込み制御信号生成回路と、少なくとも前記周辺回路のレジスタのデータバスサイズY分の入力データを保持する入力データ保持レジスタとを有し、前記データバスサイズYの入力データを前記周辺回路のレジスタに一括して書き込むことができる書込み制御回路を備えたことを特徴とするものである。   According to a first aspect of the present invention, there is provided a register control circuit for controlling access to a register of a peripheral circuit having a data bus size Y larger than a data bus size X of a CPU and whose data value changes with time. , Detecting the edge of the output of the first register controllable by the CPU with the operation clock of the register of the peripheral circuit, and generating a batch write access control signal, and at least the register of the peripheral circuit An input data holding register for holding input data for the data bus size Y, and a write control circuit capable of collectively writing the input data of the data bus size Y to the peripheral circuit registers. It is a feature.

本発明の請求項2によるレジスタ制御回路は、請求項1記載のレジスタ制御回路において、前記データバスサイズY分の出力データを保持する出力データ保持レジスタと、前記CPUが制御可能な第2のレジスタの出力を用いて、一括読出しアクセス制御信号を生成する読出し制御信号生成回路とを有し、前記周辺回路のレジスタのデータ値を分割して前記出力データ保持レジスタに読み出すことができる読出し制御回路をさらに備えたことを特徴とするものである。   A register control circuit according to a second aspect of the present invention is the register control circuit according to the first aspect, wherein an output data holding register that holds output data for the data bus size Y and a second register that can be controlled by the CPU And a read control signal generation circuit that generates a batch read access control signal using the output of the output, and a read control circuit capable of dividing the data value of the register of the peripheral circuit and reading it to the output data holding register Furthermore, it is provided with the feature.

本発明のレジスタ制御回路によれば、書込み制御回路を用いることにより、設定LOADレジスタの出力信号を周辺回路のレジスタの動作クロックCK2でエッジ検出するため、前記周辺回路のレジスタへのライト信号はCK2の1周期分の書込み許可期間を必ず確保する事ができ、CPUの動作クロックCK1に対して、周波数の関係がCK1>CK2であっても安定して書込みを行うことができるという効果がある。また、CK1>>CK2の関係においても、CPUのソフトウェアにより前記設定LOADレジスタの出力信号を連続変化させる期間をCK2周期幅以下にならないようにすることで、エッジ検出を必ず行えるため回路を増加することなく前記周辺回路のレジスタへの書込み動作を行うことができる。さらに、CK1=CK2でもCK1<CK2でも書込み動作が可能であるため、CK1とCK2が如何なる周波数であっても前記周辺回路のレジスタへの書込み動作を安定して行うことができる。   According to the register control circuit of the present invention, by using the write control circuit, the edge of the output signal of the setting LOAD register is detected by the operation clock CK2 of the peripheral circuit register. Therefore, the write signal to the peripheral circuit register is CK2 Thus, there is an effect that the write permission period for one cycle can be ensured, and the write operation can be stably performed even if the relationship of the frequency is CK1> CK2 with respect to the operation clock CK1 of the CPU. Also in the relationship of CK1 >> CK2, the number of circuits can be increased because edge detection can always be performed by making the period of continuously changing the output signal of the setting LOAD register by the CPU software not less than the CK2 cycle width. The write operation to the register of the peripheral circuit can be performed without any problem. Further, since the write operation is possible even when CK1 = CK2 or CK1 <CK2, the write operation to the register of the peripheral circuit can be stably performed regardless of the frequency of CK1 and CK2.

また、前記エッジ検出において特定値への変化のみ例えば「0」→「1」のような変化のみを検出するエッジ検出回路を用意し、前記周辺回路のレジスタへの書込み動作をしていない期間は前記設定LOADレジスタを「1」に固定していれば、前記CPUが何らかの原因で暴走した場合でも、前記周辺回路のレジスタに対して誤書込みを行わず、前記CPU暴走時の誤書込みの確率が従来の回路構成より低くなるという効果がある。   In addition, an edge detection circuit that detects only a change such as “0” → “1”, for example, only a change to a specific value in the edge detection is prepared, and a period during which the write operation to the register of the peripheral circuit is not performed If the setting LOAD register is fixed to “1”, even if the CPU runs out of control for some reason, erroneous writing is not performed on the peripheral circuit registers, and the probability of erroneous writing at the time of the CPU runaway is increased. There is an effect that it becomes lower than the conventional circuit configuration.

また、本発明のレジスタ制御回路によれば、読出し制御回路を用いることにより、前記CPUより大きいデータバスサイズを持ち、且つ時間の変化によりデータ値が変化する前記周辺回路のレジスタへの読出し動作にて、前記CPUの制御可能なレジスタを前記CPUで制御することで、前記周辺回路のレジスタの値を正確に分割して読み出すことができるという効果がある。   Further, according to the register control circuit of the present invention, by using the read control circuit, it is possible to perform a read operation to the register of the peripheral circuit having a data bus size larger than the CPU and whose data value changes with time. Thus, by controlling the registers that can be controlled by the CPU with the CPU, it is possible to accurately divide and read the register values of the peripheral circuits.

以下に本発明の実施の形態について、図面を用いて説明する。
(実施の形態1)
図1は、本発明の実施の形態1によるレジスタ制御回路の構成図である。
Embodiments of the present invention will be described below with reference to the drawings.
(Embodiment 1)
FIG. 1 is a configuration diagram of a register control circuit according to the first embodiment of the present invention.

図1において、CPU101は、アドレスデコーダ102に対してアドレス122とライト信号123とリード信号124を出力し、書込み時にはライトデータバス125に書込みデータを出力し、読み出し時にはリードデータバス126を入力し読出データとして処理を行う。   In FIG. 1, the CPU 101 outputs an address 122, a write signal 123, and a read signal 124 to the address decoder 102, outputs write data to the write data bus 125 during writing, and inputs a read data bus 126 during reading. Process as data.

アドレスデコーダ102は、アドレス122とライト信号123とリード信号124を用いて、各周辺回路のレジスタ個別のライト、リード信号である、時刻設定レジスタ0ライト信号127、時刻設定レジスタ0リード信号128、時刻設定レジスタ1ライト信号129、時刻設定レジスタ1リード信号130、時刻読出レジスタ0リード信号131、時刻読出レジスタ1リード信号132、時刻LOADビットライト信号133、時刻LOADビットリード信号134、時刻HOLDビットライト信号135、時刻HOLDビットリード信号136、割込み時刻設定レジスタ0ライト信号137、割込み時刻設定レジスタ0リード信号138、割込み時刻設定レジスタ1ライト信号139、割込み時刻設定レジスタ1リード信号140を生成する。   The address decoder 102 uses the address 122, the write signal 123, and the read signal 124 to write and read the individual registers of each peripheral circuit. The time setting register 0 write signal 127, the time setting register 0 read signal 128, the time Setting register 1 write signal 129, time setting register 1 read signal 130, time reading register 0 read signal 131, time reading register 1 read signal 132, time LOAD bit write signal 133, time LOAD bit read signal 134, time HOLD bit write signal 135, time HOLD bit read signal 136, interrupt time setting register 0 write signal 137, interrupt time setting register 0 read signal 138, interrupt time setting register 1 write signal 139, and interrupt time setting register 1 read signal 140 are generated. To do.

周辺回路のレジスタである時計カウンタ103は、CPU101の動作クロックCK1と非同期でかつ周波数の異なる動作クロックCK2により動作を行い、週時間分秒を表すため23bitのカウンタをもつ。   A clock counter 103, which is a register of the peripheral circuit, operates with an operation clock CK2 that is asynchronous with the operation clock CK1 of the CPU 101 and has a different frequency, and has a 23-bit counter to represent week hours, minutes, and seconds.

時刻設定レジスタ0(104)と時刻設定レジスタ1(105)は、時計カウンタ103に対する入力データ保持レジスタである。時刻設定レジスタ0(104)は、CPU101からの時刻設定レジスタ0ライト信号127により週時間設定データを保持し、時刻設定レジスタ0リード信号128を制御信号とするトライステートバッファ114により週時間設定データをCPU101にて読み出すことができる。また、時刻設定レジスタ1(105)は、時刻設定レジスタ1ライト信号129により分秒設定データを保持し、分秒設定時刻設定レジスタ1リード信号130を制御信号とするトライステートバッファ115により分秒設定データをCPU101にて読み出すことができる。   The time setting register 0 (104) and the time setting register 1 (105) are input data holding registers for the clock counter 103. The time setting register 0 (104) holds the week time setting data by the time setting register 0 write signal 127 from the CPU 101, and the week time setting data by the tri-state buffer 114 using the time setting register 0 read signal 128 as a control signal. It can be read by the CPU 101. The time setting register 1 (105) holds the minute / second setting data by the time setting register 1 write signal 129 and sets the minute / second by the tri-state buffer 115 using the minute / second setting time setting register 1 read signal 130 as a control signal. Data can be read by the CPU 101.

時計カウンタ103への書き込みは、時刻LOADビット(設定LOADレジスタ)108の出力の変化により行われる。   Writing to the clock counter 103 is performed by changing the output of the time LOAD bit (setting LOAD register) 108.

時刻LOADビット108は、時刻LOADビットライト信号133によりCPU101から書込みが行われ、時刻LOADビットリード信号134を制御信号とするトライステートバッファ119によりCPU101にて読み出すことができる。時刻LOADビット108の出力は、エッジ検出回路109により「0」→「1」の変化をクロックCK2で検出され、時計カウンタライト信号(一括書込みアクセス制御信号)142となる。時計カウンタ103は、時計カウンタライト信号142の書込み許可期間中に、時刻設定レジスタ0(104)からの時刻設定データ0(144)、及び時刻設定レジスタ1(105)からの時刻設定データ1(145)を読み取り、9bitの週時間設定データと14bitの分秒設定データの併せて23bitのデータを一括して同時に書き込むことができる。   The time LOAD bit 108 is written from the CPU 101 by the time LOAD bit write signal 133 and can be read by the CPU 101 by the tristate buffer 119 using the time LOAD bit read signal 134 as a control signal. The output of the time LOAD bit 108 is detected by the edge detection circuit 109 from “0” → “1” with the clock CK 2, and becomes a clock counter write signal (batch write access control signal) 142. The time counter 103 receives time setting data 0 (144) from the time setting register 0 (104) and time setting data 1 (145) from the time setting register 1 (105) during the write permission period of the time counter write signal 142. ), And 23 bits of data can be simultaneously written simultaneously, including 9-bit weekly time setting data and 14-bit minute / second setting data.

時刻読出レジスタ0(106)と時刻読出レジスタ1(107)は、時計カウンタ103に対する出力データ保持レジスタである。時刻読出レジスタ0(106)は、時刻読出レジスタ0リード信号131を制御信号とするトライステートバッファ116により週時間読出データをCPU101にて読み出すことができ、時刻読出レジスタ1(107)は、時刻読出レジスタ1リード信号132を制御信号とするトライステートバッファ117により分秒読出データをCPU101にて読み出すことができる。   The time reading register 0 (106) and the time reading register 1 (107) are output data holding registers for the clock counter 103. The time reading register 0 (106) can read the weekly time reading data by the CPU 101 by the tri-state buffer 116 using the time reading register 0 read signal 131 as a control signal, and the time reading register 1 (107) The CPU 101 can read out the minute / second read data by the tristate buffer 117 using the register 1 read signal 132 as a control signal.

時刻HOLDビット110は、時刻HOLDビットライト信号135によりCPU101から書込みが行われ、時刻HOLDビットリード信号136を制御信号とするトライステートバッファ118によりCPU101にて読み出すことができる。   The time HOLD bit 110 is written from the CPU 101 by the time HOLD bit write signal 135 and can be read by the CPU 101 by the tristate buffer 118 using the time HOLD bit read signal 136 as a control signal.

時計カウンタ103の読出しは、時刻HOLDビット110の出力をインバータ151により反転させた時刻読出ライト信号(一括読出しアクセス制御信号)143により行われる。   Reading of the clock counter 103 is performed by a time read write signal (collective read access control signal) 143 obtained by inverting the output of the time HOLD bit 110 by the inverter 151.

時刻HOLDビット110が「0」である時、時刻読出レジスタ0(106)は時計カウンタ103が出力する時刻読出データ0(146)を、時刻読出レジスタ1(107)は時計カウンタ103が出力する時刻読出データ1(147)をそれぞれCPU101の動作クロックCK1のタイミングで一括して同時に書き込む。また、時刻HOLDビット110が「1」である時、時刻読出レジスタ0(106)は時計カウンタ103が出力する時刻読出データ0(146)を、時刻読出レジスタ1(107)は時計カウンタ103が出力する時刻読出データ1(147)をそれぞれ同時に保持する。   When the time HOLD bit 110 is “0”, the time reading register 0 (106) outputs the time reading data 0 (146) output from the clock counter 103, and the time reading register 1 (107) outputs the time output from the clock counter 103. Read data 1 (147) is written simultaneously at the timing of the operation clock CK1 of the CPU 101, respectively. When the time HOLD bit 110 is “1”, the time reading register 0 (106) outputs the time reading data 0 (146) output from the time counter 103, and the time reading register 1 (107) outputs from the time counter 103. The time read data 1 (147) to be held is simultaneously held.

したがって、CPU101により、時刻HOLDビット110を「0」→「1」に書換えた時の時計カウンタ103の値を時刻読出レジスタ0(106)、及び時刻読出レジスタ1(107)に分割し読み出すことができる。   Therefore, the CPU 101 can divide and read the value of the clock counter 103 when the time HOLD bit 110 is rewritten from “0” to “1” into the time reading register 0 (106) and the time reading register 1 (107). it can.

割込み時刻設定レジスタ0(111)、及び割込み時刻設定レジスタ1(112)は、時刻一致割込みの設定レジスタである。   The interrupt time setting register 0 (111) and the interrupt time setting register 1 (112) are time coincidence interrupt setting registers.

割込み時刻設定レジスタ0(111)は、CPU101からの割込み時刻設定レジスタ0ライト信号137により週時間割込み一致設定データを書き込み、割込み時刻設定レジスタ0リード信号138が制御信号となるトライステートバッファ120により週時間割込み一致設定データをCPU101にて読み出すことができる。また、割込み時刻設定レジスタ1(112)は、割込み時刻設定レジスタ1ライト信号139により分秒割込み一致設定データを書き込み、割込み時刻設定レジスタ1リード信号140が制御信号となるトライステートバッファ121により分秒割込み一致設定データをCPU101にて読み出すことができる。   The interrupt time setting register 0 (111) writes week time interrupt coincidence setting data by the interrupt time setting register 0 write signal 137 from the CPU 101, and the tri-state buffer 120 to which the interrupt time setting register 0 read signal 138 serves as a control signal The time interrupt match setting data can be read out by the CPU 101. The interrupt time setting register 1 (112) writes minute / second interrupt coincidence setting data by the interrupt time setting register 1 write signal 139, and minutes / second by the tri-state buffer 121 in which the interrupt time setting register 1 read signal 140 becomes a control signal. The interrupt match setting data can be read by the CPU 101.

比較器113には、時刻読出データ0(146)と時刻読出データ1(147)、割込み時刻設定データ0(149)と割込み時刻設定データ1(148)が入力され、割込み時刻設定データ0(149)と時刻読出データ0(146)、割込み時刻設定データ1(148)と時刻読出データ1(147)が互いに一致した場合、時刻一致割込み要求信号150をCPU101に対して出力し、CPU101は割込み処理を実行することができる。   The comparator 113 receives the time read data 0 (146), the time read data 1 (147), the interrupt time setting data 0 (149), and the interrupt time setting data 1 (148), and receives the interrupt time setting data 0 (149). ), Time read data 0 (146), interrupt time setting data 1 (148), and time read data 1 (147) match each other, a time coincidence interrupt request signal 150 is output to CPU 101, and CPU 101 performs interrupt processing. Can be executed.

次に、時計カウンタ103の書込みと読出しの動作手順を説明する。
図4は、本発明の実施の形態1によるレジスタ制御回路のタイミングチャートである。
Next, writing and reading operation procedures of the clock counter 103 will be described.
FIG. 4 is a timing chart of the register control circuit according to the first embodiment of the present invention.

図4において、時計カウンタ103に時刻設定データ「x3125959」を書き込む場合、始めに時刻設定レジスタ0書き込みタイミング401においてCPU101にて時刻設定レジスタ0(104)に週時間設定データ「x0312」を書き込み、時刻設定レジスタ1書き込みタイミング402において、CPU101にて時刻設定レジスタ1(105)に分秒設定データ「x5959」を書き込む。   In FIG. 4, when writing the time setting data “x312959” to the clock counter 103, the CPU 101 first writes the week time setting data “x0312” to the time setting register 0 (104) at the time setting register 0 write timing 401. At the setting register 1 write timing 402, the CPU 101 writes minute / second setting data “x5959” to the time setting register 1 (105).

次に、時刻LOADビット書き込みタイミング403において、CPU101にて時刻LOADビット108に「x0001」を書き込み、時刻LOADビット108を「0」→「1」に変化させる。   Next, at the time LOAD bit write timing 403, the CPU 101 writes “x0001” to the time LOAD bit 108 and changes the time LOAD bit 108 from “0” to “1”.

エッジ検出回路109は、時刻LOADビット書き込みタイミング403において、時刻LOADビット108の変化に対してエッジを検出し、時計カウンタライト信号発生タイミング404において、時計カウンタ103の動作クロックCK2の1周期分の書込み許可期間を時計カウンタライト信号142に出力する。時計カウンタ103は、時計カウンタ書き込みタイミング405において、時計カウンタ103に、CK2の立ち上がりで時計カウンタライト信号142の書き込み許可期間と時刻設定レジスタ0(104)の値「x312」と時刻設定レジスタ1(105)の値「x5959」を取り込み、時刻設定データ「x3125959」を同時に書き込むことができる。   The edge detection circuit 109 detects an edge with respect to the change of the time LOAD bit 108 at the time LOAD bit write timing 403, and writes one cycle of the operation clock CK 2 of the clock counter 103 at the clock counter write signal generation timing 404. The permission period is output to the clock counter write signal 142. At the time counter write timing 405, the time counter 103 sends to the time counter 103 the write permission period of the time counter write signal 142 and the value “x312” of the time setting register 0 (104) and the time setting register 1 (105) at the rise of CK2. ) Value “x5959” and time setting data “x312959” can be written simultaneously.

次に時計カウンタ103の値を読み出す場合、始めに、時刻HOLDビット書き込みタイミング406において、時刻HOLDビット110に「x0001」を書き込み、時刻HOLDビット110を「0」→「1」と変化させ、「1」の状態を時刻読出レジスタ0(106)と時刻読出レジスタ1(107)の読出しが終了するまで保持させる。時刻読出レジスタ0(106)と時刻読出レジスタ1(107)は、時刻読出レジスタ0,1HOLDタイミング407に示すように、時刻HOLDビット110が「1」であるので前の値を保持する。従って、時刻読出レジスタ0(106)は「x313」を保持し続け、時刻読出レジスタ1(107)は「x0000」を保持し続ける。   Next, when the value of the clock counter 103 is read, first, at the time HOLD bit write timing 406, “x0001” is written to the time HOLD bit 110, and the time HOLD bit 110 is changed from “0” to “1”. The state of “1” is held until the reading of the time reading register 0 (106) and the time reading register 1 (107) is completed. The time reading register 0 (106) and the time reading register 1 (107) hold the previous values because the time HOLD bit 110 is "1" as shown in the time reading registers 0 and 1 HOLD timing 407. Therefore, the time reading register 0 (106) continues to hold “x313”, and the time reading register 1 (107) continues to hold “x0000”.

次に、時刻読出レジスタ0読出しタイミング408において、CPU101にて、リードデータバス126で時刻読出レジスタ0(106)の値「x313」を読み出し、時刻読出レジスタ1読出しタイミング409において、リードデータバス126に示すように時刻読出レジスタ1(107)の値「x0000」を読み出すことにより、CPU101は正確に時計カウンタの値「x3130000」を分割して読み出すことができる。   Next, at time read register 0 read timing 408, CPU 101 reads the value “x313” of time read register 0 (106) from read data bus 126, and at time read register 1 read timing 409, it reads to read data bus 126. As shown, by reading the value “x0000” of the time reading register 1 (107), the CPU 101 can accurately divide and read the value “x3130,000” of the clock counter.

図4において、CK1>CK2の状態の動作を示しているが、更にCK2の周波数がCK1の周波数より小さい場合(CK1>>CK2)であっても、時刻LOADビット108を書き換える周期をCK2の周期以上で必ず書き換えるようにソフトウェアを作成すれば、安定して書き込み動作を実現することができる。また、CK1=CK2、CK1<CK2の場合であっても、エッジ検出回路109にて確実に書込み許可期間をCK2の1周期分のパルス幅を確保できるため、安定して書き込み動作を実現することができる。   In FIG. 4, the operation in the state of CK1> CK2 is shown. Even when the frequency of CK2 is smaller than the frequency of CK1 (CK1 >> CK2), the cycle of rewriting the time LOAD bit 108 is the cycle of CK2. If the software is created so as to be surely rewritten as described above, the writing operation can be stably realized. In addition, even when CK1 = CK2 and CK1 <CK2, the edge detection circuit 109 can ensure the write permission period with a pulse width corresponding to one cycle of CK2, thereby realizing a stable write operation. Can do.

また、誤書き込み動作についても、時計カウンタライト信号142は時刻LOADビット108の「0」→「1」の変化によって書込み許可期間が生成されるため、時計カウンタ103への書込み動作をしていない時、時刻LOADビット108を「1」にしておけば、時刻LOADビット108に「0」を書かれても、時刻LOADビット108に「1」が書かれても誤書き込みされる可能性はない。   As for the erroneous write operation, the clock counter write signal 142 is generated when the write enable period is generated by the change of the time LOAD bit 108 from “0” to “1”. If the time LOAD bit 108 is set to “1”, even if “0” is written in the time LOAD bit 108 or “1” is written in the time LOAD bit 108, there is no possibility of erroneous writing.

また、エッジ検出回路109は時計カウンタ103の動作クロックCK2にてエッジ検出を行い、時計カウンタライト信号142を生成するため、時刻LOADビット108に「0」→「1」を書かれてしまった場合で「0」を書き込まれてから次に「1」を書き込まれる期間がCK2よりも短ければ書込み許可期間が生成される可能性が低く、従来の技術よりCPU101の暴走による誤書き込みの確率が低い。   Further, since the edge detection circuit 109 detects the edge with the operation clock CK2 of the clock counter 103 and generates the clock counter write signal 142, when “0” → “1” is written in the time LOAD bit 108 If the period in which “1” is written after the time “0” is written is shorter than CK2, the writing permission period is less likely to be generated, and the probability of erroneous writing due to the runaway of the CPU 101 is lower than in the prior art. .

なお、誤書き込みを行う可能性をさらに低くするため、設定LOADレジスタを1bitだけでなく複数のbitを持ち、複雑な値を設定LOADレジスタに書き込まないと書き込み許可期間を生成しないような回路にすればよい。   In order to further reduce the possibility of erroneous writing, the circuit has a setting LOAD register that has a plurality of bits as well as 1 bit and does not generate a write permission period unless a complex value is written to the setting LOAD register. That's fine.

このように本実施の形態によれば、CPUが制御可能な時刻LOADビット108の出力信号を周辺回路のレジスタの動作クロックCK2でエッジ検出を行いその出力信号を用いて時計カウンタライト信号142を生成するエッジ検出回路109と、少なくとも前記周辺回路のレジスタのデータバスサイズ以上の入力データを保持する時刻設定レジスタ0(104)、及び時刻設定レジスタ1(105)を備え、CPUのデータバスサイズより大きいデータバスサイズの入力データを一括して書き込むことができるようにしたので、書込み許可時間に安定して書込み動作をすることができるという効果がある。   As described above, according to the present embodiment, the output signal of the time LOAD bit 108 that can be controlled by the CPU is subjected to edge detection using the operation clock CK2 of the peripheral circuit register, and the clock counter write signal 142 is generated using the output signal. Edge detection circuit 109, and time setting register 0 (104) and time setting register 1 (105) that hold at least input data larger than the data bus size of the peripheral circuit registers, and are larger than the CPU data bus size. Since the input data of the data bus size can be written in a lump, there is an effect that the writing operation can be stably performed during the write permission time.

本発明にかかるレジスタ制御回路は、CPUのデータバスサイズをより大きいデータを持ち前記CPUの動作クロックCK1とは異なるクロックCK2で動作していて且つ時間の経過に応じてデータ値が変化するレジスタへのアクセスを、回路を増加させずに確実に行える機能と前記CPUの暴走による誤書き込みを行う確率を低くする機能を有し、時計回路等のレジスタ制御回路等として有用である。また、本発明はCPUのデータバスサイズより大きいデータバスを持つレジスタでなくとも、前記CPUの動作クロックと異なるクロックで動作して且つ時間の経過に応じてデータ値が変化するレジスタを有する回路へのレジスタ制御回路等としての用途にも応用できる。また、本発明ではCPUの暴走による誤書き込みを行うことによりシステムにおいて悪影響をもたらすレジスタを有する回路へのレジスタ制御回路等としての用途にも応用できる。   The register control circuit according to the present invention is a register that has a larger data bus size than the CPU, operates with a clock CK2 different from the operation clock CK1 of the CPU, and changes its data value over time. This function is useful as a register control circuit such as a clock circuit, and the like, which has a function that can reliably perform access without increasing the number of circuits and a function that reduces the probability of erroneous writing due to runaway of the CPU. Further, the present invention is not limited to a register having a data bus larger than the data bus size of the CPU, but to a circuit having a register that operates with a clock different from the operation clock of the CPU and whose data value changes with the passage of time. It can also be used as a register control circuit. In addition, the present invention can be applied to a use as a register control circuit to a circuit having a register that adversely affects the system by erroneous writing due to runaway of the CPU.

本発明の実施の形態1におけるレジスタ制御回路の構成図である。It is a block diagram of the register control circuit in Embodiment 1 of this invention. 従来例におけるレジスタ制御回路の構成図である。It is a block diagram of the register control circuit in a prior art example. 従来例におけるレジスタ制御回路のタイミングチャートである。It is a timing chart of the register control circuit in a prior art example. 本発明の実施の形態1におけるレジスタ制御回路のタイミングチャートである。3 is a timing chart of the register control circuit according to the first embodiment of the present invention.

符号の説明Explanation of symbols

101 CPU
102 アドレスデコーダ
103 時計カウンタ
104 時刻設定レジスタ0
105 時刻設定レジスタ1
106 時刻読出レジスタ0
107 時刻読出レジスタ1
108 時刻LOADビット
109 エッジ検出回路
110 時刻HOLDビット
111 割込み時刻設定レジスタ0
112 割込み時刻設定レジスタ1
113 比較器
114 トライステートバッファ
115 トライステートバッファ
116 トライステートバッファ
117 トライステートバッファ
118 トライステートバッファ
119 トライステートバッファ
120 トライステートバッファ
121 トライステートバッファ
122 アドレス
123 ライト信号
124 リード信号
125 ライトデータバス
126 リードデータバス
127 時刻設定レジスタ0ライト信号
128 時刻設定レジスタ0リード信号
129 時刻設定レジスタ1ライト信号
130 時刻設定レジスタ1リード信号
131 時刻読出レジスタ0リード信号
132 時刻読出レジスタ1リード信号
133 時刻LOADビットライト信号
134 時刻LOADビットリード信号
135 時刻HOLDビットライト信号
136 時刻HOLDビットリード信号
137 割込み時刻設定レジスタ0ライト信号
138 割込み時刻設定レジスタ0リード信号
139 割込み時刻設定レジスタ1ライト信号
140 割込み時刻設定レジスタ1リード信号
141 時刻LOADビット出力信号
142 時計カウンタライト信号
143 時刻読出ライト信号
144 時刻設定データ0
145 時刻設定データ1
146 時刻読出データ0
147 時刻読出データ1
148 割込み時刻設定データ1
149 割込み時刻設定データ0
150 時刻一致割込み要求信号
151 インバータ
201 CPU
202 アドレスデコーダ
203 カウンタ
204 入力データ保持レジスタ
205 出力データ保持レジスタ
206 32bit1回目アクセス信号
207 32bit2回目アクセス信号
208 レジスタ上位ライト信号
209 レジスタ下位ライト信号
210 レジスタ上位リード信号
211 レジスタ下位リード信号
212 アドレス
213 ライト信号
214 リード信号
301 書き込みアクセスタイミングチャート
302 読出しアクセスタイミングチャート
401 時刻設定レジスタ0書き込みタイミング
402 時刻設定レジスタ1書き込みタイミング
403 時刻LOADビット書き込みタイミング
404 時計カウンタライト信号発生タイミング
405 時計カウンタ書き込みタイミング
406 時刻HOLDビット書き込みタイミング
407 時刻読出レジスタ0,1HOLDタイミング
408 時刻読出レジスタ0読出しタイミング
409 時刻読出レジスタ1読出しタイミング
101 CPU
102 Address decoder 103 Clock counter 104 Time setting register 0
105 Time setting register 1
106 Time reading register 0
107 Time reading register 1
108 Time LOAD bit 109 Edge detection circuit 110 Time HOLD bit 111 Interrupt time setting register 0
112 Interrupt time setting register 1
113 Comparator 114 Tristate Buffer 115 Tristate Buffer 116 Tristate Buffer 117 Tristate Buffer 118 Tristate Buffer 119 Tristate Buffer 120 Tristate Buffer 121 Tristate Buffer 122 Address 123 Write Signal 124 Read Signal 125 Write Data Bus 126 Read Data Bus 127 Time setting register 0 write signal 128 Time setting register 0 read signal 129 Time setting register 1 write signal 130 Time setting register 1 read signal 131 Time reading register 0 read signal 132 Time reading register 1 read signal 133 Time LOAD bit write signal 134 Time LOAD bit read signal 135 Time HOLD bit write signal 136 Time HOLD bit Read time signal 137 Interrupt time setting register 0 write signal 138 Interrupt time setting register 0 read signal 139 Interrupt time setting register 1 write signal 140 Interrupt time setting register 1 read signal 141 Time LOAD bit output signal 142 Clock counter write signal 143 Time read write signal 144 Time setting data 0
145 Time setting data 1
146 Time reading data 0
147 Time reading data 1
148 Interrupt time setting data 1
149 Interrupt time setting data 0
150 Time coincidence interrupt request signal 151 Inverter 201 CPU
202 Address decoder
203 Counter 204 Input data holding register 205 Output data holding register 206 32-bit first access signal 207 32-bit second access signal 208 Register upper write signal 209 Register lower write signal 210 Register upper read signal 211 Register lower read signal 212 Address 213 Write signal 214 Read signal 301 Write access timing chart 302 Read access timing chart 401 Time setting register 0 write timing 402 Time setting register 1 write timing 403 Time LOAD bit write timing 404 Clock counter write signal generation timing 405 Clock counter write timing 406 Time HOLD bit write timing 407 Time Read register 0, 1HO D Timing 408 time readout register 0 read timing 409 time readout register 1 read timing

Claims (2)

CPUのデータバスサイズXより大きいデータバスサイズYを持ち、時間の変化によりデータ値が変化する周辺回路のレジスタへのアクセスを制御するレジスタ制御回路において、
前記CPUが制御可能な第1のレジスタの出力を前記周辺回路のレジスタの動作クロックでエッジ検出を行い、一括書込みアクセス制御信号を生成する書込み制御信号生成回路と、少なくとも前記周辺回路のレジスタのデータバスサイズY分の入力データを保持する入力データ保持レジスタとを有し、前記データバスサイズYの入力データを前記周辺回路のレジスタに一括して書き込むことができる書込み制御回路を備えた、
ことを特徴とするレジスタ制御回路。
In a register control circuit for controlling access to a register of a peripheral circuit having a data bus size Y larger than the data bus size X of the CPU and whose data value changes with time.
A write control signal generation circuit for detecting an edge of the output of the first register controllable by the CPU using an operation clock of the register of the peripheral circuit and generating a batch write access control signal; and at least data of the register of the peripheral circuit An input data holding register for holding input data for the bus size Y, and a write control circuit capable of writing the input data of the data bus size Y to the peripheral circuit registers at once.
A register control circuit.
請求項1記載のレジスタ制御回路において、
前記データバスサイズY分の出力データを保持する出力データ保持レジスタと、前記CPUが制御可能な第2のレジスタの出力を用いて、一括読出しアクセス制御信号を生成する読出し制御信号生成回路とを有し、前記周辺回路のレジスタのデータ値を分割して前記出力データ保持レジスタに読み出すことができる読出し制御回路をさらに備えた、
ことを特徴とするレジスタ制御回路。
The register control circuit according to claim 1,
An output data holding register that holds output data for the data bus size Y, and a read control signal generation circuit that generates a batch read access control signal using the output of the second register that can be controlled by the CPU. And further comprising a read control circuit capable of dividing the data value of the peripheral circuit register and reading it to the output data holding register.
A register control circuit.
JP2004062742A 2004-03-05 2004-03-05 Register control circuit Withdrawn JP2005250999A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2004062742A JP2005250999A (en) 2004-03-05 2004-03-05 Register control circuit

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2004062742A JP2005250999A (en) 2004-03-05 2004-03-05 Register control circuit

Publications (1)

Publication Number Publication Date
JP2005250999A true JP2005250999A (en) 2005-09-15

Family

ID=35031406

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2004062742A Withdrawn JP2005250999A (en) 2004-03-05 2004-03-05 Register control circuit

Country Status (1)

Country Link
JP (1) JP2005250999A (en)

Similar Documents

Publication Publication Date Title
JPH05274259A (en) Serial input interface circuit
JP3437802B2 (en) Clock control circuit and error correction circuit using the same
JP2005250999A (en) Register control circuit
JP2003067324A (en) Interface circuit
JP2806849B2 (en) Memory address controller
JP3744880B2 (en) Memory access circuit
JP3563223B2 (en) Register circuit
KR910006684Y1 (en) Cpu signal controlling circuit
JP2002024164A (en) Access controller
JP2004362262A (en) Semiconductor integrated circuit
JP5344634B2 (en) Semiconductor memory device and control method thereof
JP2001356960A (en) Write control device, its method and recording medium
JP2697772B2 (en) Information processing device
JP2008026559A (en) Liquid crystal display driver and liquid crystal display device loading the same
JPH0256047A (en) Direct memory access controller
JPH05334099A (en) Write circuit for state setting register
JPH02178745A (en) Single chip microcomputer
JPH0675902A (en) Dma transfer circuit
JP2006164119A (en) Data processing unit
JP2003085124A (en) Integrated circuit device having circuit for reading out data of internal register in response to readout signal from external part and system having this device
JP2004021750A (en) Bus control device and bus control method
JPH04157526A (en) Register circuit
JPH04241622A (en) Microprocessor
JP2004348225A (en) Data transfer circuit and data transfer method and data processor
JPH0744399A (en) Interruption control circuit

Legal Events

Date Code Title Description
A621 Written request for application examination

Effective date: 20070227

Free format text: JAPANESE INTERMEDIATE CODE: A621

A761 Written withdrawal of application

Effective date: 20070731

Free format text: JAPANESE INTERMEDIATE CODE: A761