JP2001290755A - Method for accessing eeprom and electronic device having eeprom - Google Patents

Method for accessing eeprom and electronic device having eeprom

Info

Publication number
JP2001290755A
JP2001290755A JP2000103429A JP2000103429A JP2001290755A JP 2001290755 A JP2001290755 A JP 2001290755A JP 2000103429 A JP2000103429 A JP 2000103429A JP 2000103429 A JP2000103429 A JP 2000103429A JP 2001290755 A JP2001290755 A JP 2001290755A
Authority
JP
Japan
Prior art keywords
serial
data
terminal
eeprom
output
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
JP2000103429A
Other languages
Japanese (ja)
Inventor
Teruhisa Saito
照久 斎藤
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.)
Saginomiya Seisakusho Inc
Original Assignee
Saginomiya Seisakusho Inc
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 Saginomiya Seisakusho Inc filed Critical Saginomiya Seisakusho Inc
Priority to JP2000103429A priority Critical patent/JP2001290755A/en
Publication of JP2001290755A publication Critical patent/JP2001290755A/en
Pending legal-status Critical Current

Links

Abstract

PROBLEM TO BE SOLVED: To read and write data from/to a serial EEPROM by using a serial communication function included in a microcomputer. SOLUTION: The serial clock output terminal 27 of the microcomputer 2, the serial data transmitting terminal 28 and the serial data receiving terminal 29 are connected to the clock input terminal 14 of the serial EEPROM 1, the data input terminal 12 and the data output terminal 11 respectively, and one output port 30 of the microcomputer 2 is also connected to the chip select terminal 13 of the EEPROM 1. A chip select signal is outputted from the port 30, and a signal composed of a plurality of blocks is also transmitted from the serial data output terminal 28 by dividing the start bit, an operation code and address data into a plurality of blocks so as to be the number of unit bits of serial communication with the least significant digit of the address data as reference and including '0' in front of a start bit about a block including the start bit.

Description

【発明の詳細な説明】DETAILED DESCRIPTION OF THE INVENTION

【0001】[0001]

【発明の属する技術分野】本発明は、シリアル入出力型
EEPROMへのアクセス方法およびEEPROMを有
する電子装置に関する。
[0001] 1. Field of the Invention [0002] The present invention relates to a method for accessing a serial input / output type EEPROM and an electronic device having the EEPROM.

【0002】[0002]

【従来の技術】EEPROM(electrically erasable
programmable ROM:電気的消去書込み可能型ROM)
は、書込みも消去も電気的に行うことのできる不揮発性
メモリであり、データのバックアップなどに幅広く使用
されている。EEPROMにはデータをパラレルに入出
力するパラレル入出力型のものと、シリアルに入出力す
るシリアル入出力型のものとがあるが、シングルチップ
マイクロコンピュータなどに接続する場合には、インタ
ーフェース負担の少ないシリアル入出力型のもの(シリ
アルEEPROM)が用いられることが多い。
2. Description of the Related Art EEPROM (electrically erasable)
programmable ROM: Electrically erasable and writable ROM)
Is a non-volatile memory that can electrically perform writing and erasing, and is widely used for data backup and the like. EEPROMs include a parallel input / output type for inputting / outputting data in parallel and a serial input / output type for inputting / outputting data serially. When connected to a single-chip microcomputer or the like, the interface load is small. A serial input / output type (serial EEPROM) is often used.

【0003】図3は、このようなシリアルEEPROM
の内部構成の一例を示す図である。この図に示すよう
に、シリアルEEPROM1は、データ出力端子11、
データ入力端子12、チップセレクト端子13、クロッ
ク入力端子14、電源端子15および接地端子16を有
している。また、21は、前記データ入力端子12から
の入力データ(DI)、チップセレクト端子13からの
チップセレクト信号(CS)およびクロック入力端子1
4からのシリアルクロック(SK)が入力され、前記入
力データDIに含まれているインストラクション(命
令)をデコードするインストラクションデコード部や前
記シリアルクロックSKに基づいて動作タイミング信号
を生成するタイミング回路などを含む制御部、22は前
記制御部21を介して供給されるアドレスデータを格納
するアドレスレジスタ、23はアドレスデコーダ、24
はメモリアレイ、25は該メモリアレイ24の前記アド
レスデータに対応するセルからデータを読み出したり、
あるいは、データを書き込む読出し書込み回路、26は
前記メモリアレイ24から読み出されたデータあるいは
メモリアレイ24に書き込むデータを格納するデータレ
ジスタ、27は前記データレジスタ26から直列に出力
される読出しデータを前記データ出力端子11に出力す
るバッファ回路である。
FIG. 3 shows such a serial EEPROM.
FIG. 3 is a diagram showing an example of the internal configuration of the device. As shown in this figure, the serial EEPROM 1 has a data output terminal 11,
It has a data input terminal 12, a chip select terminal 13, a clock input terminal 14, a power supply terminal 15, and a ground terminal 16. Reference numeral 21 denotes input data (DI) from the data input terminal 12, a chip select signal (CS) from the chip select terminal 13, and a clock input terminal 1.
4 includes an instruction decoding unit for receiving an instruction (command) included in the input data DI and a timing circuit for generating an operation timing signal based on the serial clock SK. A control unit 22 is an address register for storing address data supplied via the control unit 21; 23 is an address decoder;
Denotes a memory array, 25 reads data from a cell corresponding to the address data in the memory array 24,
Alternatively, a read / write circuit for writing data, 26 is a data register for storing data read from the memory array 24 or data to be written to the memory array 24, and 27 is a read / write circuit for serially outputting read data from the data register 26. This is a buffer circuit that outputs to the data output terminal 11.

【0004】このように構成されたシリアルEEPRO
Mの動作について、図4を参照しつつ説明する。ここ
で、図4の(a)はEEPROMのインストラクション
セットの一例を示し、(b)は書込み動作時におけるタ
イミングチャートを示す。なお、ここでは、このEEP
ROMは64ワード×16ビット構成とされているもの
として説明する。図4の(a)に示すように、このEE
PROMの命令は、1ビットのスタートビット+2ビッ
トのオペコードフィールド+6ビットのアドレスフィー
ルドから構成されており、書込み動作の場合には、これ
らに16ビットのデータフィールドが後続する。ここ
で、前記スタートビットは全てのインストラクションに
共通に論理「1」とされている。また、前記オペコード
フィールドが、「10」、「11」あるいは「01」の
ときは、それぞれ、アドレスフィールドのアドレスデー
タA5〜A0により指定されるワードに対する読出し、消去
あるいは書込みが行われる。さらに、前記オペコードフ
ィールドが「00」であるときは、前記アドレスフィー
ルドの上位2ビットの値に応じて、書込み許可、書込み
禁止、全アドレス消去あるいは全アドレスへのデータ書
込みの各処理が行われる。
[0004] The serial EEPROM configured as described above.
The operation of M will be described with reference to FIG. Here, FIG. 4A shows an example of an instruction set of the EEPROM, and FIG. 4B shows a timing chart during a write operation. Here, this EEP
The description will be made assuming that the ROM has a configuration of 64 words × 16 bits. As shown in FIG.
The PROM instruction is composed of a 1-bit start bit, a 2-bit opcode field, and a 6-bit address field. In the case of a write operation, these are followed by a 16-bit data field. Here, the start bit is set to logic "1" in common for all instructions. When the operation code field is "10", "11", or "01", reading, erasing, or writing is performed on the word specified by the address data A5 to A0 in the address field, respectively. Further, when the operation code field is "00", processing of write enable, write inhibit, erase all addresses, or write data to all addresses is performed according to the value of the upper two bits of the address field.

【0005】このようなEEPROMの動作について、
書込み動作を例にとって説明する。図4の(b)に示す
ように、まず、前記チップセレクト信号CS(チップセ
レクト端子14)を立ち上げ、インストラクションの実
行中、このCSをハイレベルに保持する。そして、クロ
ック入力端子14にシリアルクロックSKを供給する。
これにより、シリアルクロックSKの立ち上がりエッジ
によりデータ入力端子12から入力されるデータDIの
取込みが行われる。そして、前記データ入力端子12を
介して、スタートビット「1」、2ビットのオペコード
(この場合は「01」)、6ビットの書込みアドレス
(A5〜A0)、および、16ビットの書込みデータ(D15
〜D0)からなる入力データDIを順次入力する。ここ
で、前記制御部21は、前記データDIの取込みのとき
に最初に検出された「1」をスタートビットとして認識
し、その後に取り込まれたデータを順次オペコード、ア
ドレスデータおよびデータフィールドのデータとして取
り扱う。なお、最初の「1」より前の「0」のデータは
全て無視される。
[0005] Regarding the operation of such an EEPROM,
A description will be given of a write operation as an example. As shown in FIG. 4B, first, the chip select signal CS (chip select terminal 14) is started up, and during execution of the instruction, this CS is held at a high level. Then, the serial clock SK is supplied to the clock input terminal 14.
Thus, the data DI input from the data input terminal 12 is taken in at the rising edge of the serial clock SK. Then, via the data input terminal 12, a start bit "1", a 2-bit operation code (in this case, "01"), a 6-bit write address (A5 to A0), and 16-bit write data (D15
To D0) are sequentially input. Here, the control unit 21 recognizes “1” detected first at the time of capturing the data DI as a start bit, and sequentially captures the captured data as operation code, address data, and data field data. handle. Note that all data of “0” before the first “1” is ignored.

【0006】このようにして、インストラクションおよ
び書込みデータの転送が終了した後、前記チップセレク
トCSが所定期間ローレベルとされる。このCSの立ち
下がりからEEPROM1は自動プログラミングサイク
ルに入り、アドレスデータA5〜A0で指定されたアドレス
にデータ(D15〜D0)を書き込む。なお、このとき、前
記データ出力端子11の出力DOを参照することによ
り、EEPROM1の内部状態を知ることができる。す
なわち、前記CSが所定期間ローレベルとされてハイレ
ベルとなった後に、データ出力端子11からビジー/レ
ディ信号が出力される。
After the transfer of the instruction and the write data is completed, the chip select CS is set to the low level for a predetermined period. From the fall of CS, the EEPROM 1 enters an automatic programming cycle, and writes data (D15 to D0) to the address specified by the address data A5 to A0. At this time, the internal state of the EEPROM 1 can be known by referring to the output DO of the data output terminal 11. That is, a busy / ready signal is output from the data output terminal 11 after the CS is set to a low level for a predetermined period and then to a high level.

【0007】なお、図4の(b)には書込み動作時のタ
イミングチャートを示したが、読出し動作時において
も、同様に動作する。すなわち、前述と同様に、CSを
立ち上げ、シリアルクロックSKを供給するとともに、
スタートビット、オペコード(「10」)、アドレスデ
ータからなるデータDIを供給する。そして、この場合
には、前記アドレスフィールドのA0のアドレスを読み込
むシリアルクロックSKの立ち上がりからデータ出力端
子12が1ビットのダミービット「0」を出力し、引き
続いて、指定されたアドレスからの読出しデータD15〜D
0が順次シリアル出力されることとなる。なお、この場
合には、データ出力端子12からの出力データDOの転
送が終了するまで、前記シリアルクロックSKを供給す
る。また、その他のインストラクションについても、同
様に、チップセレクトCS、シリアルクロックSKおよ
びインストラクションデータが供給される。
Although FIG. 4B shows a timing chart at the time of the write operation, the same operation is performed at the time of the read operation. That is, in the same manner as described above, CS is started, the serial clock SK is supplied,
It supplies data DI consisting of a start bit, an operation code ("10"), and address data. In this case, the data output terminal 12 outputs a one-bit dummy bit "0" from the rising edge of the serial clock SK for reading the address of A0 in the address field, and subsequently reads out the read data from the designated address. D15-D
0 is serially output sequentially. In this case, the serial clock SK is supplied until the transfer of the output data DO from the data output terminal 12 is completed. Similarly, for other instructions, the chip select CS, the serial clock SK, and the instruction data are supplied.

【0008】[0008]

【発明が解決しようとする課題】前述のように、シリア
ルEEPROMはマイクロコンピュータを用いたシステ
ムあるいは電子装置におけるデータのバックアップ用に
広く用いられている。しかしながら、上述のように、シ
リアルEEPROMに対するインストラクションは、ス
タートビット、オペコード、書込みアドレスで構成され
ており、書込み動作時には、さらに書込みデータが後続
している。そして、スタートビットは1ビット、オペコ
ードは2ビット、書込みアドレスは例えば64ワードの
場合には6ビット、書込みデータは16ビットであるた
め、書込みデータを除いて8ビット単位あるいは16ビ
ット単位の送信でEEPROMに対するアクセスを行う
ことはできない。
As described above, serial EEPROMs are widely used for backing up data in systems using microcomputers or electronic devices. However, as described above, the instruction for the serial EEPROM is composed of a start bit, an operation code, and a write address, and at the time of a write operation, write data further follows. The start bit is 1 bit, the operation code is 2 bits, and the write address is, for example, 6 bits in the case of 64 words, and the write data is 16 bits. Access to the EEPROM cannot be performed.

【0009】通常、マイクロコンピュータ等にはシリア
ル通信インターフェースが搭載されており、所定のビッ
ト数(例えば、8ビット、16ビットなど)毎にシリア
ル通信を行うことができるようになされている。しかし
ながら、上述の理由により、シリアル通信機能が搭載さ
れているマイクロコンピュータを使ったシステムであっ
ても、その機能は使わず、専用ソフトウエアによりマイ
コンの出力ポートをハイレベル/ローレベルとすること
で前述したシリアルクロックSKを作り、該シリアルク
ロックSKに同期させて送信用の出力ポートを前記イン
ストラクションや書込みデータに応じてハイレベル/ロ
ーレベルとすることで、シリアルEEPROMに対して
アクセスしていた。
Normally, a microcomputer or the like is equipped with a serial communication interface so that serial communication can be performed every predetermined number of bits (for example, 8 bits, 16 bits, etc.). However, for the reasons described above, even in a system using a microcomputer equipped with a serial communication function, the function is not used, and the output port of the microcomputer is set to high level / low level by dedicated software. The serial EEPROM is accessed by synchronizing with the serial clock SK and setting the transmission output port to a high level / low level in accordance with the instruction or write data in synchronization with the serial clock SK.

【0010】このため、ソフトウエアが複雑となり、プ
ログラム容量が大きくなってしまうという問題点があっ
た。また、通信スピードが固定され、マイコンの処理速
度からみて速い速度でのEEPROMとの通信ができな
かった。さらに、専用のプログラムを用いてEEPRO
Mにアクセスしていたため、EEPROMとの通信中は
他の処理を行うことができないという問題があった。
[0010] For this reason, there has been a problem that software is complicated and a program capacity is increased. Further, the communication speed is fixed, and communication with the EEPROM cannot be performed at a high speed in view of the processing speed of the microcomputer. In addition, EEPRO using a dedicated program
Since M is accessed, there is a problem that other processing cannot be performed during communication with the EEPROM.

【0011】そこで、本発明は、マイクロコンピュータ
などに通常搭載されているシリアル通信インターフェー
スを用いてEEPROMにアクセスすることのできるE
EPROMアクセス方法およびEEPROMを有する電
子装置を提供することを目的としている。
Therefore, the present invention provides an EEPROM capable of accessing an EEPROM using a serial communication interface normally mounted on a microcomputer or the like.
It is an object to provide an EPROM access method and an electronic device having an EEPROM.

【0012】[0012]

【課題を解決するための手段】上記目的を達成するため
に、本発明のEEPROMアクセス方法は、チップセレ
クト端子、データ入力端子、データ出力端子およびクロ
ック入力端子を有し、スタートビットに引き続いてシリ
アルに入力されるオペコードとアドレスデータによりイ
ンストラクションが決定されるシリアル入出力型EEP
ROMに対するアクセス方法であって、シリアルデータ
送信端子、シリアルデータ受信端子およびクロック信号
を出力するシリアルクロック出力端子を備え、該クロッ
ク信号に同期して所定ビット数単位でシリアル通信を行
うシリアル通信インターフェースと1ビットのデータを
出力することのできる出力ポートとを用い、前記出力ポ
ートと前記EEPROMのチップセレクト端子、前記シ
リアルデータ送信端子と前記EEPROMのデータ入力
端子、前記シリアルデータ受信端子と前記EEPROM
のデータ出力端子、および、前記シリアルクロック出力
端子と前記EEPROMのクロック入力端子をそれぞれ
接続し、前記出力ポートからチップセレクト信号を出力
するとともに、前記スタートビット、前記オペコードお
よび前記アドレスデータからなるビット列を、前記アド
レスデータの最下位桁を基準として前記所定ビット数毎
に分割した複数のブロックであって、前記スタートビッ
トを含むブロックについては該スタートビットの前に論
理値が0であるビットを含ませるようにした該複数のブ
ロックを、前記シリアルデータ送信端子から出力するよ
うにしたものである。
In order to achieve the above object, an EEPROM access method according to the present invention has a chip select terminal, a data input terminal, a data output terminal, and a clock input terminal. Serial input / output EEP whose instruction is determined by the operation code and address data input to
A method for accessing a ROM, comprising a serial data transmission terminal, a serial data reception terminal, and a serial clock output terminal for outputting a clock signal, and a serial communication interface for performing serial communication in units of a predetermined number of bits in synchronization with the clock signal. An output port capable of outputting 1-bit data, wherein the output port and the chip select terminal of the EEPROM, the serial data transmission terminal and the data input terminal of the EEPROM, the serial data reception terminal and the EEPROM
Data output terminal, and the serial clock output terminal and the clock input terminal of the EEPROM are connected to each other, a chip select signal is output from the output port, and a bit string including the start bit, the operation code, and the address data is output. A plurality of blocks divided by the predetermined number of bits based on the least significant digit of the address data and including the start bit, a bit having a logical value of 0 is included before the start bit. The plurality of blocks are output from the serial data transmission terminal.

【0013】また、本発明のEEPROMを有する電子
装置は、シリアル通信インターフェースを有するマイク
ロコンピュータとシリアル入出力型EEPROMとを有
する電子装置であって、前記シリアル通信インターフェ
ースにおけるシリアルクロック出力端子、シリアルデー
タ送信端子およびシリアルデータ受信端子を、それぞ
れ、前記シリアル入出力型EEPROMのクロック入力
端子、データ入力端子およびデータ送信端子に接続する
とともに、前記マイクロコンピュータの出力ポートを前
記シリアル入出力型EEPROMのチップセレクト端子
に接続し、前記出力ポートからチップセレクト信号を出
力するとともに、前記シリアルクロック出力端子および
前記シリアルデータ送信端子を介して、前記シリアル入
出力型EEPROMに対してインストラクションデータ
を供給するようにしたものである。
An electronic device having an EEPROM according to the present invention is an electronic device having a microcomputer having a serial communication interface and a serial input / output type EEPROM. A terminal and a serial data receiving terminal are connected to a clock input terminal, a data input terminal and a data transmitting terminal of the serial input / output type EEPROM, respectively, and an output port of the microcomputer is connected to a chip select terminal of the serial input / output type EEPROM. And outputs a chip select signal from the output port and the serial input / output type EEPROM through the serial clock output terminal and the serial data transmission terminal. Is obtained so as to supply the instruction data for.

【0014】[0014]

【発明の実施の形態】図1は、本発明のEEPROMア
クセス方法が適用されたマイクロコンピュータを有する
電子装置の要部構成を示すブロック図である。図1にお
いて、1は前記図4に示したものと同様のシリアルEE
PROMであり、前述のデータ出力端子11、データ入
力端子12、チップセレクト端子13およびクロック入
力端子14を有している。また、2はマイクロコンピュ
ータであり、図示するように、CPU、ROM、RA
M、タイマー、入出力ポートなどの各種構成要素および
20で示すシリアル通信インターフェースが設けられて
いる。シリアル通信インターフェース20は、その内部
に、送受信制御回路21、タイミング回路22、送信レ
ジスタ23、送信シフトレジスタ24、受信レジスタ2
5、受信シフトレジスタ26を有しており、前記タイミ
ング回路22からのクロック信号(SCLK)を出力す
るシリアルクロック出力端子27、シリアル送信信号
(Sout)を出力するシリアルデータ送信端子28、
シリアル信号(Sin)が入力されるシリアルデータ受
信端子29を有している。また、30は汎用の入出力ポ
ートのうちの一つの出力ポートである。なお、マイクロ
コンピュータ2としては、処理ビット幅が8ビット、1
6ビット等各種のものがあるが、ここでは8ビットのマ
イクロコンピュータを例にとって説明する。
FIG. 1 is a block diagram showing a main configuration of an electronic device having a microcomputer to which an EEPROM access method according to the present invention is applied. 1, reference numeral 1 denotes a serial EE similar to that shown in FIG.
It is a PROM and has the above-mentioned data output terminal 11, data input terminal 12, chip select terminal 13, and clock input terminal 14. Reference numeral 2 denotes a microcomputer, as shown in FIG.
Various components such as an M, a timer, an input / output port, and a serial communication interface 20 are provided. The serial communication interface 20 includes therein a transmission / reception control circuit 21, a timing circuit 22, a transmission register 23, a transmission shift register 24, a reception register 2
5, a serial clock output terminal 27 for outputting a clock signal (SCLK) from the timing circuit 22, a serial data transmission terminal 28 for outputting a serial transmission signal (Sout),
It has a serial data receiving terminal 29 to which a serial signal (Sin) is input. An output port 30 is one of general-purpose input / output ports. The microcomputer 2 has a processing bit width of 8 bits, 1 bit,
Although there are various types such as 6 bits, here, an explanation will be given taking an 8 bit microcomputer as an example.

【0015】そして、図示するように、本発明のEEP
ROMアクセス方法においては、マイクロコンピュータ
2の出力ポート30とEEPROM1のチップセレクト
端子13、シリアル通信インターフェースのシリアルク
ロック出力端子27とEEPROM1のクロック入力端
子14、シリアルデータ送信端子28とEEPROM1
のデータ入力端子12、および、シリアルデータ受信端
子29とEEPROM1のデータ出力端子11とをそれ
ぞれ接続している。このように、本発明においては、マ
イコンに搭載されているシリアル通信インターフェース
20の各端子を前記EEPROM1との接続に使用して
いる。
As shown in FIG.
In the ROM access method, the output port 30 of the microcomputer 2 and the chip select terminal 13 of the EEPROM 1, the serial clock output terminal 27 of the serial communication interface and the clock input terminal 14 of the EEPROM 1, the serial data transmission terminal 28 and the EEPROM 1
And the serial data receiving terminal 29 and the data output terminal 11 of the EEPROM 1 are connected to each other. As described above, in the present invention, each terminal of the serial communication interface 20 mounted on the microcomputer is used for connection with the EEPROM 1.

【0016】なお、前記シリアル通信インターフェース
20は、通常、調歩同期方式とクロック同期式の2つの
モードでシリアル伝送を行う機能を有しているが、ここ
では、クロック同期式シリアル通信を行うモードで動作
させる。ここで、前記送信レジスタ23と受信レジスタ
25はCPUから直接読み書きが可能とされており、C
PUは、シリアル通信インターフェース20を使用して
信号を送信するときは、前記送受信制御回路21および
前記タイミング回路22に対し初期設定を行った後、前
記送信レジスタ23に送信データを格納して前記送受信
制御回路21に対し送信開始指示を送出する。これを受
けて、前記送受信制御回路21は前記送信レジスタ23
のデータを前記送信シフトレジスタ24に並列転送し、
該送信シフトレジスタ24の内容を前記タイミング回路
22で生成されるタイミング信号に応じて順次読出して
前記シリアルデータ送信端子28から出力する。また、
前記送受信制御回路21は、前記送信レジスタ23から
前記送信シフトレジスタ24へのデータ転送が終了した
後、前記CPUに対して送信データエンプティ割込みを
発生する。さらに、前記タイミング回路22により生成
されるタイミング信号は、前記シリアルクロック出力端
子27から外部に出力される。なお、前記送信データエ
ンプティ割込みが発生したときに、前記CPUが前記送
信レジスタに後続して送信すべきデータを書き込むこと
により、連続してシリアル送信を行うことができる。ま
た、受信時も同様にCPUの指示により受信動作を開始
し、受信シフトレジスタ26に前記タイミング信号に同
期して受信データが順次入力され、受信シフトレジスタ
26へのデータ取込みが終了したときに、前記受信レジ
スタ25に受信データが転送される。また、前記受信レ
ジスタ25へのデータ転送が終了したときに、CPUに
対し、受信データフル割込みが発生される。CPUはこ
れらの割込みを検知してさらなる信号の送信あるいは受
信をするか送受信処理を終了するかを決定する。このよ
うに、シリアル通信インターフェース20は、自律的に
シリアル通信機能を実行するため、CPUは割込みが発
生するまでは、他の処理を行うことが可能となる。
The serial communication interface 20 normally has a function of performing serial transmission in two modes, an asynchronous mode and a clock synchronous mode. In this case, the serial communication interface 20 has a function of performing clock synchronous serial communication. Make it work. Here, the transmission register 23 and the reception register 25 are readable and writable directly from the CPU.
When transmitting a signal using the serial communication interface 20, the PU performs an initial setting for the transmission / reception control circuit 21 and the timing circuit 22, and then stores transmission data in the transmission register 23 to perform the transmission / reception. A transmission start instruction is sent to the control circuit 21. In response, the transmission / reception control circuit 21 sets the transmission register 23
Is transferred in parallel to the transmission shift register 24,
The contents of the transmission shift register 24 are sequentially read out according to the timing signal generated by the timing circuit 22 and output from the serial data transmission terminal 28. Also,
After the data transfer from the transmission register 23 to the transmission shift register 24 is completed, the transmission / reception control circuit 21 generates a transmission data empty interrupt to the CPU. Further, the timing signal generated by the timing circuit 22 is output from the serial clock output terminal 27 to the outside. Note that when the transmission data empty interrupt occurs, the CPU writes data to be transmitted subsequently to the transmission register, so that serial transmission can be continuously performed. Similarly, at the time of reception, the reception operation is started according to the instruction of the CPU, and the reception data is sequentially input to the reception shift register 26 in synchronization with the timing signal, and when the data fetch into the reception shift register 26 is completed, The received data is transferred to the reception register 25. When the data transfer to the reception register 25 is completed, a reception data full interrupt is generated for the CPU. The CPU detects these interrupts and determines whether to transmit or receive a further signal or end the transmission / reception processing. As described above, since the serial communication interface 20 autonomously executes the serial communication function, the CPU can perform other processing until an interrupt occurs.

【0017】このようにシリアル通信インターフェース
を使用して接続したシリアルEEPROMに対してアク
セスする方法について、データを書き込む場合を例にと
って説明する。なお、ここでは、EEPROM1は64
ワード×16ビット構成とされているものとする。図2
は、EEPROM1への書込み動作のタイミングを示す
タイミングチャートである。EEPROM1に対してア
クセスする前に、まず、前記RAM中のワークエリアな
どに、EEPROM1に対して送信すべきデータを準備
する。前述のように、EEPROMに対するインストラ
クションは、1ビットのスタートビット、2ビットのオ
ペコードおよび6ビットのアドレスフィールドの合計9
ビットであり、それに16ビットのデータフィールドが
後続する。そこで、前記インストラクションを前記アド
レスフィールドの最下位ビットA0を基準として、8ビッ
ト単位のブロックに区切り、スタートビットを含むブロ
ックについては該スタートビットの前に「0」を付加し
て、「00000001」と「01A5 A4 A3 A2 A1 A
0」の2つの8ビットのデータをワークエリア中に準備
する。すなわち、最初の送信データの8ビットのうちの
第1ビット〜第7ビットを全て「0」とし、第8ビット
を「1」(スタートビット)とする。そして、2つ目の
送信データの第1ビットと第2ビットに前記オペコード
(書込みの場合は「01」)を格納し、第3ビット〜第
8ビットの6ビットにアドレスデータA5〜A0を格納す
る。また、第3および第4の送信データとして前記デー
タフィールドの16ビットのデータ(D15〜D8、D7〜D
0)を準備する。
A method of accessing a serial EEPROM connected by using the serial communication interface as described above will be described by taking data writing as an example. Here, the EEPROM 1 is 64
It is assumed that the word has a configuration of 16 bits. FIG.
5 is a timing chart showing the timing of a write operation to the EEPROM 1. Before accessing the EEPROM 1, data to be transmitted to the EEPROM 1 is first prepared in a work area or the like in the RAM. As described above, the instruction for the EEPROM includes a start bit of 1 bit, an operation code of 2 bits, and a total of 9 bits of the address field of 6 bits.
Bits, followed by a 16-bit data field. Therefore, the instruction is divided into 8-bit blocks based on the least significant bit A0 of the address field. For a block including a start bit, “0” is added before the start bit, and “00000001” is added. `` 01A5 A4 A3 A2 A1 A
Two 8-bit data "0" are prepared in the work area. That is, the first to seventh bits of the eight bits of the first transmission data are all set to “0”, and the eighth bit is set to “1” (start bit). Then, the operation code (“01” in the case of writing) is stored in the first and second bits of the second transmission data, and the address data A5 to A0 are stored in six bits of the third to eighth bits. I do. Also, 16-bit data (D15-D8, D7-D8) of the data field is used as third and fourth transmission data.
Prepare 0).

【0018】次に、前記出力ポート30から「1」を出
力し、前記EEPROM1のチップセレクト端子13に
入力する。そして、前記シリアル通信インターフェース
20を介して、前述のように準備した送信データを8ビ
ットずつシリアルに送信する。すなわち、まず、前記最
初の送信データ「00000001」を前記送信レジス
タ23に書込み、前記送受信制御回路21に対し、送信
開始を指示する。これにより、前記送信レジスタ23に
格納された最初の送信データが前記送信シフトレジスタ
24に転送され、前記タイミング回路22で生成される
シリアルクロックに同期して該送信シフトレジスタ24
から順次読出され、前記シリアルデータ出力端子28か
ら出力される。同時に、前記タイミング回路22で生成
されたシリアルクロックが前記シリアルクロック出力端
子27を介して出力される。また、前記送信レジスタ2
3から前記送信シフトレジスタ24への送信データの転
送が終了したとき、送信データエンプティ割込みが発生
される。前記CPUはこの送信データエンプティ割込み
に対する割込み処理において、後続する送信データ(前
記第2番目の送信データ、第3および第4の送信デー
タ)を順次前記送信レジスタ23に書き込む。これによ
り、第4番目までの送信データが連続して送信されるこ
ととなる。
Next, "1" is output from the output port 30 and input to the chip select terminal 13 of the EEPROM 1. Then, the transmission data prepared as described above is transmitted serially by 8 bits at a time via the serial communication interface 20. That is, first, the first transmission data "00000001" is written into the transmission register 23, and the transmission / reception control circuit 21 is instructed to start transmission. Thus, the first transmission data stored in the transmission register 23 is transferred to the transmission shift register 24, and the transmission shift register 24 is synchronized with the serial clock generated by the timing circuit 22.
From the serial data output terminal 28. At the same time, the serial clock generated by the timing circuit 22 is output via the serial clock output terminal 27. The transmission register 2
When the transfer of the transmission data from 3 to the transmission shift register 24 is completed, a transmission data empty interrupt is generated. The CPU sequentially writes subsequent transmission data (the second transmission data, the third transmission data, and the fourth transmission data) into the transmission register 23 in the interrupt processing for the transmission data empty interrupt. As a result, the fourth transmission data is transmitted continuously.

【0019】前記シリアルEEPROM1では、前述の
ように、前記クロック入力端子14を介して入力される
シリアルクロックSKに基づいて、前記データ入力端子
12から入力される前記最初の送信データの取込みが行
われる。ここで、EEPROM1の前記制御部21は前
記最初の送信データを取り込むが、前述のように、
「0」のデータは全て無視し、第8ビット目に送信され
た「1」のデータをスタートコードであると認識する。
そして、引き続いて入力される第2番目の送信データの
第1ビットと第2ビットのデータを前記オペコードとし
て、第3〜第8番目のビットをアドレスデータとして、
それぞれ認識し、前記制御部21に入力する。さらに、
第3番目の送信データと第4番目の送信データを書込み
データとして前記データレジスタ26に格納する。そし
て、前記第2番目の送信データの第3〜第8ビットのデ
ータを前記アドレスレジスタ22に転送し、該アドレス
データで指定されるアドレスに対し、前記データレジス
タ26に格納したデータを書き込む。
In the serial EEPROM 1, as described above, the first transmission data input from the data input terminal 12 is fetched based on the serial clock SK input via the clock input terminal 14. . Here, the control unit 21 of the EEPROM 1 captures the first transmission data, but as described above,
All data of "0" are ignored, and the data of "1" transmitted in the eighth bit is recognized as a start code.
Then, the first and second bits of the subsequently input second transmission data are used as the operation code, and the third to eighth bits are used as address data.
Each is recognized and input to the control unit 21. further,
The third transmission data and the fourth transmission data are stored in the data register 26 as write data. Then, data of the third to eighth bits of the second transmission data is transferred to the address register 22, and the data stored in the data register 26 is written to an address specified by the address data.

【0020】このように、本発明においては、スタート
ビットの前にシリアル通信の単位となるビット数となる
ように「0」を付加することにより、シリアルEEPR
OMに対してシリアル通信インターフェースを介してア
クセスすることを可能としている。なお、上記において
は、書込みの場合について説明したが、読み出しおよび
その他のインストラクションの場合にも、全く同様であ
るので、詳細な説明は省略する。このような本発明の方
法によれば、前記シリアル通信インターフェース20を
用いて、シリアルEEPROMに対してアクセスするこ
とが可能となる。したがって、EEPROMへのアクセ
スプログラムを簡単なものとすることが可能となり、プ
ログラム容量を少なくすることができる。また、EEP
ROMとの通信も、シリアル通信インターフェースの有
する速度で通信することが可能となる。さらに、シリア
ル通信インターフェースからの割込みにより送信データ
を転送するだけで済むため、EEPROMとのアクセス
中であっても他の処理を実行することが可能となる。
As described above, in the present invention, the serial EEPR is added by adding "0" before the start bit so that the number of bits becomes a unit of serial communication.
The OM can be accessed via a serial communication interface. In the above description, the case of writing has been described. However, the case of reading and other instructions is exactly the same, and a detailed description thereof will be omitted. According to the method of the present invention, it is possible to access the serial EEPROM using the serial communication interface 20. Therefore, the program for accessing the EEPROM can be simplified, and the program capacity can be reduced. Also, EEP
Communication with the ROM can be performed at the speed of the serial communication interface. Further, since it is only necessary to transfer transmission data by interruption from the serial communication interface, other processing can be executed even during access to the EEPROM.

【0021】なお、上記においては、出力ポート30を
「1」としてチップセレクトCSを立ち上げてからシリ
アル通信を行うようにしていたが、前述のように、EE
PROM1側では、前記チップセレクトCSがハイレベ
ルとなった後に最初に取り込まれる「1」より前の
「0」は全て無視しているため、前記出力ポート30を
「1」とするタイミングは、クリティカルなものではな
く、前記スタートビット(最初の送信における第8ビッ
ト目)が送信される前のタイミングであればよい。
In the above description, the serial communication is performed after the chip select CS is activated with the output port 30 set to "1".
Since the PROM 1 ignores all “0” s before the “1” which is first taken in after the chip select CS becomes high level, the timing of setting the output port 30 to “1” is critical. The timing may be any timing before the start bit (the eighth bit in the first transmission) is transmitted.

【0022】また、上記実施の形態においては、EEP
ROMが64ワード×16ビットの構成の場合を例にと
って説明したが、これに限られることはなく、128×
8、128×16、256×16、512×16などそ
の他のビット構成であっても、同様に適用することがで
きる。例えば、128ワード×8ビットの構成の場合に
は、前記アドレスフィールドがA6〜A0の7ビットとなる
が、この場合には、前記最初に送信される8ビットのデ
ータのうちの第7ビット目にスタートビット「1」、第
8ビット目に前記オペコードの第1ビット目を格納し、
そのほかのビットは全て「0」とすればよい。
In the above embodiment, the EEP
Although the case where the ROM has a configuration of 64 words × 16 bits has been described as an example, the present invention is not limited to this.
Other bit configurations such as 8, 128 × 16, 256 × 16, 512 × 16 can be similarly applied. For example, in the case of a structure of 128 words × 8 bits, the address field is 7 bits A6 to A0. In this case, the 7th bit of the first transmitted 8 bit data is used. And the first bit of the operation code is stored in the eighth bit,
All other bits may be set to “0”.

【0023】さらに、上記においては、8ビットのマイ
クロコンピュータを用い、前記シリアル通信インターフ
ェースを介して8ビット単位でシリアルデータの通信を
行う場合について説明したが、これに限られることはな
く、例えば、16ビットのマイクロコンピュータなど異
なるビット数のマイクロコンピュータを使用する場合に
も同様に本発明を適用することができる。すなわち、こ
の場合には、前述のように8ビットごとのブロックとす
るのではなく、16ビットごとのブロックとすればよ
い。さらにまた、上述した実施の形態においては、マイ
クロコンピュータを用い、該マイクロコンピュータに内
蔵されているシリアル通信インターフェースとシリアル
EEPROMとを接続する場合について説明したが、こ
れに限られることはなく、シリアルEEPROMをシリ
アル通信インターフェース回路を介して接続する場合に
同様に適用することができる。
Further, in the above description, a case has been described in which an 8-bit microcomputer is used to perform serial data communication in 8-bit units via the serial communication interface. However, the present invention is not limited to this. The present invention can be similarly applied to a case where a microcomputer having a different number of bits such as a 16-bit microcomputer is used. That is, in this case, it is sufficient to make the block every 16 bits instead of the block every 8 bits as described above. Furthermore, in the above-described embodiment, a case has been described in which a microcomputer is used to connect a serial communication interface built in the microcomputer to a serial EEPROM, but the present invention is not limited to this. Can be similarly applied to a case where the device is connected via a serial communication interface circuit.

【0024】[0024]

【発明の効果】以上説明したように、本発明のEEPR
OMアクセス方法およびEEPROMを有する電子装置
によれば、マイクロコンピュータに通常搭載されている
シリアル通信機能を用いてシリアルEEPROMにアク
セスすることが可能となり、シリアルEEPROMへの
アクセスを制御するためのプログラムを特別に用意する
ことなく、シリアルEEPROMに対し、容易にデータ
を読み書きすることが可能となる。また、マイコンに通
常搭載されているシリアル通信機能を用いるため、該シ
リアル通信機能からの割込みを利用することが可能とな
り、EEPROMに対するアクセスを実行中であって
も、他の処理を実行することが可能となる。
As described above, the EEPR of the present invention
According to the OM access method and the electronic device having the EEPROM, it is possible to access the serial EEPROM using the serial communication function normally mounted on the microcomputer, and a program for controlling the access to the serial EEPROM is specially prepared. , Data can be easily read and written to the serial EEPROM. Further, since the serial communication function normally mounted on the microcomputer is used, it is possible to use an interrupt from the serial communication function, so that other processing can be executed even while accessing the EEPROM. It becomes possible.

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

【図1】 本発明のEEPROMへのアクセス方法が適
用された電子装置の構成例を示す要部ブロック図であ
る。
FIG. 1 is a main block diagram showing a configuration example of an electronic device to which an access method to an EEPROM of the present invention is applied.

【図2】 本発明のEEPROMアクセス方法における
書込み動作時のタイミングチャートである。
FIG. 2 is a timing chart at the time of a write operation in the EEPROM access method of the present invention.

【図3】 シリアルEEPROMの構成例を示すブロッ
ク図である。
FIG. 3 is a block diagram illustrating a configuration example of a serial EEPROM.

【図4】 従来のシリアルEEPROMへの書込み動作
を説明するためのタイミングチャートである。
FIG. 4 is a timing chart for explaining a conventional write operation to a serial EEPROM.

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

1 シリアルEEPROM 2 マイクロコンピュータ 11 データ入力端子 12 データ出力端子 13 チップセレクト端子 14 クロック入力端子 20 シリアル通信インターフェース 27 シリアルクロック出力端子 28 データ送信端子 29 データ受信端子 30 出力ポート DESCRIPTION OF SYMBOLS 1 Serial EEPROM 2 Microcomputer 11 Data input terminal 12 Data output terminal 13 Chip select terminal 14 Clock input terminal 20 Serial communication interface 27 Serial clock output terminal 28 Data transmission terminal 29 Data reception terminal 30 Output port

Claims (2)

【特許請求の範囲】[Claims] 【請求項1】 チップセレクト端子、データ入力端子、
データ出力端子およびクロック入力端子を有し、スター
トビットに引き続いてシリアルに入力されるオペコード
とアドレスデータによりインストラクションが決定され
るシリアル入出力型EEPROMに対するアクセス方法
であって、 シリアルデータ送信端子、シリアルデータ受信端子およ
びクロック信号を出力するシリアルクロック出力端子を
備え、該クロック信号に同期して所定ビット数単位でシ
リアル通信を行うシリアル通信インターフェースと1ビ
ットのデータを出力することのできる出力ポートとを用
い、 前記出力ポートと前記EEPROMのチップセレクト端
子、前記シリアルデータ送信端子と前記EEPROMの
データ入力端子、前記シリアルデータ受信端子と前記E
EPROMのデータ出力端子、および、前記シリアルク
ロック出力端子と前記EEPROMのクロック入力端子
をそれぞれ接続し、 前記出力ポートからチップセレクト信号を出力するとと
もに、 前記スタートビット、前記オペコードおよび前記アドレ
スデータからなるビット列を、前記アドレスデータの最
下位桁を基準として前記所定ビット数毎に分割した複数
のブロックであって、前記スタートビットを含むブロッ
クについては該スタートビットの前に論理値が0である
ビットを含ませるようにした該複数のブロックを、前記
シリアルデータ送信端子から出力するようにしたことを
特徴とするEEPROMアクセス方法。
1. A chip select terminal, a data input terminal,
An access method for a serial input / output type EEPROM having a data output terminal and a clock input terminal and having an instruction determined by an operation code and address data serially input following a start bit, comprising: a serial data transmission terminal; A serial communication interface that has a receiving terminal and a serial clock output terminal that outputs a clock signal, and performs serial communication in units of a predetermined number of bits in synchronization with the clock signal, and an output port that can output 1-bit data. The output port and the chip select terminal of the EEPROM, the serial data transmission terminal and the data input terminal of the EEPROM, the serial data reception terminal and the
A data output terminal of an EPROM, a serial clock output terminal connected to a clock input terminal of the EEPROM, a chip select signal is output from the output port, and a bit string including the start bit, the operation code, and the address data Are divided into a plurality of blocks each having the predetermined number of bits based on the least significant digit of the address data, and a block including the start bit includes a bit having a logical value of 0 before the start bit. An EEPROM access method, wherein the plurality of blocks are output from the serial data transmission terminal.
【請求項2】 シリアル通信インターフェースを有する
マイクロコンピュータとシリアル入出力型EEPROM
とを有する電子装置であって、 前記シリアル通信インターフェースにおけるシリアルク
ロック出力端子、シリアルデータ送信端子およびシリア
ルデータ受信端子を、それぞれ、前記シリアル入出力型
EEPROMのクロック入力端子、データ入力端子およ
びデータ送信端子に接続するとともに、前記マイクロコ
ンピュータの出力ポートを前記シリアル入出力型EEP
ROMのチップセレクト端子に接続し、 前記出力ポートからチップセレクト信号を出力するとと
もに、前記シリアルクロック出力端子および前記シリア
ルデータ送信端子を介して、前記シリアル入出力型EE
PROMに対してインストラクションデータを供給する
ようにしたことを特徴とするEEPROMを有する電子
装置。
2. A microcomputer having a serial communication interface and a serial input / output type EEPROM
An electronic device comprising: a serial clock output terminal, a serial data transmission terminal, and a serial data reception terminal in the serial communication interface, and a clock input terminal, a data input terminal, and a data transmission terminal of the serial input / output type EEPROM, respectively. And the output port of the microcomputer is connected to the serial input / output EEP.
Connected to a chip select terminal of a ROM, outputs a chip select signal from the output port, and outputs the serial input / output type EE through the serial clock output terminal and the serial data transmission terminal.
An electronic device having an EEPROM, wherein instruction data is supplied to a PROM.
JP2000103429A 2000-04-05 2000-04-05 Method for accessing eeprom and electronic device having eeprom Pending JP2001290755A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2000103429A JP2001290755A (en) 2000-04-05 2000-04-05 Method for accessing eeprom and electronic device having eeprom

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2000103429A JP2001290755A (en) 2000-04-05 2000-04-05 Method for accessing eeprom and electronic device having eeprom

Publications (1)

Publication Number Publication Date
JP2001290755A true JP2001290755A (en) 2001-10-19

Family

ID=18617147

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2000103429A Pending JP2001290755A (en) 2000-04-05 2000-04-05 Method for accessing eeprom and electronic device having eeprom

Country Status (1)

Country Link
JP (1) JP2001290755A (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2010040035A (en) * 2008-07-07 2010-02-18 Ricoh Co Ltd Memory reading and writing apparatus and image forming apparatus
CN101894089A (en) * 2006-06-02 2010-11-24 旺宏电子股份有限公司 Method and apparatus for communicating data over multiple pins of multi-mode bus

Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPS61501879A (en) * 1984-04-12 1986-08-28 ゼネラル・エレクトリック・カンパニイ Memory interface for electronic demand metering devices of electrical meters
JPH08106433A (en) * 1994-10-06 1996-04-23 Ricoh Co Ltd Serial transfer circuit device

Patent Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPS61501879A (en) * 1984-04-12 1986-08-28 ゼネラル・エレクトリック・カンパニイ Memory interface for electronic demand metering devices of electrical meters
JPH08106433A (en) * 1994-10-06 1996-04-23 Ricoh Co Ltd Serial transfer circuit device

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101894089A (en) * 2006-06-02 2010-11-24 旺宏电子股份有限公司 Method and apparatus for communicating data over multiple pins of multi-mode bus
JP2010040035A (en) * 2008-07-07 2010-02-18 Ricoh Co Ltd Memory reading and writing apparatus and image forming apparatus

Similar Documents

Publication Publication Date Title
US7233541B2 (en) Storage device
KR101507628B1 (en) System and method for data read of a synchronous serial interface nand
US8046527B2 (en) Apparatus and method for using a page buffer of a memory device as a temporary cache
KR101507194B1 (en) Serial interface nand
KR100375217B1 (en) Microcontroller incorporating an electrically rewritable non-volatile memory
US20040236898A1 (en) Synchronous semiconductor storage device module and its control method, information device
JP4136359B2 (en) Microcomputer
US6810444B2 (en) Memory system allowing fast operation of processor while using flash memory incapable of random access
JP2842750B2 (en) IC card
KR100634436B1 (en) Multi chip system and its boot code fetch method
KR102385569B1 (en) Memory device
US5507001A (en) Microcomputer including CPU and serial data communication unit operating in synchronism
US6981109B2 (en) Digital signal processor system having programmable random access memory that executes processing during downloading of a program
JP2001290755A (en) Method for accessing eeprom and electronic device having eeprom
US20040122984A1 (en) Data processor and data table update method
US8194480B2 (en) Method for initializing memory device
US6760273B2 (en) Buffer using two-port memory
JP2009110335A (en) Semiconductor device and data processing system
US20070192645A1 (en) Battery management system chip and data-accessing method of the same
EP0020972A1 (en) Program controlled microprocessing apparatus
US7020813B2 (en) On chip debugging method of microcontrollers
KR100264758B1 (en) Microcomputer
SU1418720A1 (en) Device for checking programs
JPH01205339A (en) Microcomputer system
US20060136539A1 (en) Data processing device with microprocessor and with additional arithmetic unit and associated method

Legal Events

Date Code Title Description
A621 Written request for application examination

Free format text: JAPANESE INTERMEDIATE CODE: A621

Effective date: 20070326

A977 Report on retrieval

Free format text: JAPANESE INTERMEDIATE CODE: A971007

Effective date: 20100609

A131 Notification of reasons for refusal

Free format text: JAPANESE INTERMEDIATE CODE: A131

Effective date: 20100615

A02 Decision of refusal

Free format text: JAPANESE INTERMEDIATE CODE: A02

Effective date: 20101019