JPH04316173A - Single-chip microcomputer - Google Patents

Single-chip microcomputer

Info

Publication number
JPH04316173A
JPH04316173A JP3082789A JP8278991A JPH04316173A JP H04316173 A JPH04316173 A JP H04316173A JP 3082789 A JP3082789 A JP 3082789A JP 8278991 A JP8278991 A JP 8278991A JP H04316173 A JPH04316173 A JP H04316173A
Authority
JP
Japan
Prior art keywords
input
output
pull
resistor
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
JP3082789A
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 JP3082789A priority Critical patent/JPH04316173A/en
Publication of JPH04316173A publication Critical patent/JPH04316173A/en
Pending legal-status Critical Current

Links

Classifications

    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02DCLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
    • Y02D10/00Energy efficient computing, e.g. low power processors, power management or thermal management

Landscapes

  • Microcomputers (AREA)

Abstract

PURPOSE:To reduce the time required for performing a pull-up resistance disconnecting process so as to reduce the power by adding a level setting resistance (pull-up resistance) permit flag. CONSTITUTION:A pull-up resistance permit flag 65 and AND gates 81 and 82 are added to an input-output circuit 70. When the flag 65 is '0', the output of the gate 81 becomes '0' irrespective of the value of a pull-up resistance connection designating signal 25 at each input-output port 110 of an input-output port 51 and a transistor Tr 152 is turned off. Therefore, all pull-up resistances are disconnected. The same can be said to each input-output control circuit ill of another input-output port 61. In addition, when the pull-up resistance permit flag is added to each input-output port and the ports are mapped to the same address, the control of connection and disconnection of the pull-up resistances become possible at every input-output port.

Description

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

【0001】0001

【産業上の利用分野】本発明はシングルチップマイクロ
コンピュータに関する。
BACKGROUND OF THE INVENTION 1. Field of the Invention The present invention relates to single-chip microcomputers.

【0002】0002

【従来の技術】近年、マイクロコンピュータが高機能化
及び高性能化するにつれて、マイクロコンピュータの応
用範囲がますます広くなりつつある。シングルチップマ
イクロコンピュータ(以下、シングルチップマイコンと
称す)においては、周辺機能を内部に取り込むことによ
りシステムのワンチップ化をはかっている。このような
機能のひとつにプルアップ抵抗の内蔵がある。プルアッ
プ抵抗をマイコン内部に内蔵することによりシステム全
体の部品数及びコストを削減することができる。一方、
シングルチップマイコンにおけるパワーの削減がますま
す重要になってきている。
2. Description of the Related Art In recent years, as microcomputers have become more sophisticated and performant, the range of applications for microcomputers has become wider and wider. In single-chip microcomputers (hereinafter referred to as single-chip microcomputers), the system is integrated into one chip by incorporating peripheral functions internally. One such feature is a built-in pull-up resistor. By incorporating the pull-up resistor inside the microcontroller, the number of components and cost of the entire system can be reduced. on the other hand,
Power reduction in single-chip microcontrollers is becoming increasingly important.

【0003】入力ポートにおいて、入力レベルがロウの
時は、プルアップ抵抗自身でパワーを消費するために、
パワーの削減を考慮するとプルアップ抵抗を切り離す必
要がある。そのために、プルアップ抵抗の接続及び切り
離しがソフトウエア処理により可能でなければならない
。たとえば消費電力が重要視されるバッテリ駆動の装置
において、メインバッテリが抜かれた際、動作電源とし
てサブバッテリに切り替わる。この時メインバッテリが
抜かれて、サブバッテリに切り替わったことを検出して
、パワー削減のために、入力ポートに接続したプルアッ
プ抵抗を切り離す必要がある。
At the input port, when the input level is low, the pull-up resistor itself consumes power, so
Considering power reduction, it is necessary to disconnect the pull-up resistor. For this purpose, it is necessary to be able to connect and disconnect the pull-up resistor through software processing. For example, in a battery-powered device where power consumption is important, when the main battery is removed, the operating power source is switched to the sub-battery. At this time, it is necessary to detect that the main battery has been removed and switched to the sub battery and disconnect the pull-up resistor connected to the input port to reduce power.

【0004】従って、入力モードになっているポートを
検出して入力モードになっているポートに対してプルア
ップ抵抗を切り離すために、各入力ポート毎にプルアッ
プ抵抗を切り離すための命令を実行しなければならない
[0004] Therefore, in order to detect a port that is in input mode and disconnect the pull-up resistor for the port that is in input mode, a command for disconnecting the pull-up resistor is executed for each input port. There must be.

【0005】図3は、従来のシングルチップマイコン6
のブロック図である。図3に示すシングルチップマイコ
ン6は、シングルチップマイコン6全体の動作を制御す
る中央処理装置1(以下、“CPU”と称す)と、プロ
グラム及びデータを格納するメモリ2と、周辺動作を行
なう周辺回路3と、入出力回路5と、外部端子10,1
1,12,13、で構成しており、これらは内部バス4
で接続している。CPU1から入出力回路5に外部端子
10,11,12,13の入力レベルをリードするリー
ド信号17,18を供給する。
FIG. 3 shows a conventional single-chip microcomputer 6.
FIG. The single-chip microcomputer 6 shown in FIG. 3 includes a central processing unit 1 (hereinafter referred to as "CPU") that controls the overall operation of the single-chip microcomputer 6, a memory 2 that stores programs and data, and peripherals that perform peripheral operations. Circuit 3, input/output circuit 5, and external terminals 10 and 1
1, 12, and 13, and these are internal bus 4.
It is connected with Read signals 17 and 18 for reading input levels of external terminals 10, 11, 12, and 13 are supplied from the CPU 1 to the input/output circuit 5.

【0006】図4は、入出力回路5の詳細ブロック図で
ある。入出力回路5は、入出力ポート50,60で構成
しており、それぞれI/Oマッピングされている。入出
力ポート50と60は、I/Oマッピングのアドレスが
異なるのみで基本構成及び動作は同様であるので入出力
ポート50についてのみ図4を用いて以下説明する。入
出力制御回路100は入出力ポート50を構成する1ビ
ットの入出力制御回路である。
FIG. 4 is a detailed block diagram of the input/output circuit 5. The input/output circuit 5 is composed of input/output ports 50 and 60, each of which is I/O mapped. Since the input/output ports 50 and 60 have the same basic configuration and operation except for the I/O mapping address, only the input/output port 50 will be described below using FIG. 4. The input/output control circuit 100 is a 1-bit input/output control circuit that constitutes the input/output port 50.

【0007】入出力制御回路100は、入出力設定フラ
グ21と、出力ラッチ22と、デコーダ20と、nチャ
ネルトランジスタTr150,Tr151,Tr152
と、リートバッファ15で構成している。入出力設定フ
ラグ21は、入出力制御回路100を入力又は出力モー
ドに設定するフラグである。出力ラッチ22は、入出力
制御回路100が出力モードの時に外部端子100を介
してシングルチップマイコン6の外部に出力するデータ
を格納するラッチである。
The input/output control circuit 100 includes an input/output setting flag 21, an output latch 22, a decoder 20, and n-channel transistors Tr150, Tr151, and Tr152.
and a REIT buffer 15. The input/output setting flag 21 is a flag for setting the input/output control circuit 100 to input or output mode. The output latch 22 is a latch that stores data to be output to the outside of the single-chip microcomputer 6 via the external terminal 100 when the input/output control circuit 100 is in the output mode.

【0008】デコーダ20は入出力設定フラグ21と出
力ラッチ22に格納されたデータをデコードしてデコー
ド結果として入出力制御信号23,24と、プルアップ
抵抗接続指定信号25を出力する。入出力制御信号23
,24の各状態によりTr150とTr151のオン・
オフの制御を行ない、入出力制御回路100の“0”,
“1”出力及びフローティング状態の切り替えを行なう
。プルアップ抵抗接続指定信号25はTr152のオン
・オフの制御を行なうことにより、Tr152自身のオ
ン抵抗を利用してプルアップ抵抗の接続を制御する。
The decoder 20 decodes the data stored in the input/output setting flag 21 and the output latch 22, and outputs input/output control signals 23, 24 and a pull-up resistor connection designation signal 25 as the decoded results. Input/output control signal 23
, 24, Tr150 and Tr151 are turned on/off.
Performs OFF control and sets the input/output control circuit 100 to “0”.
Switches between “1” output and floating state. The pull-up resistor connection designation signal 25 controls the on/off state of the Tr 152, thereby controlling the connection of the pull-up resistor using the on-resistance of the Tr 152 itself.

【0009】リードバッファ15は、リード信号17が
“1”の時、アクティブになり外部端子10を介して入
力した信号レベルを内部バス4に取り込む。
The read buffer 15 becomes active when the read signal 17 is "1" and takes in the signal level input via the external terminal 10 to the internal bus 4.

【0010】表1に入出力設定フラグ21と出力ラッチ
22のデータの組み合わせによるデコーダ20のデコー
ド出力を示す。
Table 1 shows the decoded output of the decoder 20 based on the combination of the input/output setting flag 21 and the data of the output latch 22.

【0011】[0011]

【0012】入出力設定フラグ21が“0”の時入出力
制御回路100は出力モードになる。出力モードにおい
て出力ラッチ22が“0”の時Tr150がオフ,Tr
151がオンになり、外部端子10からVSSレベルを
出力し、出力ラッチが“1”の時Tr150がオン,T
r151がオフになり、外部端子10からVDDレベル
を出力する。
When the input/output setting flag 21 is "0", the input/output control circuit 100 is in the output mode. In the output mode, when the output latch 22 is “0”, the Tr150 is turned off and the Tr
151 is turned on, outputs VSS level from external terminal 10, and when the output latch is "1", Tr150 is turned on, T
r151 is turned off and the VDD level is output from the external terminal 10.

【0013】次に入出力設定フラグ21が“1”の時は
、入出力制御回路100においてTr150,151共
にオフになり入力モードになる。入力モードにおいて、
出力ラッチ22が“0”の時、Tr152がオフになり
、プルアップ抵抗を接続しない。出力ラッチ22が“1
”の時Tr152がオンになり、プルアップ抵抗を接続
する。
Next, when the input/output setting flag 21 is "1", the input/output control circuit 100 turns off both Tr 150 and Tr 151 and enters the input mode. In input mode,
When the output latch 22 is "0", the Tr 152 is turned off and no pull-up resistor is connected. Output latch 22 is “1”
”, the Tr152 is turned on and the pull-up resistor is connected.

【0014】以上のように入出力モードの設定及びプル
アップ抵抗の接続指定が各入出力端子毎に可能である。
As described above, it is possible to set the input/output mode and specify the connection of the pull-up resistor for each input/output terminal.

【0015】同様に表2に入出力ポート60における入
出力設定フラグ31と出力ラッチ32のデータの組み合
わせによるデコーダ30のデコード出力を示す。
Similarly, Table 2 shows the decoded output of the decoder 30 based on the combination of the input/output setting flag 31 at the input/output port 60 and the data of the output latch 32.

【0016】[0016]

【0017】入出力設定フラグ31と出力ラッチ32に
データを設定することにより、入出力ポート60におい
て、入出力モードの設定及びプルアップ抵抗の接続指定
を、各入出力端子毎に設定することが可能である。
By setting data in the input/output setting flag 31 and output latch 32, the input/output mode setting and pull-up resistor connection designation can be set for each input/output terminal at the input/output port 60. It is possible.

【0018】[0018]

【発明が解決しようとする課題】上述した従来の入出力
回路を内蔵したシングルチップマイコンは、各入出力ポ
ート毎に別アドレスにマッピグした出力ラッチにデータ
を設定することにより、入力端子のプルアップ抵抗の接
続と切り離しの制御を行なっているので接続されたプル
アップ抵抗を切り離すためには入力モードに設定してい
るポートを検出し、出力ラッチに“0”をライトする処
理が全ポートに対して必要なため全てのプルアップ抵抗
を切り離すまでに時間を要し、その間パワーを消費する
という欠点がある。
[Problems to be Solved by the Invention] The conventional single-chip microcontroller with built-in input/output circuits described above pulls up input terminals by setting data in output latches mapped to separate addresses for each input/output port. Since the connection and disconnection of the resistor is controlled, in order to disconnect the connected pull-up resistor, the process of detecting the port set to input mode and writing “0” to the output latch is necessary for all ports. This has the disadvantage that it takes time to disconnect all pull-up resistors, and power is consumed during that time.

【0019】特にバッテリ駆動の装置において、動作電
源をメインバッテリからサブバッテリに切り替わった際
にソフトウエアによるプルアップ抵抗の切り離し処理に
よりサブバッテリのパワーを消費するためサブバッテリ
の寿命を短くするという欠点がある。
Particularly in battery-powered devices, when the operating power source is switched from the main battery to the sub-battery, the pull-up resistor is disconnected by software, which consumes the power of the sub-battery, which shortens the life of the sub-battery. There is.

【0020】本発明の目的は、プルアップ抵抗切り離し
処理の時間を短縮し、パワーを削減できるシングルチッ
プマイクロコンピュータを提供することにある。
An object of the present invention is to provide a single-chip microcomputer that can shorten the time required to disconnect the pull-up resistor and reduce power.

【0021】[0021]

【課題を解決するための手段】本発明のシングルチップ
マイクロコンピュータは、入出力モードを設定する入出
力設定フラグと出力データを格納する出力ラッチとプル
アップ抵抗と、入出力設定フラグ及び出力ラッチに設定
した値をデコードしてプルアップ抵抗の接続指定を許可
するデコーダからなる入出力回路を備えたシングルチッ
プマイクロコンピュータにおいて、プルアップ抵抗の接
続を許可するプルアップ抵抗許可フラグを付加し、デコ
ーダ出力とプルアップ抵抗許可フラグの設定値によりプ
ルアップ抵抗の接続指定を許可する手段を有している。
[Means for Solving the Problems] The single-chip microcomputer of the present invention includes an input/output setting flag for setting an input/output mode, an output latch and a pull-up resistor for storing output data, and an input/output setting flag and an output latch for storing output data. In a single-chip microcomputer equipped with an input/output circuit consisting of a decoder that decodes a set value and allows connection of a pull-up resistor, a pull-up resistor permission flag that allows the connection of a pull-up resistor is added, and the decoder output and means for permitting specification of connection of a pull-up resistor based on a set value of a pull-up resistor permission flag.

【0022】また、入出力回路毎にプルアップ抵抗の接
続指定を許可するプルアップ抵抗選択フラグを付加し、
デコーダ出力とプルアップ抵抗選択フラグの指定値によ
りプルアップ抵抗の接続指定を入出力回路毎に許可する
手段を有している。
[0022] Furthermore, a pull-up resistor selection flag is added to allow connection of a pull-up resistor to be specified for each input/output circuit.
The device includes means for permitting connection of a pull-up resistor to be designated for each input/output circuit based on a decoder output and a designated value of a pull-up resistor selection flag.

【0023】[0023]

【実施例】図1は本発明の一実施例におけるシングルチ
ップマイコンの入出力回路70のブロック図である。本
実施例では従来例と異なり、プルアップ抵抗の接続を許
可するかしないかを制御するフラグを備え、プルアップ
抵抗の接続をただちに切り離すことが可能である。
DESCRIPTION OF THE PREFERRED EMBODIMENTS FIG. 1 is a block diagram of an input/output circuit 70 of a single-chip microcomputer in an embodiment of the present invention. In this embodiment, unlike the conventional example, a flag is provided to control whether connection of a pull-up resistor is permitted or not, and it is possible to immediately disconnect the pull-up resistor.

【0024】図1の入出力回路70において、入出力設
定フラグ21,31と、出力ラッチ22,32と、デコ
ーダ20,30とトランジスタTr150,151,1
52,153,154,155と、デコーダ20のデコ
ード信号23,24,25とデコーダ30のデコード信
号33,34,35とリードバッファ15,16のリー
ド信号17,18は従来例の入出力回路5と同様である
ので説明を省略する。
In the input/output circuit 70 shown in FIG.
52, 153, 154, 155, decode signals 23, 24, 25 of the decoder 20, decode signals 33, 34, 35 of the decoder 30, and read signals 17, 18 of the read buffers 15, 16 are the input/output circuit 5 of the conventional example. Since it is the same as that, the explanation will be omitted.

【0025】入出力回路70は図4の入出力回路5に対
して、プルアップ抵抗許可フラグ65と、ANDゲート
81,82を追加したものである。プルアップ抵抗許可
フラグ65は、各入力端子におけるプルアップ抵抗の接
続指定を許可するフラグで“1”の時許可“0”の時は
許可しないフラグであり、アドレスマッピングされてい
る。プルアップ抵抗許可フラグ65からプルアップ抵抗
許可信号66を出力し、各入出力制御回路に供給する。
The input/output circuit 70 is the input/output circuit 5 of FIG. 4 with the addition of a pull-up resistor permission flag 65 and AND gates 81 and 82. The pull-up resistor permission flag 65 is a flag that allows specifying the connection of a pull-up resistor at each input terminal, and is a flag that allows when it is "1" and disallows when it is "0", and is address-mapped. A pull-up resistor enable signal 66 is output from the pull-up resistor enable flag 65 and supplied to each input/output control circuit.

【0026】入出力制御回路110の動作について以下
説明を行なう。入出力設定フラグ21と、出力ラッチ2
2とデコーダ20とTr150,151,152とリー
ドバッファ150の動作については図4の従来の入出力
制御回路100と同様である。
The operation of the input/output control circuit 110 will be explained below. Input/output setting flag 21 and output latch 2
2, the decoder 20, the transistors 150, 151, 152, and the read buffer 150 are similar to the conventional input/output control circuit 100 shown in FIG.

【0027】ANDゲート81はプルアップ抵抗許可信
号66とプルアップ抵抗接続指定信号25を入力とし、
出力信号をTr152に供給する。
The AND gate 81 inputs the pull-up resistor enable signal 66 and the pull-up resistor connection designation signal 25,
The output signal is supplied to Tr152.

【0028】表3に、入出力設定フラグ21と、出力ラ
ッチ22と、プルアップ抵抗許可フラグ65の各データ
の組み合わせによるデコーダ20のデコーダ出力を示す
Table 3 shows the decoder output of the decoder 20 based on the combination of each data of the input/output setting flag 21, the output latch 22, and the pull-up resistor permission flag 65.

【0029】[0029]

【0030】入出力設定フラグ21が“0”の時は、プ
ルアップ抵抗許可フラグ65のデータにかかわらず、入
出力制御回路110は出力モードになる。入出力設定フ
ラグ21が“1”で出力ラッチ22が“0”の時は、入
力モードになり又プルアップ抵抗接続指定信号25が“
0”であるのでTr152がオフになり、プルアップ抵
抗を接続しない。
When the input/output setting flag 21 is "0", the input/output control circuit 110 is in the output mode regardless of the data of the pull-up resistor permission flag 65. When the input/output setting flag 21 is “1” and the output latch 22 is “0”, the input mode is entered and the pull-up resistor connection designation signal 25 is “0”.
0'', Tr152 is turned off and no pull-up resistor is connected.

【0031】次に、入出力設定フラグ21と出力ラッチ
22が共に“1”の時は入力モードになり、プルアップ
抵抗接続指定信号25が“1”になる。従ってANDゲ
ート81の出力はプルアップ抵抗許可フラグ65のデー
タにより決まる。プルアップ抵抗許可フラグ65が“0
”の時はANDゲート81の出力が“0”になりTr1
52はオフになる。よってプルアップ抵抗を接続しない
。プルアップ抵抗許可フラグ65が“1”の時はAND
ゲート81の出力が“1”になり、Tr152はオンに
なる。よってプルアップ抵抗を接続する。
Next, when the input/output setting flag 21 and the output latch 22 are both "1", the input mode is entered and the pull-up resistor connection designation signal 25 becomes "1". Therefore, the output of the AND gate 81 is determined by the data of the pull-up resistor permission flag 65. Pull-up resistance enable flag 65 is “0”
”, the output of the AND gate 81 becomes “0” and Tr1
52 is turned off. Therefore, do not connect a pull-up resistor. AND when the pull-up resistor permission flag 65 is “1”
The output of the gate 81 becomes "1" and the Tr 152 is turned on. Therefore, connect a pull-up resistor.

【0032】同様にプルアップ抵抗接続指定信号66を
入出力ポート51の各入出力制御回路に供給することに
より、プルアップ抵抗許可フラグ65のデータにより入
出力ポート51における各入力端子のプルアップ抵抗を
接続したり又は切り離したりすることができる。
Similarly, by supplying the pull-up resistor connection designation signal 66 to each input/output control circuit of the input/output port 51, the pull-up resistor of each input terminal of the input/output port 51 is set according to the data of the pull-up resistor permission flag 65. can be connected or disconnected.

【0033】次に入出力ポート61における入出力制御
回路111について以下説明を行なう。
Next, the input/output control circuit 111 in the input/output port 61 will be explained below.

【0034】表4に、入出力設定フラグ31と出力ラッ
チ32とプルアップ抵抗許可フラグ65の各データの組
み合わせによるデコーダ30のデコーダ出力を示す。
Table 4 shows the decoder output of the decoder 30 based on each data combination of the input/output setting flag 31, the output latch 32, and the pull-up resistor permission flag 65.

【0035】[0035]

【0036】ANDゲート82は、プルアップ抵抗許可
信号66とプルアップ抵抗接続指定信号35を入力とし
、出力信号をTr155に供給する。従ってプルアップ
抵抗許可フラグ65が“0”の時は、プルアップ抵抗接
続指定信号35の値にかかわらずAND82の出力が“
0”になり、Tr155はオフになる。同様に、プルア
ップ抵抗許可フラグ65のデータにより、入出力ポート
61における各入力端子のプルアップ抵抗を接続したり
切り離したりすることができる。
The AND gate 82 inputs the pull-up resistor enable signal 66 and the pull-up resistor connection designation signal 35, and supplies an output signal to the Tr 155. Therefore, when the pull-up resistor enable flag 65 is "0", the output of the AND82 is "0" regardless of the value of the pull-up resistor connection designation signal 35.
0'' and the Tr 155 is turned off. Similarly, the pull-up resistors of each input terminal in the input/output port 61 can be connected or disconnected based on the data of the pull-up resistor permission flag 65.

【0037】以上述べたように本実施例によれば、プル
アップ抵抗許可フラグ65に設定した値により、入出力
回路70における入力端子に接続した全プルアップ抵抗
の接続を切り離すことが可能である。従って、バッテリ
駆動の装置において、動作電源がメインバッテリからサ
ブバッテリに切り替わった直後に1命令実行してプルア
ップ抵抗許可フラグ65に“0”を設定することにより
全プルアップ抵抗を切り離すため、パワーの消費を削減
し、サブバッテリの寿命をより長くすることができる。
As described above, according to this embodiment, it is possible to disconnect all pull-up resistors connected to the input terminals in the input/output circuit 70, depending on the value set in the pull-up resistor permission flag 65. . Therefore, in a battery-powered device, all pull-up resistors are disconnected by executing one command and setting the pull-up resistor permission flag 65 to "0" immediately after the operating power source is switched from the main battery to the sub-battery. can reduce consumption and extend the life of the sub-battery.

【0038】図2は本発明の第2の実施例におけるシン
グルチップマイコンの入出力回路71のブロック図であ
る。本実施例では、入出力ポート52におけるプルアッ
プ抵抗の接続を許可するフラグと、入出力ポート62に
おけるプルアップ抵抗の接続を許可するフラグがそれぞ
れ別個に存在し、プルアップ抵抗の切り離しを入出力ポ
ート毎に指定することが可能である。
FIG. 2 is a block diagram of an input/output circuit 71 of a single-chip microcomputer in a second embodiment of the present invention. In this embodiment, there are separate flags for permitting the connection of the pull-up resistor at the input/output port 52 and flags for permitting the connection of the pull-up resistor for the input/output port 62, and the disconnection of the pull-up resistor is determined from the input/output port. It is possible to specify each port.

【0039】図2の入出力回路71において入出力設定
フラグ21,31と出力ラッチ22,32と、デコーダ
20,30と、トランジスタTr150,151,15
2,153,154,155と、デコータ20のデコー
ド信号23,24,25と、デコーダ30のデコード信
号33,34,35とリードバッファ15,16と、リ
ード信号17,18は従来例の入出力回路5と同様であ
るので説明を省略する。
In the input/output circuit 71 shown in FIG.
2, 153, 154, 155, decode signals 23, 24, 25 of the decoder 20, decode signals 33, 34, 35 of the decoder 30, read buffers 15, 16, and read signals 17, 18 are input/output signals of the conventional example. Since it is the same as circuit 5, the explanation will be omitted.

【0040】入出力回路71は図4の入出力回路5に対
してプルアップ抵抗許可フラグ70,71とANDゲー
ト83,84を追加する。プルアップ抵抗許可フラグ9
0は入出力ポート52の各入力端子にプルアップ抵抗の
接続を許可するフラグであり、プルアップ抵抗許可フラ
グ91は、入出力ポート62の各入力端子にプルアップ
抵抗の接続を許可するフラグである。プルアップ抵抗許
可フラグ90,91は同一アドレスにアドレスマッピン
グを行ない、同時にデータが設定可能である。ANDゲ
ート83はプルアップ抵抗許可信号72と、プルアップ
抵抗接続指定信号25を入力とし、出力信号をTr15
2に供給する。ANDゲート84はプルアップ抵抗許可
信号73とプルアップ抵抗接続指定信号35を入力とし
出力信号をTr155に供給する。
The input/output circuit 71 adds pull-up resistor permission flags 70, 71 and AND gates 83, 84 to the input/output circuit 5 of FIG. Pull-up resistance enable flag 9
0 is a flag that permits the connection of a pull-up resistor to each input terminal of the input/output port 52, and the pull-up resistor permission flag 91 is a flag that permits the connection of a pull-up resistor to each input terminal of the input/output port 62. be. The pull-up resistance permission flags 90 and 91 perform address mapping to the same address, and data can be set at the same time. The AND gate 83 inputs the pull-up resistor enable signal 72 and the pull-up resistor connection designation signal 25, and outputs the output signal from the Tr15.
Supply to 2. The AND gate 84 inputs the pull-up resistor enable signal 73 and the pull-up resistor connection designation signal 35 and supplies an output signal to the Tr 155.

【0041】入出力制御回路52の動作について以下説
明を行なう。表5に入出力フラグ21と出力ラッチ22
とプルアップ抵抗許可フラグ90の各データの組み合わ
せによるデコーダ20のデコード出力を示す。
The operation of the input/output control circuit 52 will be explained below. Table 5 Input/output flag 21 and output latch 22
The decoded output of the decoder 20 based on the combination of the data of the pull-up resistor permission flag 90 and the pull-up resistor permission flag 90 is shown.

【0042】[0042]

【0043】入出力設定フラグ21と“1”に出力ラッ
チ22に“1”を設定すると、入力モードになり、プル
アップ抵抗接続指示信号25が“1”になる。従ってA
NDゲート83の出力値は、プルアップ抵抗許可フラグ
90に設定したデータにより決まり、プルアップ抵抗許
可フラグ90に“0”を設定すると、Tr152がオフ
になり、プルアップ抵抗を切り離す。
When the input/output setting flag 21 is set to "1" and the output latch 22 is set to "1", the input mode is entered and the pull-up resistor connection instruction signal 25 becomes "1". Therefore A
The output value of the ND gate 83 is determined by the data set in the pull-up resistor enable flag 90, and when the pull-up resistor enable flag 90 is set to "0", the Tr 152 is turned off and the pull-up resistor is disconnected.

【0044】同様に、プルアップ抵抗許可フラグ90に
“0”を設定することにより、入出力ポート52の各入
力端子に接続した全プルアップ抵抗の接続を切り離すこ
とが可能である。
Similarly, by setting the pull-up resistor permission flag 90 to "0", it is possible to disconnect all pull-up resistors connected to each input terminal of the input/output port 52.

【0045】次に入出力ポート62の動作について以下
説明を行なう。
Next, the operation of the input/output port 62 will be explained below.

【0046】表6に入出力設定フラグ31と出力ラッチ
32とプルアップ抵抗フラグ91の各データの組み合わ
せによるデコーダ30のデコード出力を示す。
Table 6 shows the decoded output of the decoder 30 based on each data combination of the input/output setting flag 31, the output latch 32, and the pull-up resistor flag 91.

【0047】[0047]

【0048】入出力設定フラグ31を“1”に出力ラッ
チ32を“1”に設定すると入力モードになりプルアッ
プ抵抗接続指示信号35が“1”になる。従ってAND
ゲート84の出力値はプルアップ抵抗許可フラグ91に
設定したデータにより決まり、プルアップ抵抗許可フラ
グ91に“0”を設定するとTr155がオフになりプ
ルアップ抵抗を切り離す。
When the input/output setting flag 31 is set to "1" and the output latch 32 is set to "1", the input mode is entered and the pull-up resistor connection instruction signal 35 becomes "1". Therefore, AND
The output value of the gate 84 is determined by the data set in the pull-up resistor enable flag 91, and when the pull-up resistor enable flag 91 is set to "0", the Tr 155 is turned off and the pull-up resistor is disconnected.

【0049】同様にプルアップ抵抗許可フラグ91に“
0”を設定することにより入出力ポート62の各入力端
子に接続した全プルアップ抵抗の接続を切り離すことが
可能である。
Similarly, the pull-up resistance permission flag 91 is set to “
By setting the value to 0'', it is possible to disconnect all pull-up resistors connected to each input terminal of the input/output port 62.

【0050】以上説明したように各入出力ポート毎にプ
ルアップ抵抗許可フラグを内蔵することにより、プルア
ップ抵抗の接続を切り離したいポートのみ、プルアップ
抵抗の接続を切り離すことが可能である。たとえば外部
からの信号が中間電位になるような信号が接続されてい
る場合は、プルアップ抵抗を接続した状態にしておくこ
とにより、よりパワーの消費が削減できる効果がある。
As described above, by incorporating a pull-up resistor permission flag for each input/output port, it is possible to disconnect the pull-up resistor only for the port for which the pull-up resistor is to be disconnected. For example, if a signal from the outside that has an intermediate potential is connected, leaving a pull-up resistor connected has the effect of further reducing power consumption.

【0051】[0051]

【発明の効果】以上説明したように本発明は、プルアッ
プ抵抗の接続を許可するプルアップ抵抗許可フラグを付
加し、プルアップ抵抗許可フラグに“1”を設定するこ
とにより、各入力ポートでのプルアップ抵抗の接続指定
が可能になる。又、プルアップ抵抗許可フラグに“0”
を設定することにより各入力ポートでのプルアップ抵抗
の接続指定にかかわらずただちに全入力ポートのプルア
ップ抵抗の接続を切り離し、ビット単位でのプルアップ
抵抗の接続と切り離し制御が可能である。さらに、全入
力ポートに対し、プルアップ抵抗の接続と切り離し制御
が可能であるので、1命令を実行してプルアップ抵抗許
可フラグに“0”を設定することでただちに全入力ポー
トのプルアップ抵抗を切り離すことができる。従って、
プルアップ抵抗切り離し処理による時間が大幅に短くな
り、パワーを削減することができる効果がある。
[Effects of the Invention] As explained above, the present invention adds a pull-up resistor permission flag that allows the connection of a pull-up resistor, and sets the pull-up resistor permission flag to "1", thereby allowing each input port to It becomes possible to specify the connection of a pull-up resistor. Also, the pull-up resistor enable flag is set to “0”.
By setting , it is possible to immediately disconnect the pull-up resistors of all input ports regardless of the connection specification of the pull-up resistors at each input port, and to control the connection and disconnection of pull-up resistors on a bit-by-bit basis. Furthermore, it is possible to control the connection and disconnection of pull-up resistors for all input ports, so by executing one instruction and setting the pull-up resistor permission flag to "0", you can immediately connect and disconnect pull-up resistors for all input ports. can be separated. Therefore,
The time taken to disconnect the pull-up resistor is greatly shortened, which has the effect of reducing power.

【0052】又、各入出力回路毎にプルアップ抵抗許可
フラグを付加し、同一アドレスにマッピングすることに
より1命令を実行してプルアップ抵抗許可フラグに“0
”を設定することで各入出力ポート毎のプルアップ抵抗
の接続と切り離し制御が可能であるという効果がある。
Furthermore, by adding a pull-up resistor enable flag to each input/output circuit and mapping it to the same address, one instruction is executed and the pull-up resistor enable flag is set to "0".
By setting ``, it is possible to control the connection and disconnection of the pull-up resistor for each input/output port.

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

【図1】本発明の第1の実施例の入出力回路のブロック
図である。
FIG. 1 is a block diagram of an input/output circuit according to a first embodiment of the present invention.

【図2】本発明の第2の実施例の入出力回路のブロック
図である。
FIG. 2 is a block diagram of an input/output circuit according to a second embodiment of the present invention.

【図3】従来のシングルチップマイコンのブロック図で
ある。
FIG. 3 is a block diagram of a conventional single-chip microcomputer.

【図4】従来のシングルチップマイコンの入出力回路の
ブロック図である。
FIG. 4 is a block diagram of an input/output circuit of a conventional single-chip microcomputer.

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

1    CPU 2    メモリ 3    周辺回路 4    内部バス 5,70,71    入出力回路 6    シングルチップマイコン 10,11,12,13    外部端子17,18 
   リード信号 21,31    入出力設定フラグ 22,32    出力ラッチ 20,30    デコーダ 15,16    リードバッファ
1 CPU 2 Memory 3 Peripheral circuit 4 Internal bus 5, 70, 71 Input/output circuit 6 Single chip microcomputer 10, 11, 12, 13 External terminal 17, 18
Read signals 21, 31 Input/output setting flags 22, 32 Output latches 20, 30 Decoders 15, 16 Read buffer

Claims (2)

【特許請求の範囲】[Claims] 【請求項1】  入出力モードを設定する入出力設定フ
ラグと、出力データを格納する出力ラッチと、一端を正
電位もしくは負電位に接続したレベル設定抵抗と、前記
入出力設定フラグ及び前記出力ラッチに設定した値をデ
コードして前記レベル設定抵抗の接続指定を行なうデコ
ーダからなる入出力回路を備えたシングルチップマイク
ロコンピュータにおいて、前記レベル設定抵抗の接続を
許可するレベル設定抵抗許可フラグを付加し、前記デコ
ーダ出力と前記レベル設定抵抗許可フラグの設定値によ
り前記レベル設定抵抗の接続指定を許可する手段を有す
ることを特徴とするシングルチップマイクロコンピュー
タ。
1. An input/output setting flag for setting an input/output mode, an output latch for storing output data, a level setting resistor with one end connected to a positive potential or a negative potential, the input/output setting flag and the output latch. In a single-chip microcomputer equipped with an input/output circuit consisting of a decoder that decodes a value set in and specifies connection of the level setting resistor, a level setting resistor permission flag is added to permit connection of the level setting resistor, A single-chip microcomputer comprising means for permitting connection designation of the level setting resistor based on the decoder output and a set value of the level setting resistor permission flag.
【請求項2】  請求項1記載のシングルチップマイク
ロコンピュータにおいて、入出力回路毎に前記レベル設
定抵抗の接続許可を指定するレベル設定抵抗選択フラグ
を付加し、前記デコーダ出力と前記レベル設定抵抗選択
フラグの設定値により、前記レベル設定抵抗の接続指定
を入出力回路毎に許可する手段を有することを特徴とす
るシングルチップマイクロコンピュータ。
2. The single-chip microcomputer according to claim 1, wherein a level setting resistor selection flag for specifying connection permission of the level setting resistor is added to each input/output circuit, and the decoder output and the level setting resistor selection flag are added to each input/output circuit. 1. A single-chip microcomputer comprising means for permitting connection designation of the level setting resistor for each input/output circuit based on a set value.
JP3082789A 1991-04-16 1991-04-16 Single-chip microcomputer Pending JPH04316173A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP3082789A JPH04316173A (en) 1991-04-16 1991-04-16 Single-chip microcomputer

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP3082789A JPH04316173A (en) 1991-04-16 1991-04-16 Single-chip microcomputer

Publications (1)

Publication Number Publication Date
JPH04316173A true JPH04316173A (en) 1992-11-06

Family

ID=13784176

Family Applications (1)

Application Number Title Priority Date Filing Date
JP3082789A Pending JPH04316173A (en) 1991-04-16 1991-04-16 Single-chip microcomputer

Country Status (1)

Country Link
JP (1) JPH04316173A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
DE19545940C2 (en) * 1994-12-15 2000-01-20 Mitsubishi Electric Corp Semiconductor device

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
DE19545940C2 (en) * 1994-12-15 2000-01-20 Mitsubishi Electric Corp Semiconductor device

Similar Documents

Publication Publication Date Title
KR960001273B1 (en) Single chip microcomputer
US4680487A (en) Input/output port including auxiliary low-power transistors
US4697107A (en) Four-state I/O control circuit
US7076612B2 (en) Cache interface circuit for automatic control of cache bypass modes and associated power savings
KR900005282A (en) Single chip microcomputer
US8570085B2 (en) Low consumption flip-flop circuit with data retention and method thereof
US5659763A (en) Apparatus and method for reducing power consumption by peripheral devices by controlling the interconnection of power supplies
JPH0157378B2 (en)
JPH04316173A (en) Single-chip microcomputer
US5559981A (en) Pseudo static mask option register and method therefor
JPS59231666A (en) Peripheral element of microprocessor
US20030188209A1 (en) Control circuit, electronic circuit, and method of saving power
JP3615189B2 (en) I / O buffer circuit
JP2504837B2 (en) Semiconductor integrated circuit device
JP2588911B2 (en) Memory card circuit
JPH08137823A (en) One-chip microcomputer for exclusive use of emulator
JP2924512B2 (en) Microcomputer
JP2782946B2 (en) Semiconductor integrated circuit
JP2978278B2 (en) Terminal function setting circuit
JP2552316B2 (en) CMOS semiconductor integrated circuit
GB2294339A (en) Power-saving in an expanded mode microcontroller
JP3015460B2 (en) Semiconductor integrated circuit
JP3161370B2 (en) Port shared circuit
CN111796539A (en) Low-power consumption MCU circuit based on MRAM
JPH0973426A (en) Input/output port, input port, and microcontroller