JPH0514950B2 - - Google Patents
Info
- Publication number
- JPH0514950B2 JPH0514950B2 JP60160736A JP16073685A JPH0514950B2 JP H0514950 B2 JPH0514950 B2 JP H0514950B2 JP 60160736 A JP60160736 A JP 60160736A JP 16073685 A JP16073685 A JP 16073685A JP H0514950 B2 JPH0514950 B2 JP H0514950B2
- Authority
- JP
- Japan
- Prior art keywords
- tone
- data
- address
- rom
- signal
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Expired - Lifetime
Links
- 230000007274 generation of a signal involved in cell-cell signaling Effects 0.000 claims description 9
- 238000000034 method Methods 0.000 claims description 5
- 230000004044 response Effects 0.000 claims description 2
- 238000010586 diagram Methods 0.000 description 4
- 230000000694 effects Effects 0.000 description 2
- 101000622427 Homo sapiens Vang-like protein 1 Proteins 0.000 description 1
- 101000622430 Homo sapiens Vang-like protein 2 Proteins 0.000 description 1
- 102100023517 Vang-like protein 1 Human genes 0.000 description 1
- 102100023520 Vang-like protein 2 Human genes 0.000 description 1
- 239000013256 coordination polymer Substances 0.000 description 1
Landscapes
- Microcomputers (AREA)
Description
【発明の詳細な説明】
(イ) 産業上の利用分野
本発明は、ブザー音やメロデイを出力すること
のできるトーンジエネレータを内蔵したマイクロ
コンピユータのトーン信号発生方法に関する。DETAILED DESCRIPTION OF THE INVENTION (a) Field of Industrial Application The present invention relates to a tone signal generation method for a microcomputer that includes a built-in tone generator capable of outputting a buzzer sound or a melody.
(ロ) 従来の技術
一般に、汎用マイクロコンピユータにはトーン
ジエネレータが内蔵されていないのが普通である
が、この汎用マイクロコンピユータを用いてメロ
デイ等を発生させる場合には、発生すべきトーン
の周波数となるように出力端子の出力信号を出力
命令によつて操作し、また、トーンの出力時間も
プログラムによつて作成していた。従つて、メロ
デイ等を発生させるプログラムは、ステツプ数が
増大し、他のプログラムのステツプ数が制限を受
ける不都合があつた。(b) Prior art Generally, general-purpose microcomputers do not have built-in tone generators, but when using this general-purpose microcomputer to generate melodies, etc., the frequency of the tone to be generated is The output signal of the output terminal was manipulated by an output command so that the tone output time was also created by a program. Therefore, a program that generates a melody or the like has an increased number of steps, and the number of steps of other programs is inconveniently limited.
そこで、昭和56年9月21日に発行された
「NEC電子デイバイス新製品速報μPD6651P」に
記載された如く、トーンジエネレータを内蔵した
マイクロコンピユータが開発された。トーンジエ
ネレータは基本周波数を特定の値まで分周して所
定の音程のトーン信号を作成し、更に、作成され
たトーン信号を出力する時間をカウンタで作成し
ている。また、トーン信号の音程を決定する分周
比及びトーン信号を出力する時間は、命令のオペ
ランドのデータによつて設定される。 Therefore, a microcomputer with a built-in tone generator was developed, as described in "NEC Electronic Device New Product Bulletin μPD6651P" published on September 21, 1981. The tone generator divides the fundamental frequency to a specific value to create a tone signal of a predetermined pitch, and also uses a counter to create a time for outputting the created tone signal. Further, the frequency division ratio that determines the pitch of the tone signal and the time for outputting the tone signal are set by the operand data of the command.
(ハ) 発明が解決しようとする問題点
ところが、従来のトーンジエネレータ内蔵のマ
イクロコンピユータでは、メロデイのひとつひと
つの音の順番、音程及び発生時間を通常のプログ
ラムで処理する必要があり、ひとつの音を発生さ
せるための命令でトーンジエネレータにトーンデ
ータを送出するため、命令のオペランドに書き込
まれるトーンデータが各々異なり、プログラム作
成が複雑となる。更に、メロデイが長くなればプ
ログラムステツプ数も長くなる欠点があつた。(c) Problems to be solved by the invention However, in the conventional microcomputer with a built-in tone generator, it is necessary to process the order, pitch, and occurrence time of each note of a melody using a normal program. Since tone data is sent to the tone generator with a command to generate a tone generator, the tone data written to each operand of the command is different, making programming complicated. Another drawback was that the longer the melody, the longer the number of program steps.
(ニ) 問題点を解決するための手段
本発明は上述した点に鑑みて為されたものであ
り、通常のプログラム実行中のトーン信号発生要
求に従つて、メロデイ等を構成する各々の音のト
ーンデータが固定的に記憶されたメモリ
(ROM)のテーブル領域の所定アドレスを指示
するアドレスデータをデータメモリ(RAM)の
特定アドレスに記憶し、所定のサブルーチンによ
り前記データメモリ(RAM)の特定アドレスを
指示することによつて前記トーンデータがトーン
データレジスタに転送され、各トーン信号の発生
終了を示す信号に基いて割込み処理を実行し、該
割込み処理に於いて前記所定のサブルーチンを実
行することにより各々のトーン信号が連続して発
生されるものである。(d) Means for Solving the Problems The present invention has been made in view of the above-mentioned points, and it is possible to generate each tone of a melody, etc. in accordance with a tone signal generation request during normal program execution. Address data indicating a predetermined address of a table area of a memory (ROM) in which tone data is fixedly stored is stored at a specific address of a data memory (RAM), and a predetermined subroutine is used to read address data indicating a predetermined address of a table area of a memory (ROM). The tone data is transferred to the tone data register by instructing, the interrupt processing is executed based on a signal indicating the end of generation of each tone signal, and the predetermined subroutine is executed in the interrupt processing. Each tone signal is generated successively.
(ホ) 作用
上述の方法によれば、データメモリ(RAM)
の特定アドレスにメロデイ等のトーンデータの記
憶されたテーブル領域の所定アドレスを記憶させ
ておき、その後、所定のサブルーチンプログラム
によつてデータメモリ(RAM)の特定アドレス
を指定し所定命令(テーブル参照命令)を実行す
ることにより、メモリ(ROM)のテーブル領域
に記憶されたトーンデータがトーンデータレジス
タに転送される。また、所定のサブルーチンプロ
グラムでは、次のテーブル領域のアドレスを指定
するためにデータメモリ(RAM)の特定アドレ
スに記憶されたアドレスデータに+1を加算して
おく。そして、トーン信号の発生終了を示す信号
で実行される割込み処理に於いて所定のサブルー
チンプログラムが実行され、次のトーン信号の音
程及び長さを示すトーンデータがトーンデータレ
ジスタに転送される。(e) Effect According to the above method, data memory (RAM)
A predetermined address of a table area in which tone data such as a melody is stored is stored in a predetermined address, and then a predetermined subroutine program specifies a specific address in the data memory (RAM) and executes a predetermined command (table reference command). ), the tone data stored in the table area of the memory (ROM) is transferred to the tone data register. Further, in a predetermined subroutine program, +1 is added to the address data stored at a specific address in the data memory (RAM) in order to specify the address of the next table area. Then, a predetermined subroutine program is executed in an interrupt process executed in response to a signal indicating the end of tone signal generation, and tone data indicating the pitch and length of the next tone signal is transferred to the tone data register.
(ヘ) 実施例
第1図は本発明に拘わるマイクロコンピユータ
のブロツク図である。1,2はカウンタ、3,4
はROM、5はパルス発生回路、6はトーンデー
タレジスタであり、これらはトーンジエネレータ
を構成している。トーンデータレジスタ6は8ビ
ツトで構成され、下位4ビツトはトーン信号の周
波数を指示する周波数指定データを記憶し、上位
4ビツトはトーン信号を出力する時間を指示する
時間指定データを記憶する。ROM3はトーンデ
ータレジスタ6の下位4ビツト出力、即ち、周波
数指定データを入力し、そのデータで指示される
周波数を作成するために、カウンタ1で計数され
る数値を作成するものである。カウンタ1はダウ
ンカウンタで構成され、ROM3から印加された
数値を基準周波数CL1に基いて計数し、計数が
終了するとその出力を発生する。パルス発生回路
5はカウンタ1の計数終了時に出力される信号に
よりパルスを発生し、ORゲート7を介してカウ
ンタ1に印加し、カウンタ1へ再びROM3から
の数値をセツトさせ計数を再開させる。従つて、
カウンタ1がROM3で作成された数値を基準周
波数DL1に基いて繰り返えし計数することによ
り、周波数指定データによつて指定された周波数
のトーン信号が作成される。即ち、ROM3、カ
ウンタ1、パルス発生回路5及びORゲート7は
トーン信号発生回路を形成している。(F) Embodiment FIG. 1 is a block diagram of a microcomputer according to the present invention. 1 and 2 are counters, 3 and 4
5 is a ROM, 5 is a pulse generation circuit, and 6 is a tone data register, which constitute a tone generator. The tone data register 6 is composed of 8 bits, the lower 4 bits store frequency designation data that designates the frequency of the tone signal, and the higher 4 bits store time designation data that designates the time to output the tone signal. The ROM 3 receives the output of the lower 4 bits of the tone data register 6, that is, the frequency designation data, and creates a numerical value counted by the counter 1 in order to create the frequency designated by the data. The counter 1 is composed of a down counter, counts the numerical value applied from the ROM 3 based on the reference frequency CL1, and generates an output when the counting is completed. The pulse generating circuit 5 generates a pulse based on the signal outputted when the counter 1 finishes counting, and applies it to the counter 1 via the OR gate 7, causing the counter 1 to set the value from the ROM 3 again and restart counting. Therefore,
When the counter 1 repeatedly counts the numerical value created in the ROM 3 based on the reference frequency DL1, a tone signal of the frequency designated by the frequency designation data is created. That is, the ROM 3, counter 1, pulse generation circuit 5, and OR gate 7 form a tone signal generation circuit.
一方、カウンタ2及びROM4は、トーン時間
発生回路を形成しており、ROM4はトーンデー
タレジスタ6の上位4ビツト出力、即ち、時間指
定データを入力し、カウンタ2で計数される数値
を作成する。カウンタ2はダウンカウンタで形成
され、ROM4から印加された数値を基準周波数
CL2に基いて計数することにより、計数開始か
ら計数終了までの時間中、その出力によつて
ANDゲート8を制御しカウンタ1から出力され
るトーン信号を外部に出力する。即ち、トーン信
号の発生時間を決定するものである。 On the other hand, the counter 2 and the ROM 4 form a tone time generation circuit, and the ROM 4 inputs the upper 4 bits output of the tone data register 6, that is, time designation data, and creates a numerical value counted by the counter 2. Counter 2 is formed by a down counter, and uses the value applied from ROM 4 as a reference frequency.
By counting based on CL2, the output during the time from the start of counting to the end of counting
It controls the AND gate 8 and outputs the tone signal output from the counter 1 to the outside. That is, it determines the generation time of the tone signal.
コントロール回路9は、インストラクシヨンデ
コーダ10からの出力、及び、タイミングジエネ
レータ11からのタイミング信号に基いて、マイ
クロコンピユータ内部の動作を制御するものであ
り、カウンタ2の出力が印加された割込み制御回
路12を内蔵している。タイミングジエネレータ
11はマイクロコンピユータの動作に必要なタイ
ミング信号を基準クロツクパルスCPに基いて発
生するものであり、1マシンサイクルはT1,T2,
T3、及び、T4の基本的な4つのタイミングから
成る。インストラクシヨンデコーダ10は、
ROM13から読み出された実行すべき命令コー
ドを記憶するインストラクシヨンレジスタ14の
出力、即ち、命令コードを入力して、その命令が
何であるかを解読するものであり、コントロール
回路9が発生すべき制御信号を指示する。 The control circuit 9 controls the internal operation of the microcomputer based on the output from the instruction decoder 10 and the timing signal from the timing generator 11, and performs interrupt control to which the output from the counter 2 is applied. It has a built-in circuit 12. The timing generator 11 generates timing signals necessary for the operation of the microcomputer based on the reference clock pulse CP, and one machine cycle consists of T 1 , T 2 ,
It consists of four basic timings: T 3 and T 4 . The instruction decoder 10 is
The output of the instruction register 14 which stores the instruction code to be executed read from the ROM 13, that is, the instruction code is input and the control circuit 9 decodes the instruction. Indicates the control signal to be used.
ROM13は、命令コードの集合から成るプロ
グラムが固定的に記憶されるプログラム領域15
と、メロデイを構成する各々の音の音程及び長さ
を指示するトーンデータが記憶されるテーブル領
域16とを有しており、ROM15のアドレス入
力にはマルチプレクサ17の出力が接続される。
マルチプレクサ17の入力にはプログラムカウン
タ18の出力が印加されると共に、データを一時
保持するアキユームレータ19の出力、及びデー
タポインタ20によつてアドレス指定される
RAM21の出力が印加される。マルチプレクサ
17は、通常プログラムカウンタ18の出力を
ROM13に印加してプログラムカウンタ18に
よるプログラム領域15のアドレス指定を可能と
し、このとき、読み出された命令コードはインス
トラクシヨンレジスタ14に送出され記憶され
る。また、マルチプレクサ17は、テーブル参照
命令(TML命令)が実行されたときコントロー
ル回路9から出力される制御信号TABLEによつ
て制御され、アキユームレータ19及びRAM2
1の出力をROM13に印加し、アキユームレー
タ19及びRAM21の出力によるテーブル領域
16のアドレス指定を可能とする。このとき、読
み出されたトーンデータはデータバス22に送出
されトーンデータレジスタ6に印加される。尚、
データバス22にROM13の他のアキユームレ
ータ19、RAM21、及び、データポインタ2
0の入出力が接続される。 The ROM 13 is a program area 15 in which a program consisting of a set of instruction codes is permanently stored.
and a table area 16 in which tone data indicating the pitch and length of each note constituting a melody is stored, and the output of a multiplexer 17 is connected to the address input of the ROM 15.
The output of the program counter 18 is applied to the input of the multiplexer 17 and is addressed by the output of the accumulator 19 that temporarily holds data and the data pointer 20.
The output of RAM21 is applied. The multiplexer 17 normally outputs the output of the program counter 18.
The instruction code is applied to the ROM 13 to enable the program counter 18 to specify the address of the program area 15, and at this time, the read instruction code is sent to the instruction register 14 and stored therein. Further, the multiplexer 17 is controlled by the control signal TABLE output from the control circuit 9 when a table reference instruction (TML instruction) is executed, and the multiplexer 17 is controlled by the control signal TABLE output from the control circuit 9.
1 is applied to the ROM 13, and the address of the table area 16 can be specified by the outputs of the accumulator 19 and RAM 21. At this time, the read tone data is sent to the data bus 22 and applied to the tone data register 6. still,
Other accumulator 19 of ROM 13, RAM 21, and data pointer 2 are connected to data bus 22.
0 input/output is connected.
第2図は、第1図に示されたROM13及び
RAM21のデータ割付け図の一例であり、
ROM13のテーブル領域16のアドレスAO(H)
からBF(H)までに一曲を構成するトーンデータが
記憶されており、最後のBF(H)には曲の終りを示
すデータ00(H)が記憶される。一方、RAM21の
アドレス00(H)及び01(H)は、ROM13のテーブル
領域16のアドレスを指定するアドレスデータが
記憶される領域として用いられ、RAM21のア
ドレス00(H)にはアドレスデータの下位4ビツトが
記憶され、アドレス01(H)にはアドレスデータの上
位4ビツトが記憶される。 FIG. 2 shows the ROM 13 and
This is an example of a data allocation diagram of RAM21,
Address AO(H) of table area 16 of ROM 13
Tone data constituting one song is stored from BF(H) to BF(H), and data 00(H) indicating the end of the song is stored in the last BF(H). On the other hand, addresses 00(H) and 01(H) of the RAM 21 are used as areas for storing address data specifying the address of the table area 16 of the ROM 13, and the address 00(H) of the RAM 21 is used as an area for storing address data specifying the address of the table area 16 of the ROM 13. Four bits are stored, and the upper four bits of address data are stored at address 01(H).
そこで、第2図の如く割付けられた場合に於け
る本発明の実施例を第3図及び第4図に示し、第
1図を参照して説明する。先ず、第3図に於い
て、通常のプログラムを実行中にメロデイの発生
要求があると、データポインタ操作命令によつて
データポインタ20に0(H)をセツトし、データポ
インタ20で指定されたRAM21のアドレス00
(H)にROM13のアドレスA0(H)の下位ビツト0(H)
を記憶させる。次に、データポインタ20に1(H)
をセツトし、データポインタ20で指定された
RAM21のアドレス01(H)にROM13のアドレ
スAO(H)の上位4ビツトA(H)を記憶させる。そし
て、ジヤンプ命令によつて第4図に示されるサブ
ルーチンに移行する。 Therefore, an embodiment of the present invention in the case where the layout is as shown in FIG. 2 is shown in FIGS. 3 and 4, and will be explained with reference to FIG. 1. First, in FIG. 3, when there is a request to generate a melody while a normal program is being executed, the data pointer 20 is set to 0 (H) by a data pointer manipulation command, and the melody specified by the data pointer 20 is set to 0 (H) by a data pointer manipulation command. RAM21 address 00
(H) is the lower bit 0 (H) of address A0 (H) of ROM13.
to remember. Next, set 1 (H) to data pointer 20.
, and the value specified by data pointer 20 is set.
The upper 4 bits A(H) of the address AO(H) of the ROM 13 are stored in the address 01(H) of the RAM 21. Then, the jump command causes the program to proceed to the subroutine shown in FIG. 4.
第4図のサブルーチンプログラムは、データポ
インタ20に0(H)をセツトし、RAM21のアド
レス00(H)に記憶された下位4ビツトのアドレスデ
ータ0(H)をアキユームレータ19に転送し、更
に、データポインタ20に1(H)をセツトする。こ
こで、TML命令を実行すると、命令実行のタイ
ミングT3及びT4に於いて、コントロール回路9
から制御信号TABLEが出力され、アキユームレ
ータ19の出力、即ち、0(H)と、データポインタ
20で指定されたRAM21のアドレス01(H)から
読み出されたアドレスデータA(H)がマルチプレク
サ17を介してROM13に印加され、アドレス
データAO(H)によつて指定されたテーブル領域1
6のアドレスAO(H)に記憶された最初のトーンデ
ータがデータバス22に送出される。そして、タ
イミングT4の前半にコントロール回路9から出
力される制御信号STB1により、データバス2
2に送出されたトーンデータがトーンデータレジ
スタ6にセツトされ、更に、タイミングT4の後
半にコントロール回路9から出力される制御信号
STB2がカウンタ1,2に印加されると、トー
ンデータレジスタ6の上位4ビツトによりROM
4から出力された時間を決定する数値がカウンタ
2にセツトされ、一方、トーンデータレジスタ6
の下位4ビツトによりROM3から出力された周
波数を決定する数値がカウンタ1にセツトされ
る。これにより、カウンタ1,2が計数動作を開
始し、メロデイの最初のトーン信号がメロデイ出
力に出力される。TML命令の実行が終了すると、
次のトーンデータの記憶されたアドレスA1(H)を
指定するためにアキユームレータ19に+1を加
算しその結果を再びアキユームレータ19に保持
する。そして、アキユームレータ19の内容が0
(H)となつたか否かを判定し、0(H)でない場合には
データポインタ20に0(H)をセツトし、データポ
インタ20で指定されたRAM21のアドレス0
(H)にアキユームレータ19のデータを転送して、
リターン命令RETを実行して元のプログラムに
復帰する。一方、数回のトーン信号の発生によ
り、アキユームレータ19に+1加算した結果が
0(H)であつた場合には、データ1(H)が記憶されて
いるデータポインタ20で指定されるRAM21
のアドレス1(H)をアキユームレータ19に転送
し、そのアドレスデータに+1を加算した結果を
RAM21のアドレス1(H)に転送する。次に、デ
ータポインタ20に0(H)をセツトしてRAM21
のアドレス0(H)のアドレスデータを0(H)にする。
これにより、ROM13のアドレスデータの下位
4ビツトから上位4ビツトへの桁上げ処理が為さ
れる。以上の処理をしてリターン命令RETを実
行し元のプログラムに復帰する。 The subroutine program in FIG. 4 sets the data pointer 20 to 0 (H), transfers the lower 4 bits of address data 0 (H) stored at address 00 (H) of the RAM 21 to the accumulator 19, and Furthermore, the data pointer 20 is set to 1 (H). Here, when the TML instruction is executed, at timings T3 and T4 of instruction execution, the control circuit 9
The control signal TABLE is output from the multiplexer, and the output of the accumulator 19, that is, 0 (H), and the address data A (H) read from the address 01 (H) of the RAM 21 specified by the data pointer 20 are sent to the multiplexer. 17 to the ROM 13 and specified by the address data AO(H).
The first tone data stored at address AO(H) of No. 6 is sent to the data bus 22. Then, in the first half of timing T4 , the control signal STB1 output from the control circuit 9 causes the data bus 2 to
The tone data sent out at T2 is set in the tone data register 6, and furthermore, the control signal output from the control circuit 9 in the latter half of timing T4 is set to the tone data register 6.
When STB2 is applied to counters 1 and 2, the upper 4 bits of tone data register 6 cause the ROM to be
The value determining the time output from 4 is set in counter 2, while the tone data register 6
A numerical value that determines the frequency output from the ROM 3 is set in the counter 1 by the lower 4 bits of the ROM 3. As a result, counters 1 and 2 start counting operations, and the first tone signal of the melody is outputted to the melody output. When the TML instruction finishes executing,
In order to designate the address A1(H) where the next tone data is stored, +1 is added to the accumulator 19, and the result is held in the accumulator 19 again. Then, the content of accumulator 19 is 0
(H), and if it is not 0 (H), sets 0 (H) to the data pointer 20, and sets the address 0 of the RAM 21 specified by the data pointer 20.
Transfer the data of accumulator 19 to (H),
Execute the return command RET to return to the original program. On the other hand, if the result of adding +1 to the accumulator 19 is 0 (H) due to the generation of tone signals several times, the RAM 22 specified by the data pointer 20 in which data 1 (H) is stored
Transfer the address 1 (H) of 1 to the accumulator 19 and add +1 to the address data.
Transfer to address 1 (H) of RAM21. Next, set the data pointer 20 to 0 (H) and load the RAM 21.
Set the address data of address 0(H) to 0(H).
As a result, carry processing from the lower 4 bits of the address data in the ROM 13 to the higher 4 bits is performed. After performing the above processing, execute the return command RET and return to the original program.
ところで、第4図に示されたプログラムを実行
した後、通常のプログラムを実行している時にも
トーン信号の発生動作は持続されているが、カウ
ンタ2が計数を終了するとその出力を“0”とす
るため、ANDゲート8に於いて、カウンタ1か
ら出力されるトーン信号が遮断される。更に、カ
ウンタ2の出力が“0”となる信号FINによりコ
ントロール回路9の割込み制御回路12に割込み
要求が為され、この割込みが受付けられると、割
込み処理プログラムに入る。割込み処理プログラ
ムでは、データ等の退避を行つた後、第4図に示
されたサブルーチンを実行する。この場合、
RAM21のアドレス0(H)及び1(H)に記憶されて
いるアドレスデータは、前回に送出されたトーン
データを記憶するアドレスの次のアドレスを指定
するデータとなつているため、第4図のサブルー
チンの実行により、次のトーンデータが読み出さ
れ、これに基いたトーン信号が作成される。この
ように、トーン信号の発生時間が終了する毎に割
込み処理によつて繰り返えし第4図のサブルーチ
ンを実行することにより、メロデイを構成するト
ーン信号が連続して順次出力されるのである。一
方、メロデイの最後のトーン信号の発生が終了す
ると同様に割込み処理が実行されるが、このとき
テーブル領域16のアドレスBF(H)から読み出さ
れたトーンデータ00(H)がトーンデータレジスタ6
にセツトされるため、カウンタ1,2には共に数
値0がセツトされ、カウンタ1,2は計数動作を
停止したままとなり、その後は信号FINによる割
込み要求は発生しない。よつて、メロデイの出力
は終了する。 By the way, after executing the program shown in FIG. 4, the tone signal generation operation continues even when a normal program is executed, but when the counter 2 finishes counting, the output is set to "0". In order to do this, the tone signal output from the counter 1 is blocked at the AND gate 8. Furthermore, an interrupt request is made to the interrupt control circuit 12 of the control circuit 9 by the signal FIN in which the output of the counter 2 becomes "0", and when this interrupt is accepted, the interrupt processing program is entered. In the interrupt processing program, after saving data, etc., the subroutine shown in FIG. 4 is executed. in this case,
The address data stored in addresses 0 (H) and 1 (H) of the RAM 21 is data that specifies the next address of the address that stores the previously transmitted tone data, so the address data shown in FIG. By executing the subroutine, the next tone data is read and a tone signal is created based on this. In this way, by repeatedly executing the subroutine shown in FIG. 4 through interrupt processing each time the tone signal generation time ends, the tone signals that make up the melody are output in sequence. . On the other hand, when the generation of the last tone signal of the melody ends, interrupt processing is executed in the same way, but at this time, tone data 00(H) read from address BF(H) of the table area 16 is stored in the tone data register 6.
Therefore, the value 0 is set in both counters 1 and 2, the counters 1 and 2 continue to stop counting, and no interrupt request is generated by the signal FIN thereafter. Therefore, the output of the melody ends.
このように、割込み処理によつて同じサブルー
チンを繰返えし実行することによりメロデイが発
生できるものであり、また、メロデイを変える場
合にはテーブル領域16のアドレスAO(H)から
BF(H)に記憶されているトーンデータを変えるだ
けで良い。更に、複数のメロデイのトーンデータ
をテーブル領域16に記憶しておけば、第3図に
於いて、RAM21のアドレス00(H)と01(H)にセツ
トするアドレスデータを選択するメロデイの先頭
アドレスとすることだけで良く、複数のメロデイ
を発生させることができる。 In this way, a melody can be generated by repeatedly executing the same subroutine using interrupt processing, and when changing the melody, the melody can be generated from address AO(H) in table area 16.
All you need to do is change the tone data stored in BF(H). Furthermore, if the tone data of a plurality of melodies is stored in the table area 16, in FIG. It is only necessary to do this, and multiple melodies can be generated.
(ト) 発明の効果
上述の如く本発明によれば、メロデイやブザー
等のトーン信号を発生させるためのプログラムが
簡単となり、更に、メロデイの変更や複数のメロ
デイの選択も容易となる利点を有し、トーン信号
発生のプログラムステツプ数が減少するため他の
通常プログラムの容量を増すことができる利点を
有する。(G) Effects of the Invention As described above, the present invention has the advantage that a program for generating tone signals such as a melody or a buzzer can be easily programmed, and it is also easy to change the melody or select a plurality of melodies. However, since the number of program steps for tone signal generation is reduced, it has the advantage that the capacity for other normal programs can be increased.
第1図は本発明の実施例に拘わるマイクロコン
ピユータのブロツク図、第2図は、第1図に示さ
れたROM及びRAMのデータ割付け図、第3図
及び第4図は本発明の実施例を示すフロー図であ
る。
1,2……カウンタ、3,4……ROM、5…
…パルス発生回路、6……トーンデータレジス
タ、9……コントロール回路、10……インスト
ラクシヨンデコーダ、11……タイミングジエネ
レータ、12……割込み制御回路、13……
ROM、14……インストラクシヨンレジスタ、
15……プログラム領域、16……テーブル領
域、17……マルチプレクサ、18……プログラ
ムカウンタ、19……アキユームレータ、20…
…データポインタ、21……RAM、22……デ
ータバス。
FIG. 1 is a block diagram of a microcomputer according to an embodiment of the present invention, FIG. 2 is a data allocation diagram of the ROM and RAM shown in FIG. 1, and FIGS. 3 and 4 are embodiments of the present invention. FIG. 1, 2...Counter, 3, 4...ROM, 5...
... Pulse generation circuit, 6 ... Tone data register, 9 ... Control circuit, 10 ... Instruction decoder, 11 ... Timing generator, 12 ... Interrupt control circuit, 13 ...
ROM, 14...instruction register,
15...Program area, 16...Table area, 17...Multiplexer, 18...Program counter, 19...Accumulator, 20...
...Data pointer, 21...RAM, 22...Data bus.
Claims (1)
るトーンデータがトーンデータレジスタにセツト
されることにより、指定された音程の指定された
長さのトーン信号を発生するトーンジエネレータ
を内蔵するマイクロコンピユータに於いて、通常
のプログラム実行中トーン信号の発生要求に従つ
て、メロデイ等を構成する各々の音のトーンデー
タが固定的に記憶されたメモリ(ROM)のテー
ブル領域の所定アドレスを指示するアドレスデー
タをデータメモリ(RAM)の特定アドレスに記
憶し、所定のサブルーチンにより前記データメモ
リ(RAM)の特定アドレスを指示することによ
つて前記トーンデータがトーンデータレジスタに
転送され、各トーン信号の発生終了を示す信号に
基いて割込み処理を実行し、該割込み処理に於い
て前記所定のサブルーチンを実行することにより
各々のトーン信号が連続して発生されることを特
徴とするマイクロコンピユータのトーン信号発生
方法。1. In a microcomputer with a built-in tone generator that generates a tone signal of a specified pitch and a specified length by setting tone data consisting of frequency specification data and time specification data in a tone data register. During normal program execution, in response to a tone signal generation request, address data indicating a predetermined address in a table area of a memory (ROM) in which tone data for each tone forming a melody, etc. is fixedly stored is generated. By storing the tone data at a specific address in a memory (RAM) and instructing the specific address in the data memory (RAM) by a predetermined subroutine, the tone data is transferred to a tone data register, indicating the end of generation of each tone signal. 1. A tone signal generation method for a microcomputer, characterized in that each tone signal is successively generated by executing interrupt processing based on the signal and executing the predetermined subroutine in the interrupt processing.
Priority Applications (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| JP60160736A JPS6220062A (en) | 1985-07-19 | 1985-07-19 | Tone signal generating method of microcomputer |
Applications Claiming Priority (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| JP60160736A JPS6220062A (en) | 1985-07-19 | 1985-07-19 | Tone signal generating method of microcomputer |
Publications (2)
| Publication Number | Publication Date |
|---|---|
| JPS6220062A JPS6220062A (en) | 1987-01-28 |
| JPH0514950B2 true JPH0514950B2 (en) | 1993-02-26 |
Family
ID=15721342
Family Applications (1)
| Application Number | Title | Priority Date | Filing Date |
|---|---|---|---|
| JP60160736A Granted JPS6220062A (en) | 1985-07-19 | 1985-07-19 | Tone signal generating method of microcomputer |
Country Status (1)
| Country | Link |
|---|---|
| JP (1) | JPS6220062A (en) |
-
1985
- 1985-07-19 JP JP60160736A patent/JPS6220062A/en active Granted
Also Published As
| Publication number | Publication date |
|---|---|
| JPS6220062A (en) | 1987-01-28 |
Similar Documents
| Publication | Publication Date | Title |
|---|---|---|
| JPH0248931B2 (en) | ||
| JPH05108341A (en) | Micro Processor | |
| US4525776A (en) | Arithmetic logic unit arranged for manipulating bits | |
| US4126896A (en) | Microprogrammed large-scale integration (LSI) microprocessor | |
| US5301338A (en) | System including central processing unit | |
| JPH0514950B2 (en) | ||
| JPS5939775B2 (en) | Memory addressing scheme | |
| JPH0721793B2 (en) | Table processor | |
| JPH0514949B2 (en) | ||
| JPH04305735A (en) | Microprogram control circuit | |
| JPS6310445B2 (en) | ||
| JP2784001B2 (en) | Instruction processing circuit of programmable controller | |
| JP2826309B2 (en) | Information processing device | |
| JPS6226486B2 (en) | ||
| JP2637070B2 (en) | Micro instruction start address generation method | |
| JPH0617195Y2 (en) | Musical sound generator | |
| JP2758624B2 (en) | Speed control method of micro program | |
| JPH05298088A (en) | Microcomputer | |
| JP2918570B2 (en) | Central processing unit | |
| JPS6252317B2 (en) | ||
| JPH0210556Y2 (en) | ||
| JP2513326B2 (en) | Electronic musical instrument | |
| JP3024410B2 (en) | Programmable controller | |
| JPH0683986A (en) | Single chip microcomputer | |
| JPH0682321B2 (en) | Micro controller |
Legal Events
| Date | Code | Title | Description |
|---|---|---|---|
| EXPY | Cancellation because of completion of term |