JPH0969728A - Semiconductor device - Google Patents

Semiconductor device

Info

Publication number
JPH0969728A
JPH0969728A JP22542795A JP22542795A JPH0969728A JP H0969728 A JPH0969728 A JP H0969728A JP 22542795 A JP22542795 A JP 22542795A JP 22542795 A JP22542795 A JP 22542795A JP H0969728 A JPH0969728 A JP H0969728A
Authority
JP
Japan
Prior art keywords
counter
correction
frequency
clock
sine wave
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.)
Pending
Application number
JP22542795A
Other languages
Japanese (ja)
Inventor
Hiroki Hachiman
広樹 八幡
Masao Mio
雅夫 三尾
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.)
Mitsubishi Electric Corp
Original Assignee
Mitsubishi Electric Corp
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 Mitsubishi Electric Corp filed Critical Mitsubishi Electric Corp
Priority to JP22542795A priority Critical patent/JPH0969728A/en
Publication of JPH0969728A publication Critical patent/JPH0969728A/en
Pending legal-status Critical Current

Links

Abstract

PROBLEM TO BE SOLVED: To generate a pseudo sine wave by improving the working efficiency of a CPU which is free from limitation of the clock frequency used for reading of the sine waveform data and also corrects and controls the frequency of the generated pseudo sine wave. SOLUTION: A semiconductor device consists of a sine waveform output ROM 2 which inputs the overflow signal OF of a dividing counter 1 that counts the reference clocks CLK, a D/A converter 3 which converts the data read out of the ROM 2 into the analog signals, a 1st (2nd) correction counter 5 (6) which inputs the overflow signal OF via a switch circuit S1 (S2), and an interruption signal generation circuit 7 which inputs the overflow signals OF1 and OF2 , of the counter 6, and a CPU 8 which rewrites the count value of the counter 1 by means of an interruption signal.

Description

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

【0001】[0001]

【発明の属する技術分野】本発明は擬似正弦波を発生す
る半導体装置に関するものである。
BACKGROUND OF THE INVENTION 1. Field of the Invention The present invention relates to a semiconductor device that generates a pseudo sine wave.

【0002】[0002]

【従来の技術】無線機によく使われるCTCSS(Conti
nuous Tone-Controlled Squelch System) は音声周波数
帯の正弦波を出力する機能がある。図6はこのCTCSS に
必要な擬似正弦波を発生するマイクロコンピュータの要
部のブロック図であって、分周カウンタ1、正弦波形出
力用ROM 2及び正弦波形出力用ROM 2から読み出した正
弦波形データをディジタル/アナログ変換するディジタ
ル/アナログ変換器3を備えている。
2. Description of the Related Art CTCSS (Conti
nuous Tone-Controlled Squelch System) has the function of outputting a sine wave in the audio frequency band. FIG. 6 is a block diagram of the main part of the microcomputer that generates the pseudo sine wave required for this CTCSS. The sine waveform data read from the frequency division counter 1, sine waveform output ROM 2 and sine waveform output ROM 2 is shown in FIG. Is provided with a digital / analog converter 3 for performing digital / analog conversion.

【0003】このマイクロコンピュータは、図示しない
発振回路で発生させた例えば外部から入力されたメイン
クロックを2分周した基準クロック CLKを分周カウンタ
1がカウントする。分周カウンタ1が所定数をカウント
するとオーバフロー信号OFを出力し、分周カウンタ1に
備えるリロードラッチに所定値が再びリロードされる。
リロードされる所定値は目標とする擬似正弦波のトーン
周波数 (規格周波数)に応じて、分周カウンタ1がカウ
ントする以前に、ソフトウエアあるいはハードウエアに
より分周カウンタ1に書き込まれる。
In this microcomputer, a frequency dividing counter 1 counts a reference clock CLK generated by an oscillation circuit (not shown), which is obtained by dividing a main clock input from the outside by two, for example. When the frequency division counter 1 counts a predetermined number, it outputs an overflow signal OF, and the reload latch provided in the frequency division counter 1 is reloaded with a predetermined value.
The predetermined value to be reloaded is written in the frequency division counter 1 by software or hardware before the frequency division counter 1 counts according to the target tone frequency (standard frequency) of the pseudo sine wave.

【0004】そして分周カウンタ1からオーバフロー信
号が出力される都度、正弦波形出力用ROM 2から正弦波
形データを順次読み出してディジタル/アナログ変換器
3へ入力し、ディジタル/アナログ変換器3は入力され
た正弦波形データをディジタル/アナログ変換して正弦
波形データに応じたアナログ値を順次出力し、擬似正弦
波を発生させる。
Whenever the overflow signal is output from the frequency dividing counter 1, the sine waveform data is sequentially read from the sine waveform output ROM 2 and input to the digital / analog converter 3, and the digital / analog converter 3 is input. The sine waveform data is digital-to-analog converted, and analog values corresponding to the sine waveform data are sequentially output to generate a pseudo sine wave.

【0005】そのため図7に示すように擬似正弦波SWの
波形は、分周カウンタ1が所定時間内に出力するオーバ
フロー信号OFの出力回数で分割された正弦波形データに
よって得られる。このようにディジタル/アナログ変換
器3からアナログ値を出力させているため、その出力回
数が整数倍であり、周波数の精度に限界があり、特に基
準クロックの周波数が低い場合は、擬似正弦波を得るた
めの1つの時間幅が長くなって規格周波数に対して周波
数が大きくズレる。
Therefore, as shown in FIG. 7, the waveform of the pseudo sine wave SW is obtained by the sine waveform data divided by the output frequency of the overflow signal OF output from the frequency division counter 1 within a predetermined time. Since the analog value is output from the digital / analog converter 3 in this way, the number of outputs is an integer multiple and the frequency accuracy is limited. Especially when the frequency of the reference clock is low, a pseudo sine wave is generated. The time width for obtaining one becomes long and the frequency largely deviates from the standard frequency.

【0006】そこで出力周波数を補正する手段が以前か
らよく用いられている。これらは発生させる擬似正弦波
の1周期を複数に分割している分割幅を交互に変える補
正の方法と、擬似正弦波のピーク位置で分割幅を変化さ
せる周波数補正の方法とがある。
Therefore, a means for correcting the output frequency has been frequently used. There are a correction method for alternately changing the division width that divides one cycle of the pseudo sine wave to be generated into a plurality, and a frequency correction method for changing the division width at the peak position of the pseudo sine wave.

【0007】[0007]

【発明が解決しようとする課題】しかし乍ら、このよう
な擬似正弦波の周波数を補正する手段では基準クロック
の周波数が限定される。また、前述したいずれの周波数
補正の方法においても、擬似正弦波の周波数の精度が問
題にならない程の高い周波数であっても、CPU は周波数
を補正する動作を実行し、CPU の負荷が大きく、CPU の
能率が悪いという問題がある。
However, the frequency of the reference clock is limited in such means for correcting the frequency of the pseudo sine wave. In addition, in any of the frequency correction methods described above, even if the frequency accuracy of the pseudo sine wave is high enough that the accuracy does not matter, the CPU executes the operation to correct the frequency and the CPU load is large. There is a problem of inefficient CPU.

【0008】本発明は斯かる問題に鑑み、基準クロック
の周波数が限定されず、しかも発生させる擬似正弦波の
周波数の補正を制御するCPU の能率を良くして擬似正弦
波を発生する半導体装置を提供することを目的とする。
In view of the above problems, the present invention provides a semiconductor device that generates a pseudo sine wave by improving the efficiency of the CPU that controls the correction of the frequency of the pseudo sine wave that is not limited to the frequency of the reference clock. The purpose is to provide.

【0009】[0009]

【課題を解決するための手段】本発明に係る半導体装置
は、第1クロックをカウントするカウンタの計数値に基
づく信号を入力すべき、カウンタ対象値が異なる第1補
正カウンタ及び第2補正カウンタと、該第1補正カウン
タ及び第2補正カウンタの計数値に応じて、第1補正カ
ウンタ及び第2補正カウンタが出力する信号を入力すべ
き信号発生回路と、前記第1クロックに関連する第2ク
ロックをカウントして、前記擬似正弦波の周波数の補正
の要否を指示する補正要否指示カウンタとを備えて、補
正要否指示カウンタが周波数の補正を要と指示した場合
に、信号発生回路の出力信号に基づいて、前記カウンタ
の計数対象値を補正する構成にする。
A semiconductor device according to the present invention is provided with a first correction counter and a second correction counter having different counter target values to which a signal based on the count value of a counter for counting a first clock should be input. A signal generating circuit to which a signal output from the first correction counter and the second correction counter should be input according to the count values of the first correction counter and the second correction counter, and a second clock related to the first clock And a correction necessity instruction counter for instructing the necessity of correcting the frequency of the pseudo sine wave, and when the correction necessity instruction counter indicates that the frequency correction is necessary, The counter value of the counter is corrected based on the output signal.

【0010】本発明では、第1クロックの計数値に基づ
いてROM から正弦波形データを読み出し、それをディジ
タル/アナログ変換して擬似正弦波を発生させる。補正
要否指示カウンタが第1クロックに関連する第2クロッ
クを所定数カウントして、第1クロックに関連する第2
クロックの周波数が高いことを検出し、擬似正弦波の周
波数補正否を指示する。第2クロックを所定数カウント
できないと、第2クロックの周波数が低いことを検出
し、擬似正弦波の周波数補正要を指示する。周波数補正
否を指示した場合、計数対象値が異なる第1, 第2補正
カウンタのカウント動作を禁止し、信号発生回路の出力
信号によりカウンタの計数対象値を書き換えない。
In the present invention, the sine waveform data is read from the ROM based on the count value of the first clock, and the digital / analog conversion is performed to generate the pseudo sine wave. The correction necessity instruction counter counts a predetermined number of second clocks related to the first clock and outputs a second clock related to the first clock.
It detects that the frequency of the clock is high, and instructs the frequency correction of the pseudo sine wave. If the second clock cannot be counted by a predetermined number, it is detected that the frequency of the second clock is low, and an instruction to correct the frequency of the pseudo sine wave is issued. When the frequency correction is instructed, the count operation of the first and second correction counters having different count target values is prohibited, and the count target value of the counter is not rewritten by the output signal of the signal generation circuit.

【0011】周波数の補正要を指示した場合、第1, 第
2補正カウンタをカウント動作させて、第1補正カウン
タの計数値に応じて第1補正カウンタが出力する信号
を、信号発生回路へ入力し、その出力信号に基づいてカ
ウンタの計数対象値を書き換える。また第2補正カウン
タの計数値に応じて第2補正カウンタが出力する信号を
信号発生回路へ入力し、その出力信号に基づいて、書き
換えたカウンタの計数対象値を元に戻す。このようなカ
ウンタの計数対象値の書き換えにより、発生させる擬似
正弦波の所定時間位置の時間幅が変わり、擬似正弦波の
周波数が変わる。これにより、擬似正弦波の周波数が低
いことを検出した場合には、擬似正弦波の周波数を補正
して、CPU の負荷が低減する。
When it is instructed to correct the frequency, the first and second correction counters are operated to count, and the signal output from the first correction counter is input to the signal generation circuit according to the count value of the first correction counter. Then, the count target value of the counter is rewritten based on the output signal. In addition, the signal output from the second correction counter is input to the signal generation circuit according to the count value of the second correction counter, and the rewritten counter target value is restored based on the output signal. By rewriting the count target value of such a counter, the time width of the generated pseudo sine wave at a predetermined time position changes, and the frequency of the pseudo sine wave changes. As a result, when it is detected that the frequency of the pseudo sine wave is low, the frequency of the pseudo sine wave is corrected and the load on the CPU is reduced.

【0012】[0012]

【発明の実施の形態】以下本発明を、発明の実施の形態
を示す図面とともに説明する。図1は本発明に係る半導
体装置の実施の形態を示すブロック図である。図示しな
いクロック発生器から出力される後述のメインクロック
INを2分周した基準クロック CLKは、リロードラッチ
を備える分周カウンタ1へ入力される。この基準クロッ
ク CLKを分周カウンタ1が所定値カウントしたとき出力
されるオーバフロー信号OFは正弦波形出力用ROM 2へ入
力される。正弦波形出力用ROM 2には、発生させる擬似
正弦波の周期を複数分割した各時間位置に対応する正弦
波形データが格納される。正弦波形出力用ROM 2から読
み出した正弦波形データはディジタル/アナログ変換器
(D/A 変換器) 3へ入力される。
BEST MODE FOR CARRYING OUT THE INVENTION The present invention will be described below with reference to the drawings showing the embodiments of the present invention. FIG. 1 is a block diagram showing an embodiment of a semiconductor device according to the present invention. A reference clock CLK generated by dividing a main clock X IN, which will be described later, output from a clock generator (not shown) by 2 is input to a frequency dividing counter 1 including a reload latch. The overflow signal OF output when the frequency dividing counter 1 counts a predetermined value of the reference clock CLK is input to the sine waveform output ROM 2. The sine waveform output ROM 2 stores the sine waveform data corresponding to each time position obtained by dividing the cycle of the pseudo sine wave to be generated. Sine waveform data read from ROM 2 for sine waveform output is digital / analog converter
(D / A converter) Input to 3.

【0013】分周カウンタ1が出力するオーバフロー信
号OFは、スイッチ回路S1を介してリロードラッチを備え
る第1補正カウンタ5へ入力され、またスイッチ回路S2
を介してリロードラッチを備える第2補正カウンタ6へ
入力される。第1補正カウンタ5が所定値をカウントし
たとき出力される第1オーバフロー信号OF1 及び第2補
正カウンタ6が所定値をカウントしたとき出力される第
2オーバフロー信号OF 2 は割り込み信号発生回路7へ入
力される。割り込み信号発生回路7が出力する割り込み
要求信号INT はCPU 8へ入力される。
Overflow signal output from the frequency division counter 1
No. OF has a reload latch via switch circuit S1
Is input to the first correction counter 5 and the switch circuit S2
To the second correction counter 6 having a reload latch via
Is entered. The first correction counter 5 counts a predetermined value
The first overflow signal OF that is output when1And the second supplement
Output when the positive counter 6 counts a predetermined value
2 Overflow signal OF 2Enters the interrupt signal generation circuit 7
Is forced. Interrupt output by the interrupt signal generation circuit 7
The request signal INT is input to the CPU 8.

【0014】スイッチ回路S1, S2は、後述する補正ビッ
トクリア信号CLR が“L”になった場合にオンし、
“H”になった場合にオフするようになっている。割り
込み信号発生回路7は、第1補正カウンタ5、第2補正
カウンタ6から出力される第1,第2オーバフロー信号O
F1 , OF2 が入力されると割り込み要求信号INT を出力
するようになっている。CPU 8は割り込み要求信号INT
に応じて所定の割り込み処理を行い、分周カウンタ1の
リロードラッチに所定値を書き込むようになっている。
The switch circuits S1 and S2 are turned on when a correction bit clear signal CLR to be described later becomes "L",
It turns off when it becomes "H". The interrupt signal generation circuit 7 is provided with the first and second overflow signals O output from the first correction counter 5 and the second correction counter 6.
When F 1 and OF 2 are input, the interrupt request signal INT is output. CPU 8 is an interrupt request signal INT
According to the above, a predetermined interrupt process is performed, and a predetermined value is written in the reload latch of the frequency division counter 1.

【0015】図2は周波数補正の要否を指示するための
周波数補正指示回路のブロック図である。最近のマイク
ロコンピュータは時計表示用のクロックを発生する回路
を備えるものが多いが、ここでは、通常32kHz の発振周
波数の時計用クロック CLKWを入力すべき時計用クロッ
ク入力端子9を備えている。時計用クロック入力端子9
に入力された時計用クロック CLKW は2分周回路10及び
周波数補正指示カウンタ12のトリガ端子TRへ入力され
る。マイクロコンピュータの駆動用クロックたるメイン
クロックXINを入力すべきメインクロック入力端子11に
入力されたメインクロックXINは周波数補正指示カウン
タ12へ入力される。
FIG. 2 is a block diagram of a frequency correction instruction circuit for instructing the necessity of frequency correction. Most of the recent microcomputers are provided with a circuit for generating a clock for clock display, but here, a microcomputer is provided with a clock clock input terminal 9 to which a clock clock CLK W having an oscillation frequency of 32 kHz should be input. Clock clock input terminal 9
The clock clock CLK W input to is input to the frequency divider circuit 10 and the trigger terminal TR of the frequency correction instruction counter 12. The main clock X IN input to the main clock input terminal 11 to which the main clock X IN, which is the driving clock of the microcomputer, should be input to the frequency correction instruction counter 12.

【0016】2分周回路10が出力する分周クロックはAN
D 回路13の一入力端子13a へ入力される。周波数補正指
示カウンタ12が出力するオーバフロー信号はラッチ回路
14へ入力され、ラッチ回路14のラッチデータはAND 回路
13の他入力端子13b へ入力される。AND 回路13から補正
ビットクリア信号CLR が出力される。そして周波数補正
指示カウンタ12は時計用クロック CLKW によりカウント
動作の開始, カウント動作の停止をするよう制御され、
時計用クロック CLKW がHレベルの期間内のメインクロ
ックXINをカウントする。ラッチ回路14は周波数補正指
示カウンタ12のオーバフロー信号OFC がHレベルになる
とラッチする。なお、時計用クロック CLKW とメインク
ロックXINとは図3に示すように同期したものとなって
いる。
The divided clock output from the divide-by-2 circuit 10 is AN
It is input to one input terminal 13a of the D circuit 13. The overflow signal output from the frequency correction instruction counter 12 is a latch circuit.
Latch data of the latch circuit 14 is input to the AND circuit.
Input to 13 other input terminal 13b. The correction bit clear signal CLR is output from the AND circuit 13. Then, the frequency correction instruction counter 12 is controlled by the clock for clock CLK W to start and stop the counting operation,
The main clock X IN within the period when the clock clock CLK W is at H level is counted. The latch circuit 14 latches when the overflow signal OF C of the frequency correction instruction counter 12 becomes H level. The clock clock CLK W and the main clock X IN are synchronized as shown in FIG.

【0017】図3は時計用クロック CLKW 及びメインク
ロックXINのタイミングチャートであり、横軸を時間と
し、縦軸を信号レベルとしている。図4は2分周回路10
が出力する分周クロック、メインクロックXIN及びオー
バフロー信号OFC のタイミングチャートである。図4
(a) に示す分周クロックがHレベルの期間A即ち、時計
用クロック CLKWの周波数に対して図4(b) に示すメイ
ンクロックXINの周波数が高い場合は、図4(c) に示す
ように分周クロックがHレベルにある期間A内に、周波
数補正指示カウンタ12からオーバフロー信号OFC が出力
される。
FIG. 3 is a timing chart of the clock clock CLK W and the main clock X IN , where the horizontal axis represents time and the vertical axis represents signal level. FIG. 4 shows a divide-by-2 circuit 10.
6 is a timing chart of the divided clock, the main clock X IN, and the overflow signal OF C output by the above. FIG.
When the frequency of the main clock X IN shown in FIG. 4 (b) is higher than the frequency A of the divided clock shown in (a) at the H level, that is, the frequency of the clock clock CLK W , it is shown in FIG. 4 (c). As shown, the frequency correction instruction counter 12 outputs the overflow signal OF C within the period A in which the divided clock is at the H level.

【0018】一方、メインクロックXINの周波数が低い
場合は図4(d) に示すように、分周クロックがHレベル
にある期間A内に周波数補正指示カウンタ12からオーバ
フロー信号OFC が出力されない。それにより、メインク
ロックXINの周波数が高いか否かが判別できる。
On the other hand, when the frequency of the main clock X IN is low, as shown in FIG. 4 (d), the overflow signal OF C is not output from the frequency correction instruction counter 12 within the period A in which the divided clock is at the H level. . Thereby, it can be determined whether or not the frequency of the main clock X IN is high.

【0019】ここで、周波数補正指示カウンタ12のカウ
ント値nを予め例えば“81”に設定しておく。このカウ
ント値nの設定はマイクロコンピュータの出荷時にハー
ドウエアあるいはソフトウエアで設定する。2分周回路
10から出力される分周クロックの半周期は 1/32kHz =
31.25 μsec である。ここでマイクロコンピュータに入
力されるメインクロックXINの周波数が例えば2.6MHz以
上とすると、カウント値nが“81”であるから、81/2.
6MHz=31.15 μsec である期間A内で、周波数補正指示
カウンタ12からオーバフロー信号OFC が出力される。
Here, the count value n of the frequency correction instruction counter 12 is set in advance to, for example, "81". The count value n is set by hardware or software when the microcomputer is shipped. Divide by 2 circuit
Half cycle of divided clock output from 10 is 1 / 32kHz =
It is 31.25 μsec. Here, if the frequency of the main clock X IN input to the microcomputer is, for example, 2.6 MHz or more, the count value n is "81", so 81/2.
Within the period A of 6 MHz = 31.15 μsec, the frequency correction instruction counter 12 outputs the overflow signal OF C.

【0020】このとき、ラッチ回路14は、これをラッチ
し、AND 回路13から出力される補正ビットクリア信号CL
R がHレベルになり、マイクロコンピュータに内蔵した
レジスタ (図示せず) の補正要ビット (図示せず) がク
リアされる。続いて、2分周回路10から出力される2分
周クロックがLレベルになると、その後は周波数補正指
示カウンタ12はカウント動作を停止する。
At this time, the latch circuit 14 latches this and outputs the correction bit clear signal CL output from the AND circuit 13.
R becomes H level, and the correction required bit (not shown) of the register (not shown) built in the microcomputer is cleared. Then, when the divide-by-2 clock output from the divide-by-2 circuit 10 becomes L level, the frequency correction instruction counter 12 thereafter stops the counting operation.

【0021】一方、マイクロコンピュータへ入力される
メインクロックXINが2.5MHz以下の場合は81/2.5MHz=
32.4μsec であるため期間A内でオーバフロー信号OFC
が発生せず、補正ビットクリア信号CLR がHレベルにな
らない。このようにしてメインクロックXINの周波数が
規定周波数より高いか、低いかが検出できる。
On the other hand, when the main clock X IN input to the microcomputer is 2.5 MHz or less, 81 / 2.5 MHz =
Since it is 32.4 μsec, overflow signal OF C
Does not occur and the correction bit clear signal CLR does not go to H level. In this way, it is possible to detect whether the frequency of the main clock X IN is higher or lower than the specified frequency.

【0022】次にこのように構成したマイクロコンピュ
ータの動作を説明する。メインクロック入力端子11に入
力されるメインクロックが2.5MHz以下の場合を考える
と、補正ビットクリア信号CLR が“L”であり、図示し
ないレジスタの補正要ビットがクリアされておらず有効
状態にある。第1補正カウンタ5の初期設定値を“1
4”、第2補正カウンタ6の初期設定値を“15”に設定
しておき、第1補正カウンタ5及び第2補正カウンタ6
のリロードラッチの値をともに“32”に設定しておく。
Next, the operation of the microcomputer thus configured will be described. Considering the case where the main clock input to the main clock input terminal 11 is 2.5 MHz or less, the correction bit clear signal CLR is “L” and the correction required bit of the register (not shown) is not cleared and is in the valid state. . Set the initial setting value of the first correction counter 5 to "1.
4 ", the initial setting value of the second correction counter 6 is set to" 15 ", and the first correction counter 5 and the second correction counter 6 are set.
Set both reload latch values of to “32”.

【0023】さて、第1補正カウンタ5が14回カウント
するとオーバフロー信号OF1 を出力し、これが割り込み
信号発生回路7へ入力される。そしてCPU 8が割り込み
要求信号INT を受取ると、第1の割り込み処理を実行
し、分周カウンタ1のリロードラッチの値を補正値に書
き換える。このときリロードラッチの値“32”が第1補
正カウンタ5にリロードされる。
Now, when the first correction counter 5 counts 14 times, it outputs an overflow signal OF 1 , which is input to the interrupt signal generation circuit 7. When the CPU 8 receives the interrupt request signal INT, it executes the first interrupt process and rewrites the reload latch value of the frequency division counter 1 with the correction value. At this time, the value “32” of the reload latch is reloaded into the first correction counter 5.

【0024】また、第2補正カウンタ6が15回カウント
するとオーバフロー信号OF2 を出力し、これが割り込み
信号発生回路7に入力される。そしてCPU 8が割り込み
要求信号を受取ると、第2の割り込み処理を実行し、分
周カウンタ1のラッチの値を元の値に書き換える。この
ときリロードラッチの値“32”が第2補正カウンタ6に
リロードされる。
When the second correction counter 6 counts 15 times, it outputs an overflow signal OF 2 , which is input to the interrupt signal generation circuit 7. When the CPU 8 receives the interrupt request signal, it executes the second interrupt process and rewrites the latch value of the frequency division counter 1 to the original value. At this time, the value “32” of the reload latch is reloaded to the second correction counter 6.

【0025】以後、分周カウンタ1から32回のオーバフ
ロー信号OFが出力されるごとに、CPU 8は前述した第1
の割り込み処理及び第2の割り込み処理を繰り返して正
弦波の周期を補正する処理を実行する。そして、メイン
クロックXINの周波数が2.6MHz以上の場合は、補正ビッ
トクリア信号CLR がHレベルになっており、補正要ビッ
トがクリアされて、スイッチ回路S1, S2がともにオフし
て、擬似正弦波の周波数の補正が実行されずCPU 8は補
正動作に無関係となる。
Thereafter, every time the frequency division counter 1 outputs the overflow signal OF 32 times, the CPU 8 causes the CPU 8 to perform the above-mentioned first operation.
And the second interrupt process are repeated to execute the process of correcting the cycle of the sine wave. When the frequency of the main clock X IN is 2.6 MHz or higher, the correction bit clear signal CLR is at the H level, the correction required bit is cleared, both the switch circuits S1 and S2 are turned off, and the pseudo sine The correction of the wave frequency is not executed and the CPU 8 becomes irrelevant to the correction operation.

【0026】またこのとき、第1補正カウンタ5及び第
2補正カウンタ6は、他のカウント目的のカウンタとし
て利用が可能であり、換言すれば擬似正弦波の周波数を
補正するCPU の負荷が低減することになる。そして、前
述した動作により図5に示すように、発生させた擬似正
弦波SWは、第1補正カウンタ5のカウント値及び第2補
正カウンタ6のカウント値がオーバフローした15カウン
ト目及び15+32カウント目で、擬似正弦波の周期を複数
に分割した1つの時間幅が制御されて、擬似正弦波の周
波数が制御され規格周波数から逸脱しない。
At this time, the first correction counter 5 and the second correction counter 6 can be used as counters for other counting purposes, in other words, the load on the CPU for correcting the frequency of the pseudo sine wave is reduced. It will be. Then, as shown in FIG. 5 by the above-described operation, the generated pseudo sine wave SW is generated at the 15th count and the 15 + 32th count at which the count value of the first correction counter 5 and the count value of the second correction counter 6 overflow. , The time width obtained by dividing the period of the pseudo sine wave into a plurality of times is controlled, and the frequency of the pseudo sine wave is controlled so as not to deviate from the standard frequency.

【0027】また、このような周波数の補正ができるか
ら、マイクロコンピュータに入力されるメインクロック
の周波数が異なった場合、つまり発振回路の発振子の周
波数が異なっている場合であっても、マイクロコンピュ
ータは規格周波数の擬似正弦波を発生することができ
る。なお、本実施例ではマイクロコンピュータについて
説明したが、マイクロコンピュータに限定されるもので
はなく、半導体装置にも同様に適用して同様の効果が得
られる。
Further, since the frequency can be corrected in this way, even if the frequency of the main clock input to the microcomputer is different, that is, even if the frequency of the oscillator of the oscillator circuit is different, Can generate a pseudo-sine wave with a standard frequency. It should be noted that although the microcomputer has been described in this embodiment, the invention is not limited to the microcomputer, and the same effects can be obtained by applying the same to a semiconductor device.

【0028】[0028]

【発明の効果】以上詳述したように本発明の半導体装置
は、第1クロックに関連する第2クロックの周波数が低
い場合には、擬似正弦波の周波数の補正を実行し、第2
クロックの周波数が高い場合は擬似正弦波の周波数の補
正を実行しないようにしたので、第2クロックの周波数
が異なっても規格周波数に近い周波数の擬似正弦波を発
生させることができる。また第2クロックの周波数が低
い場合のみ擬似正弦波の周波数をCPU により補正制御す
るから、周波数を制御する場合においてCPU の負荷が低
減する等、本発明は優れた効果を奏する。
As described above in detail, the semiconductor device of the present invention executes the correction of the frequency of the pseudo sine wave when the frequency of the second clock related to the first clock is low,
Since the correction of the frequency of the pseudo sine wave is not executed when the frequency of the clock is high, the pseudo sine wave having a frequency close to the standard frequency can be generated even if the frequency of the second clock is different. Moreover, since the frequency of the pseudo sine wave is corrected and controlled by the CPU only when the frequency of the second clock is low, the present invention has an excellent effect such that the load on the CPU is reduced when the frequency is controlled.

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

【図1】 本発明に係る半導体装置の要部構成を示すブ
ロック図である。
FIG. 1 is a block diagram showing a main configuration of a semiconductor device according to the present invention.

【図2】 周波数補正要否指示回路のブロック図であ
る。
FIG. 2 is a block diagram of a frequency correction necessity instruction circuit.

【図3】 時計用クロック、メインクロックのタイミン
グチャートである。
FIG. 3 is a timing chart of a clock clock and a main clock.

【図4】 各クロック及びオーバフロー信号のタイミン
グチャートである。
FIG. 4 is a timing chart of each clock and overflow signal.

【図5】 発生させた擬似正弦波の波形図である。FIG. 5 is a waveform diagram of a generated pseudo sine wave.

【図6】 従来のマイクロコンピュータの要部を示すブ
ロック図である。
FIG. 6 is a block diagram showing a main part of a conventional microcomputer.

【図7】 発生した擬似正弦波の波形図である。FIG. 7 is a waveform diagram of a generated pseudo sine wave.

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

1 分周カウンタ、2 正弦波形出力用ROM 、3 ディ
ジタル/アナログ変換器、7 割り込み信号発生回路、
8 CPU 、9 時計用クロック入力端子、10 2分周回
路、11 メインクロック入力端子、12 周波数補正指示
カウンタ、13 AND 回路、14 ラッチ回路。
1 divider counter, 2 sine waveform output ROM, 3 digital / analog converter, 7 interrupt signal generation circuit,
8 CPU, 9 clock clock input terminal, 10 2 frequency divider circuit, 11 main clock input terminal, 12 frequency correction instruction counter, 13 AND circuit, 14 latch circuit.

Claims (1)

【特許請求の範囲】[Claims] 【請求項1】 第1クロックをカウントするカウンタの
計数値に基づいて、正弦波形データを格納してあるROM
から正弦波形データを読み出し、該ROM から読み出した
正弦波形データをディジタル/アナログ変換して擬似正
弦波を発生する半導体装置において、 前記係数値に基づく信号を入力すべき、計数対象値が異
なる第1補正カウンタ及び第2補正カウンタと、該第1
補正カウンタ及び第2補正カウンタの計数値に応じて第
1補正カウンタ及び第2補正カウンタが出力する信号を
入力すべき信号発生回路と、前記第1クロックに関連す
る第2クロックをカウントして前記擬似正弦波の周波数
の補正の要否を指示する補正要否指示カウンタとを備
え、該補正要否指示カウンタが前記周波数の補正を要と
指示した場合に、前記信号発生回路の出力信号に基づい
て、前記カウンタの計数対象値を補正すべく構成してあ
ることを特徴とする半導体装置。
1. A ROM storing sinusoidal waveform data based on a count value of a counter that counts a first clock.
In a semiconductor device which reads out sine waveform data from a ROM and digital-analog converts the sine waveform data read out from the ROM to generate a pseudo sine wave, a signal based on the coefficient value should be input. A correction counter and a second correction counter, and the first
A signal generating circuit to which a signal output from the first correction counter and the second correction counter should be input according to the count values of the correction counter and the second correction counter, and a second clock related to the first clock, A correction necessity instruction counter for instructing whether or not the frequency of the pseudo sine wave should be corrected, and based on the output signal of the signal generating circuit when the correction necessity instruction counter indicates that the frequency correction is required. And a semiconductor device configured to correct the count target value of the counter.
JP22542795A 1995-09-01 1995-09-01 Semiconductor device Pending JPH0969728A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP22542795A JPH0969728A (en) 1995-09-01 1995-09-01 Semiconductor device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP22542795A JPH0969728A (en) 1995-09-01 1995-09-01 Semiconductor device

Publications (1)

Publication Number Publication Date
JPH0969728A true JPH0969728A (en) 1997-03-11

Family

ID=16829205

Family Applications (1)

Application Number Title Priority Date Filing Date
JP22542795A Pending JPH0969728A (en) 1995-09-01 1995-09-01 Semiconductor device

Country Status (1)

Country Link
JP (1) JPH0969728A (en)

Similar Documents

Publication Publication Date Title
US20090180358A1 (en) Frequency corrector and clocking apparatus using the same
JPS60254097A (en) Distorted waveform generator
JPH0969728A (en) Semiconductor device
US20030227335A1 (en) Clock modulating circuit
JPH1198007A (en) Frequency divider
JP3536426B2 (en) Waveform generator
JP2893753B2 (en) Pulse width modulation inverter controller
SU571891A1 (en) Delay circuit
SU1277035A1 (en) Program device for controlling source of seismic signals
JPS6312424B2 (en)
JPH11220384A (en) Frequency generator
US5193221A (en) Signal output apparatus
SU1614095A2 (en) Infralow frequency signal generator
JP2572448B2 (en) Square wave signal generator
JPH06180617A (en) Time correcting device for computer
SU661836A1 (en) Cycle synchronization device
JPS601983B2 (en) Frequency divider circuit
SU1401554A1 (en) Multifrequency signal shaper
JP2775733B2 (en) Digital waveform signal generator
JPS60134774A (en) Inverter controller
RU1795540C (en) Device for shaping instruction sequence
SU1418897A1 (en) Device for stabilizing the frequency of voltage-controlled generator
JPH06109813A (en) Timing generator
JP2000236267A (en) Remote-control carrier generating circuit
JPH0720584U (en) AFC circuit for weather radar