JPH04255081A - Microcomputer - Google Patents

Microcomputer

Info

Publication number
JPH04255081A
JPH04255081A JP3015060A JP1506091A JPH04255081A JP H04255081 A JPH04255081 A JP H04255081A JP 3015060 A JP3015060 A JP 3015060A JP 1506091 A JP1506091 A JP 1506091A JP H04255081 A JPH04255081 A JP H04255081A
Authority
JP
Japan
Prior art keywords
external
output
terminal
signal
flag
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
JP3015060A
Other languages
Japanese (ja)
Inventor
Toshinori Tamura
田村 俊則
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.)
NEC Corp
Original Assignee
NEC 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 NEC Corp filed Critical NEC Corp
Priority to JP3015060A priority Critical patent/JPH04255081A/en
Publication of JPH04255081A publication Critical patent/JPH04255081A/en
Pending legal-status Critical Current

Links

Landscapes

  • Microcomputers (AREA)
  • Information Transfer Systems (AREA)

Abstract

PURPOSE:To effectively utilize an external terminal by providing a single chip microcomputer capable of accessing an external memory with a terminal having both of a write strobe signal outputting function and an I/O port function and adding a flag for specifying the function of the terminal. CONSTITUTION:The external terminal 22 of an external interface in the microcomputer is functioned as a write strobe terminal or an I/O terminal. Namely the I/O part of the terminal 22 is provided with a write strobe allowing flag 60 and an AND gate 61 in addition to an external mode flag 51, a selector 50, a port mode flag 80, an output latch 81, an OR gate 52, an inverter gate 55, an AND gate 82, and buffers 56, 57. The flag 60 executes addess mapping. Namely the external terminal 22 functioned as the write strobe terminal when the flag 60 is '1' or functioned as the I/O terminal at the time of '0'.

Description

【発明の詳細な説明】[Detailed description of the invention]

【0001】0001

【産業上の利用分野】本発明はマイクロコンピュータに
関し、特に外部メモリにアクセスが可能なシングルチッ
プマイクロコンピュータに関する。
BACKGROUND OF THE INVENTION 1. Field of the Invention The present invention relates to a microcomputer, and more particularly to a single-chip microcomputer that can access external memory.

【0002】0002

【従来の技術】近年シングルチップマイクロコンピュー
タ(以下シングルチップマイコンと称す)を使用したシ
ステムが高機能かつ高性能になるにつれ、プログラム容
量及びデータ量が増大し、その結果シングルチップマイ
コンの外部にメモリを接続してシステムを構成する場合
が多く見られる。
[Background Art] In recent years, as systems using single-chip microcomputers (hereinafter referred to as single-chip microcomputers) have become more sophisticated and high-performance, program capacity and data volume have increased, and as a result, memory outside the single-chip microcontroller has increased. It is often seen that a system is configured by connecting two.

【0003】又、シングルチップマイコンの制御量が増
大するにつれて、シングルチップマイコンと制御を行な
う回路との間でインターフェースを行なう信号の数が多
くなり、そのためにシングルチップマイコンにてより多
くの入出力端子を備える必要がある。
[0003] Furthermore, as the amount of control of a single-chip microcomputer increases, the number of signals that interface between the single-chip microcomputer and the circuit that performs control increases, and as a result, the single-chip microcomputer handles more inputs and outputs. It is necessary to have a terminal.

【0004】ところが、応用システムの機能及び性能は
ますます増大する方向にある一方、システム全体の大き
さは小型化,軽量化が望まれており、シングルチップマ
イコンにおいては限られた数の端子を1本でも多く有効
に利用できることが強く要望されている。以下図3を用
いて、従来のシングルチップマイコンを用いたシステム
の構成動作を説明する。
However, while the functions and performance of application systems are increasing, the overall size of the system is desired to be smaller and lighter, and single-chip microcontrollers have a limited number of terminals. There is a strong desire to be able to effectively utilize as many as possible. The configuration and operation of a system using a conventional single-chip microcomputer will be described below with reference to FIG.

【0005】図3において、シングルチップマイコン1
を使ったシステム構成例で、シングルチップマイコン1
と、メモリ30と、応用回路31とで構成している。
In FIG. 3, a single-chip microcomputer 1
This is an example of a system configuration using a single-chip microcontroller 1.
, a memory 30, and an application circuit 31.

【0006】メモリ30には、シングルチップマイコン
1が実行すべきプログラム及び処理すべきデータを格納
しており、アドレスバス32と、データバス33と、ラ
イトストローブ34と、リードストローブ35とでシン
グルチップマイコン1と接続している。シングルチップ
マイコン1がメモリ30から命令又はデータをリードす
る場合は、リードストローブ35を“1”にすることに
より、アドレスバス32のアドレスで指す番地からデー
タバス33を介して命令コード又はデータを取り込むこ
とができる。メモリ30にデータをライトする場合は、
ライトストローブ34を“1”にすることにより、アド
レスバス32のアドレスで指す番地に、データバス33
を介してデータを格納することができる。
The memory 30 stores programs to be executed and data to be processed by the single-chip microcomputer 1, and an address bus 32, a data bus 33, a write strobe 34, and a read strobe 35 form a single chip. Connected to microcontroller 1. When the single-chip microcomputer 1 reads instructions or data from the memory 30, by setting the read strobe 35 to "1", the instruction code or data is taken in from the address indicated by the address of the address bus 32 via the data bus 33. be able to. When writing data to memory 30,
By setting the write strobe 34 to "1", the data bus 33
Data can be stored through.

【0007】応用回路31は、シングルチップマイコン
1が制御を行なう回路で、入力信号36と出力信号37
で接続している。例えば、入力信号36のレベルをリー
ドすることにより、スイッチが押されたかどうかの検出
を行なったり、出力信号37を“0”レベルにすること
によりトランジスタをONさせたりする。
The application circuit 31 is a circuit controlled by the single-chip microcomputer 1, and receives an input signal 36 and an output signal 37.
It is connected with For example, by reading the level of the input signal 36, it is detected whether a switch has been pressed, or by setting the output signal 37 to the "0" level, a transistor is turned on.

【0008】図4は図3のシングルチップマイコン1の
詳細なブロック図である。以下図4を用いて、従来のシ
ングルチップマイコン1の構成及び動作について説明す
る。
FIG. 4 is a detailed block diagram of the single-chip microcomputer 1 shown in FIG. The configuration and operation of the conventional single-chip microcomputer 1 will be described below with reference to FIG.

【0009】図4において、本シングルチップマイコン
1は、中央処理装置(以下“CPU”と称す)2と、外
部インタフェース3と、メモリ4と、入出力回路5と、
内部バス6と、外部端子20,21,22,23,24
,25とで構成している。
In FIG. 4, the single-chip microcomputer 1 includes a central processing unit (hereinafter referred to as "CPU") 2, an external interface 3, a memory 4, an input/output circuit 5,
Internal bus 6 and external terminals 20, 21, 22, 23, 24
, 25.

【0010】メモリ4は、CPU2が実行するプログラ
ムまたは処理データを格納する。入出力回路5は、外部
端子24,25を介してシングルチップマイコン1の外
部へ信号を入出力する回路である。
[0010] The memory 4 stores programs executed by the CPU 2 or processing data. The input/output circuit 5 is a circuit that inputs and outputs signals to the outside of the single-chip microcomputer 1 via external terminals 24 and 25.

【0011】外部インタフェース3は、外部端子20,
21,22,23を介して、シングルチップマイコン1
の外部に接続したメモリへのアクセスとポート入出力動
作を制御する回路である。CPU2から外部インタフェ
ース3へ外部ライト信号7と、外部リード信号8と、ポ
ートモードフラグ設定信号9と、ポート入力信号10と
、外部モードフラグ設定信号11と、出力ラッチ設定信
号101とを供給する。
[0011] The external interface 3 has external terminals 20,
Single chip microcomputer 1 via 21, 22, 23
This circuit controls access to externally connected memory and port input/output operations. An external write signal 7, an external read signal 8, a port mode flag setting signal 9, a port input signal 10, an external mode flag setting signal 11, and an output latch setting signal 101 are supplied from the CPU 2 to the external interface 3.

【0012】外部インタフェース3は、アドレス/デー
タ入出力制御回路26と、リード/ライト制御回路27
とで構成し、CPU2が外部へアクセスを行なうと、ア
ドレス/データ入出力制御回路26は外部端子20から
アドレスを、外部端子21からデータの入出力を行なう
。リード/ライト制御回路27は、外部端子22からラ
イトストローブ信号を出力し、外部端子23からリード
ストローブ信号を出力する。
The external interface 3 includes an address/data input/output control circuit 26 and a read/write control circuit 27.
When the CPU 2 accesses the outside, the address/data input/output control circuit 26 inputs and outputs addresses from the external terminal 20 and data from the external terminal 21. The read/write control circuit 27 outputs a write strobe signal from the external terminal 22 and a read strobe signal from the external terminal 23.

【0013】リード/ライト制御回路27からアドレス
/データ入出力制御回路26へ外部へアクセスするモー
ドであることを示す外部モード信号58を供給する。
The read/write control circuit 27 supplies the address/data input/output control circuit 26 with an external mode signal 58 indicating that it is in a mode for accessing the outside.

【0014】図5は図4のリード/ライト制御回路27
における外部端子22の入出力ブロック図である。
FIG. 5 shows the read/write control circuit 27 of FIG.
FIG. 2 is an input/output block diagram of an external terminal 22 in FIG.

【0015】以下図5を用いて従来のリード/ライト制
御回路27における外部端子22の入出力動作について
説明する。図5において、外部モードフラグ51と、セ
レクタ50と、ポートモードフラグ80と、出力ラッチ
81と、ANDゲート82と、ORゲート52と、アッ
ファ56と、インバータゲート55と外部端子22とで
構成している。
The input/output operation of the external terminal 22 in the conventional read/write control circuit 27 will be described below with reference to FIG. In FIG. 5, it is composed of an external mode flag 51, a selector 50, a port mode flag 80, an output latch 81, an AND gate 82, an OR gate 52, an amplifier 56, an inverter gate 55, and an external terminal 22. ing.

【0016】外部モードフラグ51は、シングルチップ
マイコン1の外部に接続した外部メモリに対し、アクセ
スを行なうかどうかを指定するフラグで、“1”の時外
部アクセスモードになり(以下、外部モードフラグ51
に“1”を設定した状態を“外部モード”と称す)、外
部端子22はライトストローブ端子になる。外部モード
フラグ51が“0”の時は、ポートモードにより、外部
端子22は信号入出力端子になる。外部モードフラグ5
1はアドレスマッピングされており、前述アドレスを指
定して命令にてデータをロイトすると、外部モードフラ
グ設定信号11を“1”にし、内部バス6を介してデー
タを設定する。
The external mode flag 51 is a flag that specifies whether or not to access the external memory connected to the outside of the single-chip microcomputer 1. When set to "1", the external access mode is set (hereinafter referred to as the external mode flag). 51
(The state in which "1" is set to "1" is referred to as "external mode"), the external terminal 22 becomes a write strobe terminal. When the external mode flag 51 is "0", the external terminal 22 becomes a signal input/output terminal due to the port mode. External mode flag 5
1 is address mapped, and when the address is designated and data is written by a command, the external mode flag setting signal 11 is set to "1" and the data is set via the internal bus 6.

【0017】ポートモードフラグ80は、外部モードで
ない時に、外部端子22を入力ポートとして使用するか
、出力ポートとして使用するかを指定するフラグである
。ポートモードフラグ80が“1”の時、外部端子22
は入力ポートになり、ポートモードフラグ80が“0”
の時外部端子22は出力ポートになる。ポートモードフ
ラグ80はアドレスマッピングされており、前述アドレ
スを指定して命令にてデータをライトすると、ポートモ
ードフラグ設定信号9を“1”にし、内部バス6を介し
てデータを設定する。
The port mode flag 80 is a flag that specifies whether the external terminal 22 is used as an input port or an output port when not in the external mode. When the port mode flag 80 is “1”, the external terminal 22
becomes an input port, and port mode flag 80 is “0”
At this time, the external terminal 22 becomes an output port. The port mode flag 80 is address mapped, and when the address is specified and data is written by a command, the port mode flag setting signal 9 is set to "1" and the data is set via the internal bus 6.

【0018】出力ラッチ81は、外部端子22を出力ポ
ートに使用した際に、外部端子22から出力する信号レ
ベルを記憶する1ビットのラッチである。出力ラッチ8
1は、アドレスマッピングされており、前述アドレスを
指定して命令にてデータをライトすると、出力ラッチ設
定信号101を“1”にし、内部バス6を介してデータ
を設定する。
The output latch 81 is a 1-bit latch that stores the signal level output from the external terminal 22 when the external terminal 22 is used as an output port. Output latch 8
1 is address mapped, and when the address is specified and data is written by a command, the output latch setting signal 101 is set to "1" and the data is set via the internal bus 6.

【0019】セレクタ50は、外部モード信号58が“
1”の時に外部ライト信号7を選択し、外部モード信号
58が“0”の時に出力ラッチ81の出力を選択し出力
する。以下に図5を使って、外部モード時の動作につい
て説明を行なう。
The selector 50 selects whether the external mode signal 58 is “
When the external mode signal 58 is “1”, the external write signal 7 is selected, and when the external mode signal 58 is “0”, the output of the output latch 81 is selected and output.The operation in the external mode will be explained below using FIG. .

【0020】ライト命令を実行して、外部モードフラグ
設定信号11を“1”にし、内部バス6を介して外部モ
ードフラグ51に“1”を設定する。外部モードフラグ
51が“1”であると、外部モード信号58が“1”に
なり、セレクタ50は外部ライト信号7を選択し出力す
る。又外部モード信号58が“1”であるので、ORゲ
ート52の出力が“1”になり、バッファ56がONに
なる。従って、外部端子22から外部ライト信号7を出
力する。
The write command is executed, the external mode flag setting signal 11 is set to "1", and the external mode flag 51 is set to "1" via the internal bus 6. When the external mode flag 51 is "1", the external mode signal 58 becomes "1", and the selector 50 selects and outputs the external write signal 7. Also, since the external mode signal 58 is "1", the output of the OR gate 52 becomes "1" and the buffer 56 is turned on. Therefore, the external write signal 7 is output from the external terminal 22.

【0021】次に外部モードでない時の動作について説
明を行なう。ライト命令を実行して、外部モードフラグ
設定信号11を“1”にし、内部バス6を介して外部モ
ードフラグ51に“0”を設定する。外部モードフラグ
51が“0”であると、外部モード信号58が“0”に
なり、セレクタ50は出力ラッチ81の出力を選択し出
力する。
Next, the operation when not in the external mode will be explained. The write command is executed to set the external mode flag setting signal 11 to "1" and set the external mode flag 51 to "0" via the internal bus 6. When the external mode flag 51 is "0", the external mode signal 58 becomes "0", and the selector 50 selects and outputs the output of the output latch 81.

【0022】まず外部端子22を出力ポートとして使用
する場合について説明する。ライト命令を実行してポー
トモードフラグ設定信号9を“1”にし、内部バス6を
介してポートモードフラグ80に“0”を設定する。ポ
ートモードフラグ80が“0”であるので、インバータ
ゲート55の出力が“1”に、ORゲート52の出力が
“1”になる。ORゲート52の出力が“1”になるの
で、バッファ56はON状態になる。
First, the case where the external terminal 22 is used as an output port will be explained. The write command is executed to set the port mode flag setting signal 9 to "1" and set the port mode flag 80 to "0" via the internal bus 6. Since the port mode flag 80 is "0", the output of the inverter gate 55 becomes "1" and the output of the OR gate 52 becomes "1". Since the output of the OR gate 52 becomes "1", the buffer 56 is turned on.

【0023】従って、ライト命令を実行して出力ラッチ
設定信号101を“1”にし、内部バス6を介して出力
ラッチ81に“1”を設定すると、外部端子22から“
1”を出力する。
Therefore, when the write command is executed to set the output latch setting signal 101 to "1" and the output latch 81 is set to "1" via the internal bus 6, "1" is output from the external terminal 22.
Outputs 1”.

【0024】同様に、ライト命令を実行して出力ラッチ
設定信号101を“1”にし、内部バス6を介して出力
ラッチ81に“0”を設定すると、外部端子22から“
0”を出力する。
Similarly, when a write command is executed to set the output latch setting signal 101 to "1" and the output latch 81 is set to "0" via the internal bus 6, "0" is output from the external terminal 22.
0” is output.

【0025】次に外部端子22を入力ポートとして使用
する場合について説明する。ライト命令を実行して、ポ
ートモードフラグ設定信号9を“1”にし、内部バス6
を介してポートモードフラグ80に“1”を設定する。 ポートモードフラグ80が“1”で外部モード信号58
が“0”であるので、インバータゲート35の出力が“
0”にORゲート52の出力が“0”になる。ORゲー
ト52の出力が“0”になるので、バッファ56はOF
F状態になる。
Next, the case where the external terminal 22 is used as an input port will be explained. Execute the write command, set the port mode flag setting signal 9 to "1", and set the internal bus 6 to "1".
The port mode flag 80 is set to "1" via the port mode flag 80. When the port mode flag 80 is “1”, the external mode signal 58
is “0”, so the output of the inverter gate 35 is “0”.
0", the output of the OR gate 52 becomes "0". Since the output of the OR gate 52 becomes "0", the buffer 56 becomes OF
Becomes F state.

【0026】ポート入力命令を実行して、ポート入力信
号10を“1”にすると、ポートモードフラグ80が“
1”であるので、ANDゲート82の出力が“1”にな
り、バッファ57はON状態になる。従って、外部端子
22の信号レベルを内部バス6を介して入力することが
できる。
When the port input command is executed and the port input signal 10 is set to "1", the port mode flag 80 is set to "1".
1", the output of the AND gate 82 becomes "1" and the buffer 57 is turned on. Therefore, the signal level of the external terminal 22 can be input via the internal bus 6.

【0027】[0027]

【発明が解決しようとする課題】前述した従来のシング
ルチップマイコンでは、シングルチップマイコンの外部
に接続したメモリにプログラム又は固定データのみを格
納する応用システムにおいて、ライトストローブ信号が
不要であるこにもかかわらず、外部拡張フラグに“1”
をライトして外部モードに設定すると、所定の外部端子
がライトストローブ端子として機能し、入出力ポートと
して使用できないため、外部端子を有効に利用できない
という問題点があった。
[Problems to be Solved by the Invention] In the conventional single-chip microcontroller described above, a write strobe signal is not required in an application system in which only a program or fixed data is stored in a memory connected to the outside of the single-chip microcontroller. The external extension flag is set to “1”.
When the external mode is set by writing, a predetermined external terminal functions as a write strobe terminal and cannot be used as an input/output port, so there is a problem that the external terminal cannot be used effectively.

【0028】また、シングルチップマイコンの外部に接
続したメモリにデータのライトのみを行なう応用システ
ムにおいて、リードストローブ信号が不要であるにもか
かわらず、外部拡張フラグに“1”をライトして外部モ
ードに設定すると、所定の外部端子がリードストローブ
端子として機能し、入出力ポートとして使用できないた
め、外部端子を有効に利用できないという問題点があっ
た。
Furthermore, in an application system that only writes data to a memory connected externally to a single-chip microcomputer, even though a read strobe signal is not required, "1" is written to the external expansion flag and the external mode is set. When set to , a predetermined external terminal functions as a read strobe terminal and cannot be used as an input/output port, resulting in a problem that the external terminal cannot be used effectively.

【0029】本発明の目的は前記問題点を解決し、外部
端子を有効利用できるようにしたマイクロコンピュータ
を提供することにある。
SUMMARY OF THE INVENTION An object of the present invention is to provide a microcomputer that solves the above problems and allows effective use of external terminals.

【0030】[0030]

【課題を解決するための手段】本発明の構成は、中央処
理装置と、記憶装置と、中央処理装置が外部メモリにア
クセスするための制御を行なう外部インタフェースと、
外部メモリにアクセスする際のライトストローブ信号を
出力する機能と入出力ポート機能とを兼用する端子とを
備えたマイクロコンピュータにおいて、端子の機能を指
定するフラグを付加し、前記フラグが“0”の時はスト
ローブ信号の出力を禁止し、端子を入出力ポートとして
動作させ、またフラグが“1”の時はストローブ信号を
出力し端子はライトストローブ信号の出力端子として動
作させる手段を有していることを特徴とし、または外部
メモリにアクセスする際のリードストローブ信号を出力
する機能と入出力ポート機能とを兼用する端子の機能を
指定するフラグを付加し、フラグが“0”の時はリード
ストローブ信号の出力を禁止して端子を入出力ポートと
して動作させ、またフラグが“1”の時はリードストロ
ーブ信号を出力し端子はリードストローブ信号の出力端
子として動作させる手段を有していることを特徴とする
[Means for Solving the Problems] The configuration of the present invention includes a central processing unit, a storage device, an external interface for controlling access by the central processing unit to an external memory,
In a microcomputer that is equipped with a terminal that also serves as an input/output port and a function that outputs a write strobe signal when accessing an external memory, a flag that specifies the function of the terminal is added, and the flag is set to "0". When the flag is "1", the output of the strobe signal is prohibited and the terminal is operated as an input/output port, and when the flag is "1", the strobe signal is output and the terminal is operated as the output terminal of the write strobe signal. The feature is that a flag is added to specify the function of the terminal that serves both the function of outputting a read strobe signal when accessing external memory and the function of an input/output port, and when the flag is "0", it is used as a read strobe signal. It should be noted that the terminal has a means for inhibiting signal output and operating the terminal as an input/output port, and when the flag is "1", outputting a read strobe signal and operating the terminal as an output terminal for the read strobe signal. Features.

【0031】[0031]

【実施例】図1は本発明の一実施例のマイクロコンピュ
ータの外部インタフェースにおける外部端子(22)の
入出力部分を示すブロック図である。
DESCRIPTION OF THE PREFERRED EMBODIMENTS FIG. 1 is a block diagram showing an input/output portion of an external terminal (22) in an external interface of a microcomputer according to an embodiment of the present invention.

【0032】図1において、本実施例は従来例と異なり
、外部モードにおいて外部端子22をライトストローブ
端子として機能させるか、入出力端子として機能させる
かを選択することが可能である。本実施例に係るシング
ルチップマイコンでは、外部インタフェース内のリード
/ライト制御回路のみ異なるため他の説明は省略する。
In FIG. 1, unlike the conventional example, in the present embodiment, it is possible to select whether the external terminal 22 is to function as a write strobe terminal or an input/output terminal in the external mode. Since the single-chip microcomputer according to this embodiment differs only in the read/write control circuit within the external interface, other explanations will be omitted.

【0033】図1において、外部端子22の入出力部分
では、外部モードフラグ51と、セレクタ50と、ポー
トモードフラグ80と、出力ラッチ81と、ORゲート
52と、インバータゲート55と、ANDゲート82と
、バッファ56,57とは、従来のリード/ライト制御
回路と同じであるので説明を省略する。
In FIG. 1, the input/output portion of the external terminal 22 includes an external mode flag 51, a selector 50, a port mode flag 80, an output latch 81, an OR gate 52, an inverter gate 55, and an AND gate 82. Since the buffers 56 and 57 are the same as those in the conventional read/write control circuit, their explanation will be omitted.

【0034】図1に示す外部端子22の入出力ブロック
図は、図5に示す従来のリード/ライト制御回路から、
ライトストローブ許可フラグ60とANDゲート61と
を追加している。ライトストローブ許可フラグ60は、
外部モードにおいて外部端子22をライトストローブ端
子として機能させるか、入出力端子として機能させるが
を選択するフラグである。ライトストローブ許可フラグ
60が“1”の時は外部端子22はライトストローブ端
子として機能し、“0”の時は入出力端子として機能す
る。
The input/output block diagram of the external terminal 22 shown in FIG. 1 differs from the conventional read/write control circuit shown in FIG.
A write strobe permission flag 60 and an AND gate 61 are added. The light strobe permission flag 60 is
This flag is used to select whether the external terminal 22 is to function as a write strobe terminal or an input/output terminal in the external mode. When the write strobe permission flag 60 is "1", the external terminal 22 functions as a write strobe terminal, and when it is "0", it functions as an input/output terminal.

【0035】ライトストローブ許可フラグ60はアドレ
スマッピングされており、前述アドレスを指定して命令
にてデータをライトすると、ライトストローブ許可フラ
グ設定信号62を“1”にし、内部バス6を介してデー
タを設定する。以下に図1を使って外部モード時の動作
について説明を行なう。
The write strobe permission flag 60 is address-mapped, and when the aforementioned address is designated and data is written by a command, the write strobe permission flag setting signal 62 is set to “1” and the data is written via the internal bus 6. Set. The operation in the external mode will be explained below using FIG.

【0036】ライト命令を実行して、外部モードフラグ
設定信号11を“1”にし、内部バス6を介して外部モ
ードフラク51に“1”を設定する。ライト命令を実行
して、ライトストローブ許可フラグ設定信号62を“1
”にし、内部バス6を介して、ライトストローブ許可フ
ラグ60に“1”を設定する。外部モードフラグ51が
“1”で、かつライトストローブ許可フラグ60が“1
”であるので、ANDゲート61の出力であるライトス
トローブ許可信号65が“1”になり、セレクタ50は
外部ライト信号7を選択する。
The write command is executed, the external mode flag setting signal 11 is set to "1", and the external mode flag 51 is set to "1" via the internal bus 6. Execute the write command and set the write strobe permission flag setting signal 62 to “1”.
” and set the write strobe permission flag 60 to “1” via the internal bus 6.If the external mode flag 51 is “1” and the write strobe permission flag 60 is “1”
”, the write strobe permission signal 65, which is the output of the AND gate 61, becomes “1” and the selector 50 selects the external write signal 7.

【0037】また、ライトストローブ許可信号65が“
1”であるので、ORゲート52の出力が“1”になり
、バッファ56はON状態になる。従って、外部端子2
2はセレクタ50が選択した外部ライト信号7を出力す
る。
Further, the write strobe permission signal 65 is “
1", the output of the OR gate 52 becomes "1" and the buffer 56 is turned on. Therefore, the external terminal 2
2 outputs the external write signal 7 selected by the selector 50.

【0038】次に外部モードにおいて外部端子22を入
出力ポートとして使用する場合を説明する。ライト命令
を実行して、ライトストローブ許可フラグ設定信号62
を“1”にし、内部バス6を介してライトストローブ許
可フラグ60に“0”を設定する。ライトストローブ許
可フラグ60が“0”であるので、ANDゲート61の
出力であるライトストローブ許可信号65が“0”にな
り、セレクタ50は出力ラッチ81の出力を選択する。
Next, the case where the external terminal 22 is used as an input/output port in the external mode will be explained. Execute the write command and write strobe permission flag setting signal 62
is set to "1" and the write strobe permission flag 60 is set to "0" via the internal bus 6. Since the write strobe permission flag 60 is “0”, the write strobe permission signal 65 which is the output of the AND gate 61 becomes “0”, and the selector 50 selects the output of the output latch 81.

【0039】まず、外部端子22を出力ポートとして使
用する場合について説明する。ライト命令を実行して、
ポートモードフラグ設定信号9を“1”にし、内部バス
6を介してポートモードフラグ80に“0”を設定する
。ポートモードフラグ80が“0”であるのでインバー
タゲート55の出力が“1”に、ORゲート52の出力
が“1”になる。ORゲート52の出力が“1”になる
ので、バッファ56はON状態になる。
First, the case where the external terminal 22 is used as an output port will be explained. Execute the write command,
The port mode flag setting signal 9 is set to "1" and the port mode flag 80 is set to "0" via the internal bus 6. Since the port mode flag 80 is "0", the output of the inverter gate 55 becomes "1" and the output of the OR gate 52 becomes "1". Since the output of the OR gate 52 becomes "1", the buffer 56 is turned on.

【0040】従って、ライト命令を実行して出力ラッチ
設定信号101を“1”にし、内部バス6を介して出力
ラッチ81に“1”を設定すると、外部端子22から“
1”を出力する。同様に出力ラッチ81に“0”を設定
すると、外部端子22から“0”を出力する。
Therefore, when the write command is executed to set the output latch setting signal 101 to "1" and the output latch 81 is set to "1" via the internal bus 6, "1" is output from the external terminal 22.
Similarly, when the output latch 81 is set to "0", the external terminal 22 outputs "0".

【0041】次に外部端子22を入力ポートとして使用
する場合について説明する。ライト命令を実行してポー
トモードフラグ設定信号9を“1”にし、内部バス6を
介してポートモードフラグ80に“1”を設定する。ポ
ートモードフラグ80が“1”で、ライトストローブ許
可信号65が“0”であるので、インバータゲート55
の出力が“0”に、ORゲート52の出力が“0”にな
る。ORゲート52の出力が“0”になるので、バッフ
ァ56はOFF状態になる。ポート入力命令を実行して
ポート入力信号10を“1”にすると、ポートモードフ
ラグ80が“1”であるので、ANDゲート82の出力
が“1”になりバッファ47はON状態になる。
Next, the case where the external terminal 22 is used as an input port will be explained. The write command is executed to set the port mode flag setting signal 9 to "1", and the port mode flag 80 is set to "1" via the internal bus 6. Since the port mode flag 80 is “1” and the write strobe permission signal 65 is “0”, the inverter gate 55
The output of the OR gate 52 becomes "0" and the output of the OR gate 52 becomes "0". Since the output of the OR gate 52 becomes "0", the buffer 56 is turned off. When the port input command is executed and the port input signal 10 is set to "1", since the port mode flag 80 is "1", the output of the AND gate 82 becomes "1" and the buffer 47 is turned on.

【0042】従って、外部端子22の信号レベルを内部
バス6を介して入力することができる。以上説明したよ
うに外部モードであってもライトストローブ許可フラグ
60に“1”を設定することによい外部端子22を入出
力ポートとして使用することが可能である。
Therefore, the signal level of the external terminal 22 can be input via the internal bus 6. As described above, even in the external mode, it is possible to use the external terminal 22 as an input/output port by setting the write strobe permission flag 60 to "1".

【0043】外部モードでない時の動作について説明を
行なう。ライト命令を実行して外部モードフラグ設定信
号11を“1”にし、内部バス6を介して外部モード5
1に“0”を設定する。外部モードフラグ51が“0”
であると、ANDゲート61の出力であるライトストロ
ーブ許可信号65が“0”になり、セレクタ50は出力
ラッチ81の出力を選択し出力する。以下、入出力動作
については従来例におけるポートモード時の動作と同様
であるため記述を省略する。
The operation when not in external mode will be explained. Execute the write command, set the external mode flag setting signal 11 to "1", and send the external mode 5 via the internal bus 6.
Set “0” to 1. External mode flag 51 is “0”
If so, the write strobe permission signal 65, which is the output of the AND gate 61, becomes "0", and the selector 50 selects and outputs the output of the output latch 81. Hereinafter, the description of the input/output operation will be omitted because it is the same as the operation in the port mode in the conventional example.

【0044】図2は本発明の他の実施例のマイクロコン
ピュータの外部インタフェースにおける外部端子(23
)の入出力部分を示すブロック図である。
FIG. 2 shows an external terminal (23) in an external interface of a microcomputer according to another embodiment of the present invention.
) is a block diagram showing the input/output part of the device.

【0045】図2に示す外部端子23の入出力ブロック
図は、図1の入出力ブロック図から外部端子22を外部
端子23に、ライトストローブ許可フラグ60をリード
ストローブ許可ブラグ71に、セレクタ70に入力する
信号を外部ライト信号7から外部リード信号8に変更し
た以外は全て同じである。従って説明を省略し、相違点
を中心に説明する。
The input/output block diagram of the external terminal 23 shown in FIG. 2 is based on the input/output block diagram of FIG. Everything is the same except that the input signal is changed from external write signal 7 to external read signal 8. Therefore, the explanation will be omitted, and the explanation will focus on the differences.

【0046】以下、図2を使用して、本実施例のリード
/ライト制御回路における外部端子23の入出力動作に
ついて説明する。リードストローブ許可フラグ71は、
外部モードにおいて外部端子23をリードストローブ端
子として機能させるか、入出力端子として機能させるか
を選択するフラグである。
The input/output operation of the external terminal 23 in the read/write control circuit of this embodiment will be explained below using FIG. The read strobe permission flag 71 is
This flag is used to select whether the external terminal 23 is to function as a read strobe terminal or an input/output terminal in the external mode.

【0047】リードストローブ許可フラグ71が“1”
の時に外部端子23はリードストローブ端子として機能
し、“0”の時に入出力端子として機能する。図1の実
施例で説明したのと同様に、外部モードフラグ51に“
1”をライトして外部モードに設定し、リードストロー
ブ許可フラグ71に“1”を設定すると、リードストロ
ーブ許可信号90が“1”になる。
Read strobe permission flag 71 is “1”
When the signal is "0", the external terminal 23 functions as a read strobe terminal, and when the signal is "0", the external terminal 23 functions as an input/output terminal. Similarly to the embodiment of FIG. 1, the external mode flag 51 is set to “
When "1" is written to set the external mode and the read strobe permission flag 71 is set to "1", the read strobe permission signal 90 becomes "1".

【0048】リードストローブ許可信号90が“1”に
なると、セレクタ70は外部リード信号8を選択し、外
部端子23はリードストローブ端子として機能する。外
部モード時にリードストローブ許可フラグ71に“0”
を設定すると、リードストローブ許可信号90が“0”
になる。リードストローブ許可信号90が“0”になる
と、セレクタ70は出力ラッチ81の出力を選択して出
力する。出力ラッチ86に“0”を設定すると、外部端
子23から“0”を出力することができる。また出力ラ
ッチ86に“1”を設定すると、外部端子23から“1
”を出力することができる。
When the read strobe permission signal 90 becomes "1", the selector 70 selects the external read signal 8, and the external terminal 23 functions as a read strobe terminal. Read strobe permission flag 71 is set to “0” in external mode.
When set, the read strobe enable signal 90 becomes “0”.
become. When the read strobe permission signal 90 becomes "0", the selector 70 selects and outputs the output of the output latch 81. When “0” is set in the output latch 86, “0” can be output from the external terminal 23. Also, when the output latch 86 is set to “1”, the external terminal 23 outputs “1”.
” can be output.

【0049】次にポートモードフラグ85に“1”を設
定し、ポート入力命令を実行してポート入力信号10を
“1”にすると、外部端子23の信号レベルをリードす
ることができる。従って、外部モードであっても、リー
ドストローブ許可フラグ71に“1”を設定することに
より、外部端子23を入出力ポートとして使用すること
が可能である。外部モードでない場合については、従来
例におけるポートモード時の動作と同様であるため記述
を省略する。
Next, by setting the port mode flag 85 to "1" and executing the port input command to set the port input signal 10 to "1", the signal level of the external terminal 23 can be read. Therefore, even in the external mode, by setting the read strobe permission flag 71 to "1", the external terminal 23 can be used as an input/output port. The case where the mode is not external mode is the same as the operation in the port mode in the conventional example, so the description will be omitted.

【0050】[0050]

【発明の効果】以上説明したように、本発明は、例えば
従来の外部インタフェースにライトストローブ許可フラ
グを付加することにより、シングルチップマイコンの外
部に接続したメモリにアクセスを行なう外部モードにお
いて外部端子をライトストローブ端子として機能させる
かどうかを選択することができるため、外部メモリにプ
ログラムや固定データのみを格納し、ライトストローブ
が不要なシステムではライトストローブ信号の出力を禁
止し、入出力ポートとし使用することにより、外部入出
力端子を有効に利用することができるという効果を有す
る。
As explained above, the present invention enables external terminals to be used in external mode for accessing memory connected to the outside of a single-chip microcontroller by adding a write strobe permission flag to a conventional external interface, for example. You can select whether or not to function as a write strobe terminal, so in systems that store only programs and fixed data in external memory and do not require a write strobe, output of the write strobe signal is prohibited and used as an input/output port. This has the effect that external input/output terminals can be used effectively.

【0051】また本発明は、リードストローブ許可フラ
グを付加することにより、外部メモリにデータのライト
のみ行ない、リードストローブ信号が不要なシステムで
は、リードストローブ信号の出力を禁止し、入出力ポー
トとして使用することにより、外部入出力端子を有効に
利用することができるという効果も有する。
Furthermore, by adding a read strobe permission flag, the present invention can only write data to an external memory, and in a system that does not require a read strobe signal, output of the read strobe signal is prohibited and the read strobe signal can be used as an input/output port. This also has the effect that external input/output terminals can be used effectively.

【図面の簡単な説明】[Brief explanation of the drawing]

【図1】本発明の一実施例のマイクロコンピュータの外
部インタフェースのブロック図である。
FIG. 1 is a block diagram of an external interface of a microcomputer according to an embodiment of the present invention.

【図2】本発明の他の実施例のマイクロコンピュータの
外部インタフェースのブロック図である。
FIG. 2 is a block diagram of an external interface of a microcomputer according to another embodiment of the present invention.

【図3】従来のシングルチップマイコンを使用したシス
テムを示すブロック図である。
FIG. 3 is a block diagram showing a system using a conventional single-chip microcomputer.

【図4】従来のシングルチップマイコンの詳細を示すブ
ロック図である。
FIG. 4 is a block diagram showing details of a conventional single-chip microcomputer.

【図5】従来のシングルチップマイコンの外部インタフ
ェースのブロック図である。
FIG. 5 is a block diagram of an external interface of a conventional single-chip microcomputer.

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

1    シングルチップマイコン 2    中央処理装置(CPU) 3    外部インタフェース 4,30    メモリ 5    入出力回路 6    内部バス 7    外部ライト信号 8    外部リード信号 9    ポートモードフラグ設定信号10    ポ
ート入力信号 11    外部モードフラグ設定信号20,21,2
2,23,24,25    外部端子31    応
用回路 32    アドレスバス 33    データバス 34    ライトストローブ 35    リードストローブ 36    入力信号 37    出力信号 50,70    セレクタ 51    外部モードフラグ 52,73    ORゲート 61,72,82,87    ANDゲート55,5
9    インバータゲート 56,57,77,78    バッファ60    
ライトストローブ許可フラグ62    ライトストロ
ーブ許可フラグ設定信号71    リードストローブ
許可フラグ79    リードストローブ許可フラグ設
定信号58,  外部モード信号 65    ライトストローブ許可信号90    リ
ードストローブ許可信号26    アドレス/データ
入出力制御回路27    リード/ライト制御回路 101    出力ラッチ設定信号 86,81    出力ラッチ 80    ポートモードラッチ
1 Single-chip microcomputer 2 Central processing unit (CPU) 3 External interfaces 4, 30 Memory 5 Input/output circuit 6 Internal bus 7 External write signal 8 External read signal 9 Port mode flag setting signal 10 Port input signal 11 External mode flag setting signal 20 ,21,2
2, 23, 24, 25 External terminal 31 Application circuit 32 Address bus 33 Data bus 34 Write strobe 35 Read strobe 36 Input signal 37 Output signal 50, 70 Selector 51 External mode flag 52, 73 OR gate 61, 72, 82, 87 AND gate 55,5
9 Inverter gate 56, 57, 77, 78 Buffer 60
Write strobe permission flag 62 Write strobe permission flag setting signal 71 Read strobe permission flag 79 Read strobe permission flag setting signal 58, external mode signal 65 Write strobe permission signal 90 Read strobe permission signal 26 Address/data input/output control circuit 27 Read/write Control circuit 101 Output latch setting signals 86, 81 Output latch 80 Port mode latch

Claims (3)

【特許請求の範囲】[Claims] 【請求項1】  中央処理装置と、記憶装置と、前記中
央処理装置が外部メモリにアクセスするための制御を行
なう外部インタフェースと、前記外部メモリにアクセス
する際のストローブ信号を出力する機能及び入出力ポー
ト機能を兼用する端子とを備えたマイクロコンピュータ
において、前記端子の機能を指定するフラグを付加し、
前記フラグが“0”の時は前記ストローブ信号の出力を
禁止して前記端子を入出力ポートとして動作させ、また
前記フラグが“1”の時は前記ストローブ信号を出力し
て前記端子を前記ストローブ信号の出力端子として動作
させる手段を内蔵したことを特徴とするマイクロコンピ
ュータ。
1. A central processing unit, a storage device, an external interface for controlling access by the central processing unit to an external memory, and a function and input/output for outputting a strobe signal when accessing the external memory. In a microcomputer equipped with a terminal that also serves as a port function, a flag specifying the function of the terminal is added,
When the flag is "0", the output of the strobe signal is prohibited and the terminal operates as an input/output port, and when the flag is "1", the strobe signal is output and the terminal is operated as an input/output port. A microcomputer characterized by having built-in means for operating as a signal output terminal.
【請求項2】  ストローブ信号がライトストローブ信
号である請求項1記載のマイクロコンピュータ。
2. The microcomputer according to claim 1, wherein the strobe signal is a write strobe signal.
【請求項3】  ストローブ信号がリードストローブ信
号である請求項1記載のマイクロコンピュータ。
3. The microcomputer according to claim 1, wherein the strobe signal is a read strobe signal.
JP3015060A 1991-02-06 1991-02-06 Microcomputer Pending JPH04255081A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP3015060A JPH04255081A (en) 1991-02-06 1991-02-06 Microcomputer

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP3015060A JPH04255081A (en) 1991-02-06 1991-02-06 Microcomputer

Publications (1)

Publication Number Publication Date
JPH04255081A true JPH04255081A (en) 1992-09-10

Family

ID=11878298

Family Applications (1)

Application Number Title Priority Date Filing Date
JP3015060A Pending JPH04255081A (en) 1991-02-06 1991-02-06 Microcomputer

Country Status (1)

Country Link
JP (1) JPH04255081A (en)

Similar Documents

Publication Publication Date Title
US6112303A (en) Computer system with system ROM including serial-access PROM coupled to an auto-configuring memory controller and method of shadowing BIOS code from PROM
JP3226055B2 (en) Information processing device
US5168559A (en) Emulation system capable of complying with microcomputers having different on-chip memory capacities
US5339402A (en) System for connecting an IC memory card to a central processing unit of a computer
JP2003006046A (en) Method and circuit for memory protection
JP2003140963A (en) Semiconductor storage system
JPH04255081A (en) Microcomputer
JPS60189561A (en) Memory access control system
JP2568017B2 (en) Microprocessor and data processing system using the same
JP2004192051A (en) Shared terminal controller
JP2522063B2 (en) Single-chip micro computer
JP3283505B2 (en) Microcomputer
US5151980A (en) Buffer control circuit for data processor
KR940011042B1 (en) Memory unit using banking program
JPH06231072A (en) Microcomputer
JPH04237346A (en) Microprocessor system
JP3353877B2 (en) Memory device
JPS63317827A (en) Memory control circuit
JPS6230660B2 (en)
JPH0628245A (en) Microcomputer
JPH0497455A (en) Memory control circuit
JPH04352045A (en) Connecting device for ic card
JP2000020446A (en) Bus adapter circuit
JPS61139858A (en) Access control system for dual port memory
JPH073749B2 (en) Dual port RAM

Legal Events

Date Code Title Description
A02 Decision of refusal

Free format text: JAPANESE INTERMEDIATE CODE: A02

Effective date: 20010807