JP3829906B2 - Microcomputer with built-in EEPROM interface - Google Patents

Microcomputer with built-in EEPROM interface Download PDF

Info

Publication number
JP3829906B2
JP3829906B2 JP26431799A JP26431799A JP3829906B2 JP 3829906 B2 JP3829906 B2 JP 3829906B2 JP 26431799 A JP26431799 A JP 26431799A JP 26431799 A JP26431799 A JP 26431799A JP 3829906 B2 JP3829906 B2 JP 3829906B2
Authority
JP
Japan
Prior art keywords
data
eeprom
terminal
interface
microcomputer
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Expired - Lifetime
Application number
JP26431799A
Other languages
Japanese (ja)
Other versions
JP2001092804A (en
Inventor
修一 新田
洋一 藤田
啓資 松田
芳徳 手嶋
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.)
Denso Corp
Original Assignee
Denso 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 Denso Corp filed Critical Denso Corp
Priority to JP26431799A priority Critical patent/JP3829906B2/en
Publication of JP2001092804A publication Critical patent/JP2001092804A/en
Application granted granted Critical
Publication of JP3829906B2 publication Critical patent/JP3829906B2/en
Anticipated expiration legal-status Critical
Expired - Lifetime legal-status Critical Current

Links

Images

Landscapes

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

Description

【0001】
【発明の属する技術分野】
本発明は、マイクロコンピュータの技術分野に属し、より詳しくは、EEPROMとのシリアル通信に適したインターフェースを内蔵したマイクロコンピュータの技術分野に属する。
【0002】
【従来の技術】
マイクロコンピュータと他のデバイスとのデータ通信においては、パラレル通信方式とシリアル通信方式との大きく分けて二つの方式のうちいずれかが採用されている。一般に、シリアル通信には、数本の信号線でマイクロコンピュータと他のデバイスとの通信が可能になるので、パラレル通信よりもずっと少ない信号線での通信が可能であり、パッケージングおよび配線が容易になるという利点がある。
【0003】
通常、図4に示すように、従来のマイクロコンピュータ1’と他のデバイス2’(EEPROMを除く各種メモリや他のマイクロコンピュータ)との間でシリアル通信が行われる際には、シリアルクロック端子、データ送信端子およびデータ受信端子を介して通信が行われる。この際に使用されるシリアル同期通信リソースは、マイクロコンピュータに内蔵されたクロック同期シリアルインターフェースであって、データの入力および出力は、互いに半クロックずつずらして行われる。すなわち、図5および図6に示すように、パルス状のクロック信号の立ち上がり時および立ち下がり時のうち一方のタイミングに合わせてデータ送信端子からの出力が始まり、逆に他方のタイミングに合わせてデータ受信端子での読み込みが行われる。このような通常のシリアル通信方式を、SPI(シリアル・パラレル・インターフェース)通信方式と呼ぶ。
【0004】
ここで、図4ないし図6において、CSNはチップセレクト端子(端子または信号、以下同様)、SCKはシリアルクロック端子、CTXはデータ送信端子、CRXはデータ受信端子、そしてCBUSYは通信ビジー端子である。これらの各端子での信号入出力の別は、マスター側の従来のマイクロコンピュータ1’から見て、CSN,SCK,CTXはポート出力であり、残りのCRX,CBUSYはポート入力である。なお、図5および図6の右端にそれぞれLSB/MSBとあるのは、LSBファーストでもMSBファーストでもデータ通信が可能であるとの意である。また、図5と図6とは、SCKのシリアルクロック信号タイミングが逆転している点以外は、互いに同一である。
【0005】
一方、特別の通信ハードウェアなしに、従来の通常のマイクロコンピュータとEEPROMとの間でシリアル通信を行う場合には、既存のポートリソースを通信ソフトウェアで制御しながら通信を行っている。すなわち、CS(BUSY),SK(CSK),DO,DIに相当する各ポートの信号値を、通信ソフトウェアで直接的に0か1に制御する。こうしてEEPROMとのシリアル通信が行われている間には、マイクロコンピュータのCPUは通信ソフトウェアの処理にかかりきりになるので、他の処理を行うことができない。かといって、他の処理を割り込みさせて時分割で並行処理させようとすると、一回分の通信を細切れにし複数回に分割してシリアル通信を行わざるを得なくなるので、一回分の通信にかかる所要時間が長くなる。それゆえ、他の処理と並行して高速でEEPROMと通信することができず、不都合である。
【0006】
そればかりではなく、すでに明らかなように、EEPROMとの通信方式では、前述のSPI通信方式とデータ入出力タイミングが異なるので、マイクロコンピュータが通常内蔵しているSPI方式のシリアルインターフェースをそのまま適用することは容易ではない。しかしながら、EEPROMの通信プロトコルはすでに業界標準として確立されてしまっているので、マイクロコンピュータのインターフェースリソースをEEPROMモードに適合させざるを得ない。そこで、前述のように、マイクロコンピュータの側でEEPROMとのシリアル通信のために大きなインターフェース制御用ソフトウェアを用意し、同ソフトウェアによってマイクロコンピュータのデータ送受信タイミングを制御しているのが現状である。
【0007】
【発明が解決しようとする課題】
前述の従来技術では、前述のようにマイクロコンピュータのソフトウェアによってEEPROMと入出力制御を行っているので、EEPROMインターフェース制御用ソフトウェアのコードサイズが大きくなるという不都合があった。すると、同ソフトウェアを格納するために大きなROM容量が必要とされるという不都合が生じていた。そればかりではなく、同ソフトウェアのコードサイズが大きいので、その演算処理にCPUタイムが少なからず消費されてしまい、その間はCPUが他の処理を行うことができないという不都合があった。
【0008】
そこで本発明は、コストアップを防ぎながら、EEPROMインターフェース制御用ソフトウェアのコードサイズが小さく、EEPROMとの通信に要するCPU負荷が少ないEEPROMインターフェース内蔵マイクロコンピュータを提供することを解決すべき課題とする。
【0009】
【課題を解決するための手段】
前記課題を解決するために、発明者は以下の手段を発明した。
【0010】
すなわち、マイクロコンピュータ側で、データ送信端子からのデータ出力に対し、データ受信端子からのデータ入力を半ステップ遅らせるように、SPI用のハードウェア構成をわずかに改修するだけで済むことを、発明者らは発見した。その結果、シリアルインターフェースをもつマイクロコンピュータが標準的に装備している通信用ハードウェアをわずかに改修するだけで、EEPROMモードのタイミングでの通信が基本的に可能になり、第1手段を発明するに至った。さらに、第1手段を補完する目的で、第2手段および第3手段を発明した。そして、第1手段、第2手段および第3手段の全ての要件を揃えたマイクロコンピュータを試作してEEPROMとの通信試験を行い、同マイクロコンピュータが完璧に機能することを確認して本発明を完成させた。
【0011】
(第1手段)
本発明の第1手段は、請求項1記載のEEPROMインターフェース内蔵マイクロコンピュータである。
【0012】
本手段では、マイクロコンピュータのEEPROMインターフェースは、シリアルクロック信号の立ち下がり時にデータ送信端子からの送信とデータ受信端子での受信とを行う送受信回路をもつ。この送受信回路により、データ入出力タイミングがハードウェア的に同期させられているので、タイミング調整用のソフトウェアが不要になり、また、出力データを待機させたり入力データを読みとり処理するソフトウェアが大幅に簡素化される。つまり、通常のSPIモード用のインターフェース・ハードウェアをわずかに改修するだけで、EEPROMとの通信用のインターフェース・ソフトウェアのコードサイズを大幅に低減することができる。
【0013】
それゆえ、同ソフトウェアを格納するためのROM容量はわずかで済むようになり、同ソフトウェアの処理時間が大幅に短縮され、短時間でのマイクロコンピュータとEEPROMとのシリアル通信が可能になる。そればかりではなく、同ソフトウェアの演算処理にかかるCPUタイムもわずかで済むので、EEPROMとの通信に割かれるCPUタイムが大幅に低減され、CPUがすぐに他の処理にかかることができるようになる。すなわち、シリアル通信はEEPROMインターフェースにほとんど任せきりにして、EEPROMとのシリアル通信を行っている間に、マイクロコンピュータのCPUは他のタスクを処理することができるようになる。
【0014】
また、インターフェース・ハードウェアの改修はわずかであるうえに、EEPROMモード用のインターフェース・ソフトウェアを格納するためのROM容量が少なくて済むので、コストアップはほとんどない。逆に、インターフェース・ソフトウェアの開発費用とROM容量との低減分により、かえってコストダウンさえできる可能性がある。
【0015】
さらに、前述のように、本手段でのインターフェース・ハードウェアの構成は、通常のSPI通信方式のものとわずかに違うにすぎないので、インターフェース・ハードウェアをSPIと兼用にすることも容易である。兼用にしてもコストアップはわずかであるから、マイクロコンピュータの汎用性の観点から見て、SPIおよびEEPROM兼用インターフェース・ハードウェアを備えたマイクロコンピュータとする事が望ましい。
【0016】
したがって、本手段のEEPROMインターフェース内蔵マイクロコンピュータによれば、コストアップを防ぎながら、EEPROMシリアルインターフェース制御用ソフトウェアのコードサイズを大幅に低減することができる。その結果、同ソフトウェアの格納に必要とされるROM容量が減るばかりではなく、短時間でEEPROMとの通信ができるようになるうえに、CPUをより有効に利用できるようになるという効果がある。
【0017】
(第2手段)
本発明の第2手段は、請求項2記載のEEPROMインターフェース内蔵マイクロコンピュータである。
【0018】
本手段では、EEPROMインターフェースは、データ受信端子でEEPROMからの最終信号を受信できるように、シリアルクロック信号が終了した後でダミークロック信号を生成するダミークロック信号生成回路をもつ。
【0019】
マイクロコンピュータがEEPROMからデータを読み出す際には、通常のSPIインターフェースを改修したEEPROMインターフェースでは、最後のシリアルクロック信号から後で読み出しデータの最後の一ビットが送られてくる。それゆえ、通常のシリアルクロック信号だけを参照していては、最後の一ビットを読み落とすおそれが生じる。そこで本手段では、シリアルクロック信号が終了した後に、EEPROMインターフェースの内部でダミークロック信号生成回路がダミークロック信号を生成することにより、EEPROMから送られてくる最後の一ビットを確実に受信できるようにしている。その結果、本手段のマイクロコンピュータは、EEPROMから送られてくる読み出しデータの最後の一ビットに至るまで、読み落とすことなく受信することができるようになる。
【0020】
したがって本手段によれば、前述の第1手段の効果に加えて、SPIインターフェースからのハードウェア改修がわずかであっても、EEPROMから送られてきた受信データの最後の一ビットまで確実に受信することができるようになるという効果がある。
【0021】
(第3手段)
本発明の第3手段は、請求項3記載のEEPROMインターフェース内蔵マイクロコンピュータである。
【0022】
本手段では、EEPROMインターフェースは、データ受信端子で受信する信号のうち前半の無意味な信号を空読みする空読み手段と、データ送信端子からの送信データにダミーデータを付け加えて送信データのデータ長を調整することができる送信データ生成手段とをもつ。
【0023】
すなわち、通常のSPIインターフェースではデータの送受信を並行して行うようになっているので、SPIインターフェースを改修したEEPROMインターフェースでは、以下の二つの不都合が生じる恐れがある。
【0024】
第一に、マイクロコンピュータがEEPROMに対して命令およびアドレスを送っている間に、マイクロコンピュータのEEPROMインターフェースが、データ受信端子にかかる電位を有意なデータとして読み込んでしまう恐れがある。そこで本手段では、EEPROMインターフェースに空読み手段を設けることにより、データ受信端子で受信する信号のうち前半の無意味な信号は、空読みされて読み捨てられるようになっている。その結果、本手段のマイクロコンピュータは、データ受信端子にかかる無意味な電位をEEPROMからの有意なデータとして読み込んでしまうという不都合を、確実に防止することができる。
【0025】
第二に、EEPROMからのデータ読み出し時において、マイクロコンピュータのEEPROMインターフェースにおいて、データ送信端子からの電位が不定であっては、EEPROMの動作に何らかの不具合が起きる恐れがある。そこで本手段では、マイクロコンピュータのEEPROMインターフェースに適正な送信データ生成手段を設けることにより、データ送信端子からの送信データに無害なダミーデータを付け加えて、送信データのデータ長を適正に調整することができるようにしてある。その結果、EEPROMからのデータ読み出し時においても、データ送信端子からEEPROMに送られる信号は無害になり、EEPROMの誤動作は確実に防止される。
【0026】
そればかりではなく、通常のSPIにおいては、送受信できるデータの長さは8ビットか16ビットに限られるのが普通であるが、送信データ生成手段によりこのようなデータ長の拘束から解放される。すなわち、EEPROMと送受信すべきデータの長さに合わせて送信データにダミーデータを付け加えて送信データ長を調整することにより、8ビットや16ビット以外の長さのデータでも送受しすることができるようになる。
【0027】
一例を挙げてより詳しく説明すると、EEPROMからのデータ読み出し時には、マイクロコンピュータからの送信データは、[ダミーデータ]+[送信データ]+[受信データ長のダミーデータ]という構成で、希望の受信データ長に合わせて送信される。逆に、EEPROMへのデータ書き込み時には、マイクロコンピュータからの送信データは、[ダミーデータ]+[送信データ]という構成で、希望の送信データ長に合わせて送信される。その結果、送受信のデータ長が所望の長さに設定できるようになるので、EEPROMとの通信においてデータ長に関する自由度が増す。
【0028】
したがって本手段によれば、前述の第1手段または第2手段の効果に加えて、SPIインターフェースからのハードウェア改修がわずかであっても、次の二つの効果を生じる。すなわち、先ず、送受信のデータ長が所望の長さに設定できるようになりデータ長に関する自由度が増すという効果があり、次に、より高い信頼性をもってEEPROMとのデータ送受信をすることができるようになるという効果がある。
【0029】
(第4手段)
本発明の第4手段は、請求項4記載のEEPROMインターフェース内蔵マイクロコンピュータである。
【0030】
本手段では、EEPROMインターフェースのハードウェアは、SPI(シリアル・パラレル・インターフェース)のハードウェアを兼ねているので、インターフェース・ハードウェアの構成が簡素でありながら機能が充実している。ここで、前述した第1手段のインターフェース・ハードウェアの構成は、通常のSPI通信方式のものとわずかに違うにすぎないので、インターフェース・ハードウェアをSPIと兼用にすることは、技術的に容易である。そして、兼用にしてもコストアップはわずかであるから、マイクロコンピュータの汎用性が増すという利点がある。
【0031】
したがって本手段によれば、わずかのコストアップでマイクロコンピュータの汎用性を向上させることができるという効果がある。
【0032】
【発明の実施の形態】
本発明のEEPROMインターフェース内蔵マイクロコンピュータの実施の形態については、当業者に実施可能な理解が得られるよう、以下の実施例で明確かつ十分に説明する。
【0033】
[実施例1]
(実施例1の構成)
本発明の実施例1としてのEEPROMインターフェース内蔵マイクロコンピュータ1は、図1に示すように、ワンチップ・マイクロコンピュータであって、少なくとも四本の信号線でEEPROM2と接続されている。これら四本の導線は、同図中の上から順に、通信ビジー信号線BUSY、シリアルクロック信号線SCK、データ出力信号線DOおよびデータ入力信号線DIである。本実施例のマイクロコンピュータ1は、通信ビジー端子1b、シリアルクロック端子1c、データ送信端子1dおよびデータ受信端子1eを有し、これらの各端子には、前述の各信号線が接続されている。
【0034】
本実施例のマイクロコンピュータ1は、これらの端子1b〜1eを介してEEPROM2とのシリアル通信によるデータの授受が可能なEEPROMインターフェース10を内蔵している。EEPROMインターフェース10は、通常のSPIを少し改修した構成をもち、通常のSPIと異なって、送受信回路11、ダミークロック信号生成回路12、空読み手段13および送信データ生成手段14をもつ。ここで、三つの信号BUSY,SCK,DOは、EEPROMインターフェース10のポート出力であり、残る一つの信号DIだけは、EEPROMインターフェース10のポート入力である。なお、EEPROMインターフェース10は、通常のSPIと兼用できる構成になっている。
【0035】
送受信回路11は、図2および図3に示すように、シリアルクロック信号SCKの立ち下がり時に、データ送信端子1dからの送信とデータ受信端子1eでの受信とを行う回路である。送受信回路11は、マイクロコンピュータ1の集積回路の一部としてハードウェア的に構成されており、CPUに負荷をかけることがない上に処理速度が非常に速い。
【0036】
ダミークロック信号生成回路12は、データ受信端子1eでEEPROM2からの最終信号D0を受信できるように、図3の右端に示すように、シリアルクロック信号SCKが終了した後で内部的なダミークロック信号を生成する回路である。ダミークロック信号生成回路12も、マイクロコンピュータ1の集積回路の一部としてハードウェア的に構成されており、やはりCPUに負荷をかけることがない。なお、ダミークロック信号生成回路12は、送受信回路11の一部として構成されている。
【0037】
空読み手段13は、図3の左半部に示すように、データ受信端子1eで受信する信号DIのうち前半の無意味な信号を空読みするソフトウェア的に構成された手段である。一方、送信データ生成手段14は、図2および図3の右上方に示すように、データ送信端子1dからの送信データDOにダミーデータを付け加えて送信データDOのデータ長を調整することができる手段であり、ソフトウェア的に構成されている。空読み手段13および送信データ生成手段14のソフトウェアは、マイクロコンピュータ1のRAMまたはROMに格納されており、CPUによって演算処理される。
【0038】
(実施例1の作用)
本実施例のEEPROMインターフェース内蔵マイクロコンピュータ1は、以上のように構成されているので、以下のような作用を発揮する。
【0039】
送受信回路11は、図2および図3に示すように、シリアルクロック信号SCKの立ち下がり時に、データ送信端子1dからの送信データDOの送信とデータ受信端子1eでの受信データDIの受信とを行う作用をもつ。それゆえ、EEPROM2と通信するに際して、従来技術と異なって、CPUで処理するインターフェース制御用ソフトウェアは不要であり、ハードウェアによってデータ送受信が高速処理される。
【0040】
また、空読み手段13は、EEPROM2からのデータ読み出し時に、図3の左半部に示すように、データ受信端子1eで受信する受信データDIを含む信号のうち前半の無意味な信号を空読みする作用をもつ。すなわち、データ受信端子1eで受信する信号のうち前半の無意味な信号は、空読みされて読み捨てられるので、データ受信端子1eにかかる無意味な電位をEEPROM2からの有意なデータとして読み込んでしまうような不都合は生じない。
【0041】
一方、送信データ生成手段14は、図2および図3の上部の数列に示すように、データ送信端子1dからの送信データDOに主にゼロからなる無害なダミーデータを付け加えて送信データDOのデータ長を調整する作用をもつ。その結果、送信データDOのデータ長の調整が可能になるばかりではなく、EEPROMの誤動作も確実に防止される。
【0042】
さらに、ダミークロック信号生成回路12は、図3の右端に示すように、シリアルクロック信号SCKが終了した後、送受信回路11の内部でダミークロック信号を生成する作用をもつ。その結果、シリアルクロック信号SCKの最後のパルスの後にくるEEPROM2からの最終信号D0は、データ受信端子1eで確実に受信されるようになり、受信データDIの最後の一ビットまで読み落としがなくなる。
【0043】
(実施例1の効果)
本実施例のマイクロコンピュータ1は、前述のように構成されており、以上の作用をもつので、以下のような効果を奏する。
【0044】
第一に、送受信回路11により、データ入出力タイミングがハードウェア的に同期させられているので、従来技術のインターフェース制御用ソフトウェアが不要になり、インターフェース・ソフトウェアが大幅に簡素化される。つまり、通常のSPIのインターフェース・ハードウェアをわずかに改修するだけで、EEPROM2との通信用のインターフェース・ソフトウェアのコードサイズを大幅に低減することができる。
【0045】
それゆえ、同ソフトウェアを格納するためのROM容量はわずかで済むようになるという効果がある。また、同ソフトウェアの処理時間が大幅に短縮され、短時間でのマイクロコンピュータ1とEEPROM2とのシリアル通信が可能になるという効果がある。さらに、同ソフトウェアの演算処理にかかるCPUタイムもわずかで済むので、EEPROM2との通信に割かれるCPUタイムが大幅に低減され、CPUがすぐに他の処理にかかることができるようになるという効果がある。すなわち、シリアル通信はEEPROMインターフェースにほとんど任せきりにして、EEPROM2とのシリアル通信を行っている間に、マイクロコンピュータ1のCPUは他のタスクを処理することができるようになるという効果がある。
【0046】
第二に、従来のSPIからのインターフェース・ハードウェアの改修はわずかであるうえに、EEPROMモード用のインターフェース・ソフトウェアを格納するためのROM容量が少なくて済むので、コストアップはほとんどない。むしろインターフェース・ソフトウェアの開発費用とROM容量との低減分により、かえってコストダウンになるという効果がある。
【0047】
以上詳述したように、本実施例のEEPROMインターフェース内蔵マイクロコンピュータ1によれば、コストアップを防ぎながら、EEPROMシリアルインターフェース制御用ソフトウェアのコードサイズを大幅に低減することができる。その結果、同ソフトウェアの格納に必要とされるROM容量が減るばかりではなく、短時間でEEPROMとの通信ができるようになるうえに、CPUをより有効に利用できるようになるという効果がある。また、送受信のデータ長が所望の長さに設定できるようになり、データ長に関する自由度が増すという効果もある。
【図面の簡単な説明】
【図1】 実施例1としてのマイクロコンピュータの構成を示す模式図
【図2】 実施例1でのデータ書き込み時の信号タイミングチャート
【図3】 実施例1でのデータ読み出し時の信号タイミングチャート
【図4】 クロック同期シリアルインターフェースの接続を示す模式図
【図5】 クロック同期シリアルインターフェースのタイミングチャート
【図6】 クロック同期シリアルインターフェースのタイミングチャート
【符号の説明】
1:EEPROMインターフェース内蔵マイクロコンピュータ
10:EEPROMインターフェース(SPIと兼用)
11:送受信回路 12:ダミークロック信号生成回路
13:空読み手段 14:送信データ生成手段
1b:通信ビジー端子 1c:シリアルクロック端子
1d:データ送信端子 1e:データ受信端子
2:EEPROM
1’:従来のマイクロコンピュータ(マスター側)
2’:他のデバイス(スレーブ側)
[0001]
BACKGROUND OF THE INVENTION
The present invention belongs to the technical field of microcomputers, and more specifically, to the technical field of microcomputers incorporating an interface suitable for serial communication with an EEPROM.
[0002]
[Prior art]
In data communication between a microcomputer and another device, either a parallel communication method or a serial communication method is roughly classified into one of two methods. In general, serial communication enables communication between a microcomputer and other devices with a few signal lines, so communication with much fewer signal lines than parallel communication is possible, and packaging and wiring are easy. There is an advantage of becoming.
[0003]
Normally, as shown in FIG. 4, when serial communication is performed between a conventional microcomputer 1 ′ and another device 2 ′ (various memories other than EEPROM and other microcomputers), a serial clock terminal, Communication is performed via the data transmission terminal and the data reception terminal. The serial synchronous communication resource used at this time is a clock synchronous serial interface built in the microcomputer, and data input and output are performed with a half clock shift from each other. That is, as shown in FIG. 5 and FIG. 6, the output from the data transmission terminal starts at one timing of the rising and falling edges of the pulsed clock signal, and conversely the data at the other timing. Reading at the receiving terminal is performed. Such a normal serial communication system is called an SPI (serial parallel interface) communication system.
[0004]
4 to 6, CSN is a chip select terminal (terminal or signal, hereinafter the same), SCK is a serial clock terminal, CTX is a data transmission terminal, CRX is a data reception terminal, and CBUSY is a communication busy terminal. . As for the signal input / output at these terminals, CSN, SCK, and CTX are port outputs, and the remaining CRX and CBUSY are port inputs as viewed from the conventional microcomputer 1 ′ on the master side. Note that LSB / MSB at the right ends of FIGS. 5 and 6 means that data communication is possible with either LSB first or MSB first. 5 and 6 are the same as each other except that the serial clock signal timing of SCK is reversed.
[0005]
On the other hand, when serial communication is performed between a conventional ordinary microcomputer and EEPROM without special communication hardware, communication is performed while controlling existing port resources with communication software. That is, the signal value of each port corresponding to CS (BUSY), SK (CSK), DO, and DI is directly controlled to 0 or 1 by communication software. While the serial communication with the EEPROM is performed in this way, the CPU of the microcomputer is completely involved in processing of the communication software, and thus cannot perform other processes. However, if you interrupt other processing and try to perform parallel processing in a time-sharing manner, you will have to divide the communication for one time and divide it into multiple times for serial communication. The required time becomes longer. Therefore, it is inconvenient because it cannot communicate with the EEPROM at high speed in parallel with other processing.
[0006]
Not only that, but it is clear that the communication method with the EEPROM differs from the above SPI communication method in data input / output timing, so the SPI method serial interface normally built in the microcomputer should be applied as it is. Is not easy. However, since the EEPROM communication protocol has already been established as an industry standard, the interface resources of the microcomputer must be adapted to the EEPROM mode. Therefore, as described above, a large interface control software is prepared on the microcomputer side for serial communication with the EEPROM, and the data transmission / reception timing of the microcomputer is controlled by the software.
[0007]
[Problems to be solved by the invention]
In the prior art described above, since the input / output control with the EEPROM is performed by the software of the microcomputer as described above, there is a disadvantage that the code size of the software for controlling the EEPROM interface becomes large. Then, there is a disadvantage that a large ROM capacity is required to store the software. In addition, since the code size of the software is large, the CPU processing time is not a little consumed for the arithmetic processing, and the CPU cannot perform other processing during that time.
[0008]
Accordingly, it is an object of the present invention to provide a microcomputer with a built-in EEPROM interface that prevents the increase in cost while reducing the code size of the software for controlling the EEPROM interface and reducing the CPU load required for communication with the EEPROM.
[0009]
[Means for Solving the Problems]
In order to solve the above problems, the inventors have invented the following means.
[0010]
That is, the inventors need only slightly modify the hardware configuration for SPI so that the data input from the data receiving terminal is delayed by a half step with respect to the data output from the data transmitting terminal. Discovered. As a result, communication at the timing of the EEPROM mode is basically possible by slightly modifying the communication hardware that is standardly equipped with the microcomputer having the serial interface, and the first means is invented. It came to. Furthermore, the second means and the third means were invented for the purpose of complementing the first means. Then, a microcomputer having all the requirements of the first means, the second means, and the third means is made on a trial basis, a communication test with the EEPROM is performed, and it is confirmed that the microcomputer functions perfectly. Completed.
[0011]
(First means)
The first means of the present invention is the microcomputer with built-in EEPROM interface according to claim 1.
[0012]
In this means, the EEPROM interface of the microcomputer has a transmission / reception circuit that performs transmission from the data transmission terminal and reception at the data reception terminal when the serial clock signal falls. This transmission / reception circuit synchronizes data input / output timing in hardware, eliminating the need for timing adjustment software, and greatly simplifying software that waits for output data and reads and processes input data It becomes. That is, the code size of the interface software for communication with the EEPROM can be significantly reduced by slightly modifying the interface hardware for the normal SPI mode.
[0013]
Therefore, the capacity of the ROM for storing the software becomes small, the processing time of the software is greatly shortened, and serial communication between the microcomputer and the EEPROM in a short time becomes possible. Not only that, but the CPU time required for the calculation processing of the software is very small, so the CPU time allocated for communication with the EEPROM is greatly reduced, and the CPU can immediately start other processing. . That is, the serial communication is almost entirely left to the EEPROM interface, and the CPU of the microcomputer can process other tasks while performing the serial communication with the EEPROM.
[0014]
Further, since the interface hardware is slightly modified and the ROM capacity for storing the interface software for the EEPROM mode is small, the cost is hardly increased. On the contrary, there is a possibility that even the cost can be reduced by the reduction in the interface software development cost and the ROM capacity.
[0015]
Furthermore, as described above, the configuration of the interface hardware in this means is only slightly different from that of the normal SPI communication system, so it is easy to use the interface hardware also as an SPI. . Even if they are shared, the cost increase is slight, so from the viewpoint of the versatility of the microcomputer, it is desirable to use a microcomputer equipped with SPI / EEPROM interface hardware.
[0016]
Therefore, according to the microcomputer with built-in EEPROM interface of this means, the code size of the EEPROM serial interface control software can be greatly reduced while preventing an increase in cost. As a result, not only the ROM capacity required for storing the software is reduced, but also communication with the EEPROM can be performed in a short time, and the CPU can be used more effectively.
[0017]
(Second means)
The second means of the present invention is the microcomputer with a built-in EEPROM interface according to claim 2.
[0018]
In this means, the EEPROM interface has a dummy clock signal generation circuit for generating a dummy clock signal after the serial clock signal is completed so that the final signal from the EEPROM can be received at the data reception terminal.
[0019]
When the microcomputer reads data from the EEPROM, the last one bit of the read data is sent later from the last serial clock signal in the EEPROM interface in which the normal SPI interface is modified. Therefore, if only the normal serial clock signal is referred to, the last one bit may be missed. Therefore, in this means, after the serial clock signal is finished, the dummy clock signal generation circuit generates the dummy clock signal inside the EEPROM interface, so that the last one bit sent from the EEPROM can be reliably received. ing. As a result, the microcomputer according to this means can receive the data without being read out until the last bit of the read data sent from the EEPROM.
[0020]
Therefore, according to the present means, in addition to the effect of the first means described above, the last one bit of the received data sent from the EEPROM is reliably received even if the hardware modification from the SPI interface is slight. The effect is that you will be able to.
[0021]
(Third means)
The third means of the present invention is the microcomputer with built-in EEPROM interface according to claim 3.
[0022]
In the present means, the EEPROM interface includes idle reading means for idle reading of the first half of the signals received at the data reception terminal, and dummy data added to the transmission data from the data transmission terminal to add the data length of the transmission data. Transmission data generating means capable of adjusting the transmission data.
[0023]
That is, since the normal SPI interface performs data transmission / reception in parallel, the EEPROM interface with a modified SPI interface may cause the following two problems.
[0024]
First, while the microcomputer sends instructions and addresses to the EEPROM, the EEPROM interface of the microcomputer may read the potential applied to the data reception terminal as significant data. Therefore, in this means, an empty reading means is provided in the EEPROM interface, so that a meaningless signal in the first half of signals received at the data receiving terminal is read empty and discarded. As a result, the microcomputer of this means can surely prevent the inconvenience that the meaningless potential applied to the data receiving terminal is read as significant data from the EEPROM.
[0025]
Second, at the time of reading data from the EEPROM, if the potential from the data transmission terminal is indefinite in the EEPROM interface of the microcomputer, there is a possibility that some trouble will occur in the operation of the EEPROM. Therefore, in this means, by providing an appropriate transmission data generation means in the EEPROM interface of the microcomputer, it is possible to add harmless dummy data to the transmission data from the data transmission terminal and appropriately adjust the data length of the transmission data. I can do it. As a result, even when data is read from the EEPROM, a signal sent from the data transmission terminal to the EEPROM becomes harmless, and malfunction of the EEPROM is reliably prevented.
[0026]
In addition, in normal SPI, the length of data that can be transmitted and received is usually limited to 8 bits or 16 bits, but the data length is freed by the transmission data generation means. In other words, by adjusting the transmission data length by adding dummy data to the transmission data in accordance with the length of data to be transmitted / received to / from the EEPROM, data having a length other than 8 bits or 16 bits can be transmitted / received. become.
[0027]
Explaining in more detail with an example, when reading data from the EEPROM, the transmission data from the microcomputer is configured as [dummy data] + [transmission data] + [dummy data of the reception data length], and the desired reception data. Sent to the length. Conversely, when data is written to the EEPROM, transmission data from the microcomputer is transmitted according to a desired transmission data length with a configuration of [dummy data] + [transmission data]. As a result, since the data length of transmission / reception can be set to a desired length, the degree of freedom regarding the data length increases in communication with the EEPROM.
[0028]
Therefore, according to this means, in addition to the effects of the first means or the second means described above, the following two effects are produced even if the hardware modification from the SPI interface is slight. That is, first, the data length of transmission / reception can be set to a desired length, so that there is an effect that the degree of freedom regarding the data length is increased. Next, data transmission / reception with the EEPROM can be performed with higher reliability. There is an effect of becoming.
[0029]
(Fourth means)
The fourth means of the present invention is the microcomputer with built-in EEPROM interface according to claim 4.
[0030]
In this means, since the hardware of the EEPROM interface also serves as the hardware of the SPI (serial parallel interface), the function of the interface hardware is simple and the functions are enhanced. Here, the configuration of the interface hardware of the first means described above is only slightly different from that of the normal SPI communication system, so it is technically easy to use the interface hardware also as an SPI. It is. And even if it is shared, there is an advantage that the versatility of the microcomputer increases because the cost increase is slight.
[0031]
Therefore, according to this means, there is an effect that the versatility of the microcomputer can be improved with a slight increase in cost.
[0032]
DETAILED DESCRIPTION OF THE INVENTION
The embodiments of the microcomputer with built-in EEPROM interface according to the present invention will be described clearly and sufficiently in the following examples so that a person skilled in the art can understand the embodiments.
[0033]
[Example 1]
(Configuration of Example 1)
As shown in FIG. 1, the microcomputer 1 with a built-in EEPROM interface as the first embodiment of the present invention is a one-chip microcomputer, and is connected to the EEPROM 2 by at least four signal lines. These four conducting wires are a communication busy signal line BUSY, a serial clock signal line SCK, a data output signal line DO, and a data input signal line DI in order from the top in the figure. The microcomputer 1 of this embodiment has a communication busy terminal 1b, a serial clock terminal 1c, a data transmission terminal 1d, and a data reception terminal 1e, and the above-described signal lines are connected to these terminals.
[0034]
The microcomputer 1 of the present embodiment incorporates an EEPROM interface 10 that can exchange data with the EEPROM 2 through these terminals 1b to 1e. The EEPROM interface 10 has a configuration obtained by slightly modifying a normal SPI, and includes a transmission / reception circuit 11, a dummy clock signal generation circuit 12, an idle reading unit 13, and a transmission data generation unit 14, unlike the normal SPI. Here, the three signals BUSY, SCK, and DO are port outputs of the EEPROM interface 10, and only one remaining signal DI is a port input of the EEPROM interface 10. Note that the EEPROM interface 10 is configured to be used as a normal SPI.
[0035]
As shown in FIG. 2 and FIG. 3, the transmission / reception circuit 11 is a circuit that performs transmission from the data transmission terminal 1d and reception at the data reception terminal 1e when the serial clock signal SCK falls. The transmission / reception circuit 11 is configured as hardware as a part of the integrated circuit of the microcomputer 1, and does not impose a load on the CPU and has a very high processing speed.
[0036]
The dummy clock signal generation circuit 12 receives an internal dummy clock signal after the serial clock signal SCK is completed, as shown at the right end of FIG. 3, so that the data reception terminal 1e can receive the final signal D0 from the EEPROM 2. This is a circuit to be generated. The dummy clock signal generation circuit 12 is also configured as hardware as a part of the integrated circuit of the microcomputer 1, and does not apply a load to the CPU. The dummy clock signal generation circuit 12 is configured as a part of the transmission / reception circuit 11.
[0037]
As shown in the left half of FIG. 3, the idle reading means 13 is software-configured means for idlely reading a meaningless signal in the first half of the signal DI received at the data receiving terminal 1e. On the other hand, the transmission data generation means 14 can adjust the data length of the transmission data DO by adding dummy data to the transmission data DO from the data transmission terminal 1d, as shown in the upper right part of FIGS. It is configured by software. The software of the idle reading means 13 and the transmission data generating means 14 is stored in the RAM or ROM of the microcomputer 1 and is processed by the CPU.
[0038]
(Operation of Example 1)
Since the microcomputer 1 with built-in EEPROM interface of the present embodiment is configured as described above, it exhibits the following operations.
[0039]
As shown in FIGS. 2 and 3, the transmission / reception circuit 11 transmits the transmission data DO from the data transmission terminal 1d and receives the reception data DI at the data reception terminal 1e when the serial clock signal SCK falls. Has an effect. Therefore, when communicating with the EEPROM 2, unlike the prior art, interface control software processed by the CPU is unnecessary, and data transmission / reception is processed at high speed by hardware.
[0040]
Further, as shown in the left half of FIG. 3, the idle reading means 13 idle-reads the first half of the meaningless signal including the reception data DI received at the data receiving terminal 1e when data is read from the EEPROM 2. Has the effect of That is, the meaningless signal in the first half of the signals received at the data receiving terminal 1e is read idle and discarded, so that the meaningless potential applied to the data receiving terminal 1e is read as significant data from the EEPROM 2. There is no inconvenience.
[0041]
On the other hand, the transmission data generating means 14 adds the harmless dummy data consisting mainly of zero to the transmission data DO from the data transmission terminal 1d as shown in the upper sequence of FIGS. Has the effect of adjusting the length. As a result, not only the data length of the transmission data DO can be adjusted, but also the malfunction of the EEPROM is surely prevented.
[0042]
Further, as shown at the right end of FIG. 3, the dummy clock signal generation circuit 12 has a function of generating a dummy clock signal inside the transmission / reception circuit 11 after the serial clock signal SCK is completed. As a result, the final signal D0 from the EEPROM 2 that comes after the last pulse of the serial clock signal SCK is reliably received by the data receiving terminal 1e, and the last one bit of the received data DI is not read out.
[0043]
(Effect of Example 1)
The microcomputer 1 according to the present embodiment is configured as described above and has the above-described functions, and thus has the following effects.
[0044]
First, since the data input / output timing is synchronized in hardware by the transmission / reception circuit 11, the interface control software of the prior art becomes unnecessary, and the interface software is greatly simplified. That is, the code size of the interface software for communication with the EEPROM 2 can be significantly reduced by slightly modifying the normal SPI interface hardware.
[0045]
Therefore, the ROM capacity for storing the software can be reduced. In addition, the processing time of the software is greatly shortened, and serial communication between the microcomputer 1 and the EEPROM 2 can be performed in a short time. Further, since the CPU time required for the calculation processing of the software is very small, the CPU time allocated for communication with the EEPROM 2 is greatly reduced, and the CPU can immediately start other processing. is there. That is, there is an effect that the CPU of the microcomputer 1 can process other tasks while serial communication with the EEPROM 2 is almost entirely left to the EEPROM interface.
[0046]
Secondly, the interface hardware from the conventional SPI is slightly modified and the ROM capacity for storing the interface software for the EEPROM mode is small, so that the cost is hardly increased. Rather, there is an effect that the cost is reduced by the reduction of the development cost of the interface software and the ROM capacity.
[0047]
As described above in detail, according to the microcomputer 1 with built-in EEPROM interface of the present embodiment, the code size of the EEPROM serial interface control software can be significantly reduced while preventing an increase in cost. As a result, not only the ROM capacity required for storing the software is reduced, but also communication with the EEPROM can be performed in a short time, and the CPU can be used more effectively. In addition, the transmission / reception data length can be set to a desired length, and the degree of freedom regarding the data length is also increased.
[Brief description of the drawings]
FIG. 1 is a schematic diagram showing a configuration of a microcomputer as Example 1. FIG. 2 is a signal timing chart at the time of data writing in Example 1. FIG. 3 is a signal timing chart at the time of data reading in Example 1. Fig. 4 Schematic diagram showing connection of clock synchronous serial interface [Fig. 5] Timing chart of clock synchronous serial interface [Fig. 6] Timing chart of clock synchronous serial interface [Explanation of symbols]
1: Microcomputer with built-in EEPROM interface 10: EEPROM interface (also used as SPI)
11: Transmission / reception circuit 12: Dummy clock signal generation circuit 13: Empty reading means 14: Transmission data generation means 1b: Communication busy terminal 1c: Serial clock terminal 1d: Data transmission terminal 1e: Data reception terminal 2: EEPROM
1 ': Conventional microcomputer (master side)
2 ': Other device (slave side)

Claims (3)

通信ビジー端子、シリアルクロック端子、データ送信端子およびデータ受信端子を有し、EEPROMとのシリアル通信によるデータの授受が可能なEEPROMインターフェースを内蔵したマイクロコンピュータであって、
前記EEPROMインターフェースは、前記データ送信端子からのデータ出力に対して前記データ受信端子からのデータ入力を半ステップ遅らせるように、通常のSPIモード用のインターフェース・ハードウェアを改修し、シリアルクロック信号の立ち下がり時に前記データ送信端子からの送信と前記データ受信端子での受信とを行うようにした送受信回路と、前記データ受信端子で前記EEPROMからの最終信号を受信できるように、前記シリアルクロック信号が終了した後でシリアルクロック信号とは異なる内部的なダミークロック信号を生成するダミークロック信号生成回路とをもち、
前記シリアルクロック信号は前記通信ビジー端子からビジー信号が出力されている間のみに前記EEPROMに出力されるものであることを特徴とする、
EEPROMインターフェース内蔵マイクロコンピュータ。
A microcomputer having a communication busy terminal, a serial clock terminal, a data transmission terminal, and a data reception terminal and having an EEPROM interface capable of transferring data by serial communication with the EEPROM,
The EEPROM interface modifies the interface hardware for normal SPI mode so that the data input from the data receiving terminal is delayed by a half step with respect to the data output from the data transmitting terminal, and the serial clock signal rises. A transmission / reception circuit that performs transmission from the data transmission terminal and reception at the data reception terminal at the time of falling , and the serial clock signal ends so that the final signal from the EEPROM can be received at the data reception terminal After having a dummy clock signal generation circuit that generates an internal dummy clock signal different from the serial clock signal,
The serial clock signal is output to the EEPROM only while a busy signal is output from the communication busy terminal .
Microcomputer with built-in EEPROM interface.
前記EEPROMインターフェースは、前記データ受信端子で受信する信号のうち前半の無意味な信号を空読みする空読み手段と、前記データ送信端子からの送信データにダミーデータを付け加えて該送信データのデータ長を調整することができる送信データ生成手段とをもつ、
請求項1に記載のEEPROMインターフェース内蔵マイクロコンピュータ。
The EEPROM interface includes idle reading means for idle reading of the first half of the signals received at the data reception terminal, and dummy data is added to the transmission data from the data transmission terminal to add the data length of the transmission data. Transmission data generating means capable of adjusting the
The microcomputer with a built-in EEPROM interface according to claim 1.
前記EEPROMインターフェースのハードウェアは、SPI(シリアル・パラレル・インターフェース)のハードウェアを兼ねている、The hardware of the EEPROM interface also serves as the hardware of SPI (serial parallel interface),
請求項1および請求項2のうち一方に記載のEEPROMインターフェース内蔵マイクロコンピュータ。The microcomputer with a built-in EEPROM interface according to any one of claims 1 and 2.
JP26431799A 1999-09-17 1999-09-17 Microcomputer with built-in EEPROM interface Expired - Lifetime JP3829906B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP26431799A JP3829906B2 (en) 1999-09-17 1999-09-17 Microcomputer with built-in EEPROM interface

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP26431799A JP3829906B2 (en) 1999-09-17 1999-09-17 Microcomputer with built-in EEPROM interface

Publications (2)

Publication Number Publication Date
JP2001092804A JP2001092804A (en) 2001-04-06
JP3829906B2 true JP3829906B2 (en) 2006-10-04

Family

ID=17401513

Family Applications (1)

Application Number Title Priority Date Filing Date
JP26431799A Expired - Lifetime JP3829906B2 (en) 1999-09-17 1999-09-17 Microcomputer with built-in EEPROM interface

Country Status (1)

Country Link
JP (1) JP3829906B2 (en)

Families Citing this family (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP5321283B2 (en) * 2008-07-07 2013-10-23 株式会社リコー Memory read / write device and image forming apparatus
EP2539823B1 (en) * 2010-02-23 2016-04-13 Rambus Inc. Time multiplexing at different rates to access different memory types
US8614920B2 (en) 2012-04-02 2013-12-24 Winbond Electronics Corporation Method and apparatus for logic read in flash memory
JP5467134B1 (en) * 2012-09-27 2014-04-09 華邦電子股▲ふん▼有限公司 Flash memory device and method of operating memory device

Also Published As

Publication number Publication date
JP2001092804A (en) 2001-04-06

Similar Documents

Publication Publication Date Title
JP2004171209A (en) Shared memory data transfer device
GB2302744A (en) PCMCIA card with communications and memory functions
JP3797491B2 (en) Data interface and high-speed communication system using the same
JP3829906B2 (en) Microcomputer with built-in EEPROM interface
JP4902640B2 (en) Integrated circuit and integrated circuit system
JP4160068B2 (en) Digital programming interface between baseband processor and radio frequency integrated module
JP2704419B2 (en) A bus master that selectively attempts to fill all entries in the cache line.
US11789884B2 (en) Bus system and method for operating a bus system
US20180357121A1 (en) Error correction calculation upon serial bus abort
JP2003258922A (en) Communication device using three-step communication buffer
JP2583586B2 (en) Bus control method
JP2762506B2 (en) Line controller
JPH11504741A (en) Method and apparatus for reducing latency on an interface by overlaying transmitted packets
JP4125933B2 (en) Processor system with common memory
JP2000222347A (en) Bus protocol converter
JP4190969B2 (en) Bus arbitration system in bus system and AMBA
JP2017004092A (en) Serial communication system between integrated circuits
JP2743780B2 (en) Distributed processing equipment
JPH11316736A (en) Processor and data processor using the same
JP3889205B2 (en) Master / slave system
JPH11328102A (en) Bus control system and bus control method
KR20020084725A (en) Memory controller for data transporting with low speed periperal device
JP3947223B2 (en) Method and apparatus for reducing waiting time on an interface by overlapping transmission packets
KR0146304B1 (en) Sharing unit of main memory and dpram
JP2001027991A (en) Serial data communicating method with multiple slave cpus

Legal Events

Date Code Title Description
A977 Report on retrieval

Free format text: JAPANESE INTERMEDIATE CODE: A971007

Effective date: 20040322

A131 Notification of reasons for refusal

Free format text: JAPANESE INTERMEDIATE CODE: A131

Effective date: 20041008

A521 Written amendment

Free format text: JAPANESE INTERMEDIATE CODE: A523

Effective date: 20041207

A02 Decision of refusal

Free format text: JAPANESE INTERMEDIATE CODE: A02

Effective date: 20051014

A521 Written amendment

Free format text: JAPANESE INTERMEDIATE CODE: A523

Effective date: 20051214

A911 Transfer to examiner for re-examination before appeal (zenchi)

Free format text: JAPANESE INTERMEDIATE CODE: A911

Effective date: 20051219

TRDD Decision of grant or rejection written
A01 Written decision to grant a patent or to grant a registration (utility model)

Free format text: JAPANESE INTERMEDIATE CODE: A01

Effective date: 20060621

A61 First payment of annual fees (during grant procedure)

Free format text: JAPANESE INTERMEDIATE CODE: A61

Effective date: 20060704

R150 Certificate of patent or registration of utility model

Ref document number: 3829906

Country of ref document: JP

Free format text: JAPANESE INTERMEDIATE CODE: R150

Free format text: JAPANESE INTERMEDIATE CODE: R150

FPAY Renewal fee payment (event date is renewal date of database)

Free format text: PAYMENT UNTIL: 20090721

Year of fee payment: 3

FPAY Renewal fee payment (event date is renewal date of database)

Free format text: PAYMENT UNTIL: 20100721

Year of fee payment: 4

FPAY Renewal fee payment (event date is renewal date of database)

Free format text: PAYMENT UNTIL: 20110721

Year of fee payment: 5

FPAY Renewal fee payment (event date is renewal date of database)

Free format text: PAYMENT UNTIL: 20120721

Year of fee payment: 6

FPAY Renewal fee payment (event date is renewal date of database)

Free format text: PAYMENT UNTIL: 20120721

Year of fee payment: 6

FPAY Renewal fee payment (event date is renewal date of database)

Free format text: PAYMENT UNTIL: 20130721

Year of fee payment: 7

R250 Receipt of annual fees

Free format text: JAPANESE INTERMEDIATE CODE: R250

R250 Receipt of annual fees

Free format text: JAPANESE INTERMEDIATE CODE: R250

R250 Receipt of annual fees

Free format text: JAPANESE INTERMEDIATE CODE: R250

R250 Receipt of annual fees

Free format text: JAPANESE INTERMEDIATE CODE: R250

R250 Receipt of annual fees

Free format text: JAPANESE INTERMEDIATE CODE: R250

R250 Receipt of annual fees

Free format text: JAPANESE INTERMEDIATE CODE: R250

EXPY Cancellation because of completion of term