JP3985614B2 - Automatic identification method of serial memory - Google Patents

Automatic identification method of serial memory Download PDF

Info

Publication number
JP3985614B2
JP3985614B2 JP2002204724A JP2002204724A JP3985614B2 JP 3985614 B2 JP3985614 B2 JP 3985614B2 JP 2002204724 A JP2002204724 A JP 2002204724A JP 2002204724 A JP2002204724 A JP 2002204724A JP 3985614 B2 JP3985614 B2 JP 3985614B2
Authority
JP
Japan
Prior art keywords
data
byte
read
address
memory
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 - Fee Related
Application number
JP2002204724A
Other languages
Japanese (ja)
Other versions
JP2004046649A (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.)
Miyazaki Epson Corp
Original Assignee
Miyazaki Epson 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 Miyazaki Epson Corp filed Critical Miyazaki Epson Corp
Priority to JP2002204724A priority Critical patent/JP3985614B2/en
Publication of JP2004046649A publication Critical patent/JP2004046649A/en
Application granted granted Critical
Publication of JP3985614B2 publication Critical patent/JP3985614B2/en
Anticipated expiration legal-status Critical
Expired - Fee Related legal-status Critical Current

Links

Images

Description

【0001】
【発明の属する技術分野】
本発明は、シリアルメモリのアドレス長のタイプ自動判別方法に関する。
【0002】
【従来の技術】
近年、半導体技術の進歩により携帯端末等の電子機器に搭載されるメモリの容量はますます拡大する傾向にある。また、入出力のポート数が少ないため小型化にも対応しやすいシリアルインタフェースを備えたメモリがよく使われていることは周知のことである。
【0003】
図14(a)は一般的なシリアルメモリのブロック図を示したものである。
図14(a)において、一般的なシリアルメモリは最低限4つのポートDI(入力)、Do(出力)、Cs(チップセレクト)、SK(シリアルクロック)を備えていることが知られている。
ここで、DIポートは書き込みコマンドや読み込みコマンド、並びにアドレスを指定する一連のシリアルデータを入力するためのポートであり、Doはメモリから読み出したシリアルデータが出力されるポートである。
【0004】
また、Csはメモリをアクセス可能とするためのポートであって、通常CsをLoレベルに設定することでメモリがアクティブな状態となり、データを書き込んだり、或いは読み出すといったことができるようになっている。さらに、SKはシリアルクロックを入力するためのポートであって、CsをHi→Loレベルに設定後、ここへシリアルクロックを入力し所定の書き込みや、読み出しを行うようになっている。
【0005】
図14(b)(c)は前記シリアルメモリの読み出しタイミングチャート、及び書き込みタイミングチャートをそれぞれ示したものである。図14(b)に示すように、読み出し時にはDIポートに読み出しコマンド及び読み出しアドレスを一連のシリアルデータとしてあたえ、さらにこれに同期したシリアルクロックデータをSKポートに与える。すると読み出しアドレスに対応した読み出しデータが前記シリアルクロック信号に同期して出力される。
【0006】
一方、図14(c)に示すように、書き込み時には一旦CsをHi→Loに設定しておいて、DIポートから書き込みコマンド、書き込みアドレス及び書き込みデータを一連のシリアルデータとして与えておく。そして、CsをLo→Hiレベルに戻すと書き込みが実行される。
【0007】
一般的に電子機器に搭載するシリアルメモリには様々なメモリサイズが用意されているが、メモリサイズによって前記読み出し(書き込み)アドレスのビット長のみが異なっている。したがって、対応するメモリサイズによってアドレスのビット長だけを変えれば、様々なメモリサイズに対応することが可能である。また、特開2000−122921号公報において、搭載したメモリサイズが未知のものであっても、前記DIポートに与えるシリアルデータの先頭とDoポートから出力される読み出しデータのタイミングがメモリサイズによって異なることを利用して、メモリサイズを自動認識する方法が提案されている。
【0008】
【発明が解決しようとする課題】
しかしながら、特開2000−122921号公報にて提案されているメモリサイズ自動認識方法は以下のような問題点がある。すなわち、従来のメモリサイズ自動認識方法は、未知のメモリのDIポートに所定ビットの読み出しコマンドと読み出しアドレスをあたえたとき、Doポートから出力される読み出しデータの先頭に応答ビット(Loレベル)が付与されているものを想定しており、前記読み出しデータの先頭がHiレベル→Loレベル(応答ビット)となる変化を検出し、前記読み出しコマンドの先頭と検出した応答ビットとの時間差によってメモリサイズを判定するようになっている。このため、例えば応答ビットが付与されていないSPI(Serial Peripheral Interface)といった一般的に良く普及したインタフェースのシリアルメモリには、この自動認識方法は対応できない。
【0009】
また、読み出しデータ先頭のHiレベル→Loレベルの変化を検出するためにはDoポートが応答ビットを出力する前のデータ不確定の状態において、ポートの出力電圧をHiレベルに固定しなければならないため、ポートには電源へのプルアップ抵抗を付加しなければならず部品点数が増えてしまうという問題があった。
本発明は上記問題点を解決するためになされたものであって、SPIタイプのシリアルメモリにも対応可能なメモリサイズ自動判別方法を提供することを目的とする。
【0010】
【課題を解決するための手段】
上記目的を解決する為に、本発明に係わるシリアルメモリ自動判定方法の請求項1記載の発明は、未知のシリアルメモリにアクセスし該シリアルメモリのアドレス長のタイプを自動的に判別する方法であって、先頭の1バイト目に書き込みコマンドを含み2バイト目から4バイト目までの各1バイトのデータ(0または4の倍数)をそれぞれ異なるように設定した所定ビット長の事前書き込み用定型ビット列を該シリアルメモリに与え事前書き込み処理を行う処理ステップと、先頭の1バイト目に読み出しコマンドを含み2バイト目のデータを前記事前書き込み用定型ビット列のものと同じ値にし3バイト目のデータは前記事前書き込み用定型ビット列のものとは異なる値に設定した所定ビット長の第1読み出し用定型ビット列を前記シリアルメモリに与え第1読み出し処理を行う処理ステップと、前記第1読み出し処理で読み出したデータから第1判定データを抽出し、当該第1判定データの値によってアドレス長のタイプを判別する第1判定処理ステップと、
を備えるよう構成したものである。
従って、本構成は未知のメモリサイズ(アドレス長のタイプ)を判別するための基本的処理を与える作用がある。
【0011】
本発明に係わる請求項2記載の発明は請求項1において、更に、先頭の1バイト目に読み出しコマンドを含み2バイト目と3バイト目のデータを前記事前書き込み用定型ビット列のものと同じ値にし4バイト目のデータは前記事前書き込み用定型ビット列のものとは異なる値に設定した所定ビット長の第2読み出し用定型ビット列を前記シリアルメモリに与え第2読み出し処理を行う処理ステップと、前記第2読み出し処理で読み出したデータから第2判定データを抽出し、当該第2判定データの値によってアドレス長のタイプを判別する第2判定処理ステップとを備えるように構成したものである。
【0012】
さらに、本発明に係わる請求項3記載の発明は請求項1において、前記第1判定処理ステップにより、8又は9ビットアドレスタイプか、10〜16ビットアドレスタイプか、17〜24ビットアドレスタイプ(故障時を含む)の3種類の何れであるかを判定するように構成したものである。
【0013】
本発明に係わる請求項4記載の発明は請求項2において、前記第2判定処理ステップにより、17〜24ビットアドレスタイプか、または、故障の何れであるかを判定するように構成したものである。
【0014】
また、本発明に係わる請求項5記載の発明は請求項1において、前記第1読み出し用定型ビット列の3バイト目のデータは、前記事前書き込み用定型ビット列の3バイト目のデータに対して01hを加算した値とした構成としたものである。
【0015】
また、本発明に係わる請求項6記載の発明は請求項2において、前記第2読み出し用定型ビット列の4バイト目のデータは、前記事前書き込み用定型ビット列の4バイト目のデータに対して01hを加算した値とした構成としたものである。
【0016】
【発明の実施の形態】
以下、図示した実施例に基づいて本発明を詳細に説明する。
図1は本発明に係わるシリアルメモリの自動判別方法の処理ステップをフローチャートで示したものである。なお、ここで説明するシリアルメモリはSPI(Serial Peripheral Interface)に準拠したものを想定しているが、メモリの入出力ポートやアクセスのタイミングについては基本的には図14に示したものと等しいので省略する。なお、図1のフローチャートはCPUが実行する処理プログラムを説明したものであり、CPUが備える汎用ポートを介してシリアルメモリの各ポートにアクセスするものとする。
【0017】
以下、図1に示したフローチャートの処理手順を説明する。
まず、図1のフローチャート全体の流れについて説明する。この処理手順においては、事前書き込み処理1において後述する所定長の書き込み用定型ビット列を複数のアドレスと共に指定して未知のシリアルメモリに書き込む。そして第1読み出し処理2によって前記書き込んだデータを読み出し、このうち2アドレスの2バイト分(1アドレス=1バイトと仮定)を第1判定処理3にて判定すると、未知のシリアルメモリは8、9ビットタイプか16ビットタイプかそれ以外のものに分類される。
【0018】
さらに、8、9ビット、16ビットいずれのタイプでもないと判定されたものについては、第2判定読み出し処理4において、前記第1読み出し処理2で指定したアドレスとは異なる別アドレスを指定し、別のデータが読み出される。そして、このうち2アドレス分の2バイトのデータを第2判定処理5において判定し、24ビットタイプか或いは故障品かの判定をして処理フローが終了するようになっている。
【0019】
そこで、各処理ステップを説明する前にSPI準拠のシリアルメモリのデータ構造とページ書き込み(読み出し)について説明する。一般にSPI準拠のシリアルメモリにはページという概念が使われている。これについてアドレス8ビット或いは9ビットのメモリを例に説明しよう。
図2(a)(b)は8ビットアドレス、9ビットアドレスのメモリのデータ構造を示したものである。図2において、例えば(a)の8ビットアドレスのメモリについては、アドレスを00h〜FFhまで指定でき、D1〜D256(各データは1バイト単位とする)の合計256バイトのデータを記憶させることができる。
【0020】
ここで、各データの何バイトかのまとまりを1ページと呼んでいる。通常1ページはメモリサイズによって4、8、16、32、256バイトといった4の倍数のページサイズになっているのが一般的であるので、ここでは4バイト/ページとして説明している。
従って、4バイト/ページとすると8ビットアドレスのメモリは64ページのデータ構造となっている。
【0021】
また、図2(b)に示した9ビットアドレスのメモリについては、アドレス00h〜1FFhまで指定でき、D1〜D512の512バイトを格納でき、128ページのデータ構造となっている。
ここで、データをメモリに書き込む際、図14においてDI(入力)ポートから書き込みコマンドとアドレスを入力し、それに続いて書き込みデータを4バイト分連続的に入力する。すると、前記書き込みデータは前記アドレスから順番に1バイトずつ同一ページ内に連続的に書き込まれるようになっている。例えば、8ビットアドレスのメモリで説明すると、アドレスを00hに指定しそれに続いてD1〜D4を4バイト分のデータとして入力すると、アドレス00h〜03hにD1〜D4の1バイトずつが連続的に書き込まれる。
【0022】
ただし、次ページをまたいでデータを連続的に書き込むことは禁止されている。
例えばアドレス00hを指定しそれに続いてD1〜D5の5バイト分を指定しても、00h〜03hにD1〜D4を書き込み、続いてD5を次のアドレス04hに書き込もうとするが次ページに進むことが出来ない。よって、同一ページの先頭のアドレス00hに戻り、先に書き込まれたD1をD5で上書きするようになっている。
【0023】
一方、読み出しの場合は読み出しコマンドと共にアドレスを入力し、それに続いてダミーデータを必要バイト分入力する。すると、該アドレスから連続したアドレス順で前記入力したダミーデータに同期してデータが1バイトずつ連続的に読み出されるようになっている。なお、読み出しの場合ダミーデータを付加すれば、ページに関係なく連続的に読み出しが可能である。ここで、ダミーデータはどのようなデータであっても構わない。
【0024】
さて、以下図1の事前書き込み処理1について詳細に説明する。
まず、図3(a)にDIポートから入力する書き込みコマンドを含む事前書き込み用定型ビット列を図示する。
先頭のコマンド(1)は書き込みを指定するデータであり、通常1バイトのデータとして与えるが上位5ビットについては各ビットを0に設定し、下位の3ビットに書き込みに相当するビットを設定している。さらに前記1バイトの書き込みコマンド(1)に続き一連のデータ(2)〜(7)を入力する。
ここで、00hは1バイトのオールゼロのデータ(16進表示)であり、また“T”、“P”、“R”、“D”、“G”は各文字の1バイトコードを示す。(以下、アドレス、データ、或いは文字コードを16進表示で表現する場合は、例えば1Fhというように、末尾にhを添字する。)
また、前記事前書き込み用定型ビット列を入力する際、図14に示したCsポートやSKポートには所定の信号が与えられているが、説明を簡単にするため、以下それらの説明は省略する。
【0025】
さて、図3(a)に示した書き込みコマンドを含む事前書き込み用定型ビット列を8ビットアドレスのメモリに入力すると、コマンド(1)に続く(2)の1バイト(8ビット)がアドレスとして認識されるので、以降(3)〜(7)の5バイトは書き込みデータとして処理される。
ただし、前述した理由により1ページ目と2ページ目をまたいで書き込むことは出来ない。従って、図3(b)に示すように1ページ目のアドレス00h〜03hに順次“T”“P”“R”“D”と書き込まれ、さらにアドレス00hのデータD1が“T”→“G”に上書きされた結果、00h〜03hのアドレスにはそれぞれ“G”“P”“R”“D”が格納される。
【0026】
一方、事前書き込み用定型ビット列を9ビットアドレスメモリに入力すると、コマンド(1)の先頭から5ビット目(ここでは0に設定)が最上位アドレスとして解釈され、後続(2)の1バイトは下位8ビットのアドレスとして解釈されるので、8ビットアドレスの例と同様に図4(b)に示すように、000h〜003hのアドレスにそれぞれ“G”“P”“R”“D”が格納される。
【0027】
さらに、事前書き込み用定型ビット列を16ビットアドレスのメモリに入力した結果を図5(a)(b)に図示する。この場合コマンド(1)に続く(2)(3)の2バイト分のデータ00h“T”がアドレスとしてデコードされ、(4)〜(7)の4バイト分は書き込みデータとして処理される。ここで、“T”の1バイト文字コードは54hであるため、16ビットアドレスは0054hとして認識される。その結果、メモリには0054h〜0057hのアドレスにそれぞれ“P”“R”“D”“G”のデータが格納される。なお、メモリが10〜15ビットアドレスのものであっても、メモリは1バイト毎にアドレス情報を読み込み、必要なアドレスビット数のみデコードするようになっているため書き込み結果は全く同じものとなる。
【0028】
また、事前書き込み用定型ビット列を24ビットアドレスのメモリに入力した結果を図6(a)(b)に示す。この例では書き込みコマンド(1)に続く(2)〜(4)の3バイト分00h、“T”、“P”がアドレスとしてデコードされ、(5)〜(7)の3バイト分が書き込みデータとして処理される。ここで、“T”及び“P”の文字コードはそれぞれ54h、50hであるので、アドレス005450h〜005452hにはそれぞれ“R”、“D”、“G”が書き込まれる。なお、対象のメモリがアドレス17〜23ビットのものであっても、メモリは1バイト毎にアドレス情報を読み込み、必要なアドレスビット数のみデコードするようになっているため書き込み結果は全く同じものとなる。
【0029】
以上、事前書き込み処理例について説明したが、8、9ビットアドレスメモリの事前書き込み処理例については、ページ単位が4バイトを超えてしまうとき先頭のアドレスに書き込まれたデータのみが異なる。この場合の結果を図7(a)〜(c)に示す。
なお、以上説明した事前書き込みにおいて、書き込みアドレスは事前書き込み用定型ビット列の先頭から2バイト目〜4バイト目の3バイト分00h、“T”(=54h)、“P”(=50h)が決定している。このとき、後述する第1、第2読み出し処理を実行したとき、ページをまたがってデータを読み出さないように、極力ページの先頭から順次データを書き込むように、前記アドレスを決定する各1バイトを、それぞれ0または4の倍数になるように設定している。
以上、事前書き込み処理1について説明した。
【0030】
次に、図1の第1読み出し処理について説明する。対象のシリアルメモリからデータを読み出す際、まずシリアルメモリのDI(入力)ポートに読み出しコマンドを含む第1読み出し用定型ビット列を5バイト入力する。すると、対象のシリアルメモリのDo(出力)ポートからデータが出力されるが、対象のシリアルメモリのタイプに応じて出力されるデータが異なる。以下、そのメカニズムを説明する。図8は対象のシリアルメモリが8、9ビットアドレスタイプと仮定したときの第1読み出し結果について図示したものである。なお、図8(a)は1ページが4バイトの例、図8(b)は1ページが8バイト以上の例を示している。
【0031】
図8(a)に示すように、DI(入力)から1バイトの読み出しコマンド(1)に続いて(2)〜(5)の4バイトのシリアルデータを入力する。ここで、前記第1読み出し用定型ビット列の(3)“U”(=55h)については、前述した事前書き込み用定型ビット列の(3)“T”(=54h)に対して、54hに01hを加算した値となるように設定する。
すると、対象のシリアルメモリが8ビットアドレスの場合、コマンド(1)につづく(2)の1バイトデータ00hをアドレスとして認識し(3)〜(5)の3バイト分をダミーデータとして認識する。或いは、対象のシリアルメモリが9ビットアドレスの場合、コマンド(1)の5ビット目(0に設定)と(2)の合計9ビット分をアドレス000hとして認識し(3)〜(5)の3バイト分をダミーデータとして認識する。
【0032】
ここで、前記ダミーデータはアドレス00h(000h)につづいてデータを連続的に読み出すために付加する任意のデータであって、ここでは(3)〜(5)の3バイト分に対応して、図3、4で示したアドレス00h〜02h(000h〜002h)のデータが連続的に読み出され、対象のシリアルメモリのDoポートから“G”“P”“R”が出力される。なお、必要ビット分のアドレスが入力されるまでは、Doポートの出力は不定でありデータが確定されない。
一方、図8(b)に示すように、対象のシリアルメモリが8、9ビットアドレスタイプで1ページが8バイト以上の場合、図7(b)(c)に図示したアドレス00h〜02h(000h〜002h)のデータが読み出され、対象のシリアルメモリのDoポートからは“T”“P”“R”が出力される。
【0033】
また、対象とするメモリが16ビットアドレスタイプの場合は、図9(a)に示すように、コマンド(1)につづく(2)(3)の2バイト分がアドレス0055hとして認識され、(4)(5)がダミーデータとして認識される。従って対象のシリアルメモリのDoポートからは、図5に図示したアドレス0055h、0056hのデータ“R”“D”が出力される。このとき、読み出しの先頭アドレスが事前書き込みの先頭アドレスに対して1つ繰り上がっていることに注意されたい。
【0034】
また、対象とするメモリが24ビットアドレスタイプの場合は図9(b)に示すように、コマンド(1)につづく(2)(3)(4)の3バイト分がアドレス005500hとして認識され(5)がダミーデータとして認識される。
なお、アドレス005500hは事前書き込みにおいて指定したアドレス(図6参照)と異なるものを指定しているので、ここにはどのようなデータが記憶されているか分からない状態、いわゆるデータが“不定”な状態となっている。
ここで、コマンド(1)を与えてから3バイト目及び4バイト目に出力される(4)(5)に対応したデータの部分を第1判定データと呼び、次の第1判定処理用に用いる。以上、各メモリタイプに対する第1読み出し処理2について説明した。
【0035】
次に、図1における第1判定処理3について説明する。
この処理ステップでは前述した第1読み出し処理2で読み出したデータに基づき、第1判定データを抽出する。なお、第1読み出し処理2の結果、対象とするシリアルメモリタイプは第1判定データの組順によって図10に示す表のいずれかに分類される。
第1判定データが“P”“R”の組順である場合、対象のシリアルメモリは8、9ビットアドレスタイプと判定される。第1判定データが“R”“D”の組順である場合は、対象のシリアルメモリは16ビットアドレスタイプ(10〜16ビットアドレス)と判定される。第1判定データが“不定”“不定”、すなわち上記組順以外のものであれば、対象のシリアルメモリは24ビットアドレスタイプ(17〜24ビットアドレス)或いは故障品として判定される。なお、前記第1判定データとして2バイト分抽出したが、1バイト分を抽出して処理速度を向上させても良い。
以上第1判定処理3について説明した。
【0036】
次に図1の第2読み出し処理4について説明する。
前述した第1判定処理3の結果、24ビットアドレスタイプ(17〜24ビットアドレス)或いは故障品と判定された対象については、この処理ステップ以降で故障品であるか否かの判定を行うようになっている。
そこで、まず図11に示すように対象のメモリのDIポートに対して読み出しコマンドを含む(1)〜(6)の6バイトの第2読み出し用定型ビット列を入力する。
ここで、(1)の1バイトは読み出しコマンドであり、これにつづく(2)00h、(3)“T”、(4)“Q”の3バイトをアドレス005451hとして認識させ(5)(6)はダミーデータとして認識させる。
【0037】
ただし、前記第2読み出し用定型ビット列の(2)(3)については前述した事前書き込み用定型ビット列の(2)(3)の00h、“T”と同じものに設定してあり、さらに前記第2読み出し用定型ビット列の(4)については前述した事前書き込み用定型ビット列の(4)“P”(=50h)に対応して、前記50hに01hを加算した値51hとなるように設定してある。
すると、対象のメモリが24ビットアドレスタイプであれば、Doポートからは(5)(6)のダミーデータに同期して“D”“G” が出力される。(図6を参照)
もし対象とするメモリが故障品であれば、“D”“G”の組順以外の“不定”“不定”となる。
【0038】
ここで、コマンド(1)を与えてから4バイト目及び5バイト目に出力される(5)(6)に対応したデータの部分を第2判定データと呼び、次の第2判定処理用に用いる。なお、対象のメモリが8、9ビットアドレスタイプ或いは16ビットアドレスタイプ(10〜16ビットアドレス)のものであったとしても、Doポートから出力される最後の2バイト分は必ず“R”“D”となり(図12参照)、24ビットアドレスタイプを8、9ビットタイプと判定する可能性は全くないことに注意されたい。以上、第2読み出し処理結果について説明した。
【0039】
次に、図1における第2判定処理について説明する。
この処理ステップでは前述した第2読み出し処理で読み出したデータに基づき、第2判定用データを抽出する。なお、第2読み出し処理の結果、対象とするシリアルメモリタイプは第2判定データの組によって図13に示す表のいずれかに分類される。第2判定データが“D”“G”である場合、対象のシリアルメモリは24ビットアドレスタイプ(17〜24ビットアドレス)に特定することができる。
第2判定データが“不定”“不定”、すなわち上記“D”“G”の対以外の場合は故障品として判定することができる。ここで、前記第2判定データを2バイトとしたが、これを1バイトとして処理速度を向上させてもよい。
【0040】
なお、以上説明した実施例については、対象とするシリアルメモリが1バイト単位でアドレスを付与するタイプを想定しているが、アトメル社製のAT25F512のようなアドレスが16ビットであるが、アドレスを3バイト分与えなければならないタイプもまれにではあるが存在する。このような場合は、24ビットタイプとして判定される。このような例について以下説明を補足する。
【0041】
例えばアドレスが13ビットであるが、3バイト分のアドレスを付与しなければならないタイプを例として説明する。このようなタイプのメモリは、与えた3バイトアドレスの下位13ビット分のアドレスしか認識(デコード)しない。
よって、事前書き込みにおいて、図6に示したデータを書き込んだとき、指定した先頭のアドレス005450hの下位13ビット分しかデコード(アドレス範囲でいうと000000h〜001FFFh番地しか指定できない)しないため、これを001450hと解釈し、アドレス001450h〜001452hに“R”“D”“G”のデータを書き込んでしまう。
【0042】
一方、第1読み出し処理2を行ったとき、005500hからデータを読み出そうとするが、前述した同じ理由でアドレスが001500hと解釈され、ここからデータが読み出される。したがって、このとき第1判定データは“不定”“不定”となり対象のメモリは24ビットアドレスタイプ或いは故障品として判定される。
【0043】
しかしながら、つづいて第2読み出し処理を行うと、アドレス005451h、005452hからデータを読み出そうとするが、前記同じ理由によりアドレスが001451h、001452hと解釈されここからデータが読み出される。
したがって、第2判定データは“D”“G”となり、図13の判定表が示すように対象のメモリは24ビットタイプと確定される。従って、実効のアドレス長が短いタイプであっても、アドレス付与が何バイトのタイプであるかという観点に着目すると、現状すべてのメモリは8、9ビットアドレスタイプか16ビットアドレスタイプか24ビットアドレスタイプかの何れかに分類することが可能である。
【0044】
以上、図1における全ての処理ステップについて説明した。
なお、対象のシリアルメモリのDIポートに入力する事前書き込み用定型ビット列のコマンドを除く2バイト目以降のビット列は00h、“T”、“P”、“R”、“D”、“G”に限定するものではなく、他の組み合わせであってもよい。例えば事前書き込み処理1で任意のページ内にデータを書き込んだ後、第1、第2読み出し処理を実行したとき同一ページ内のデータを読み出すように、ビット列の2バイト目〜4バイト目の各1バイトを、0または4の倍数となるように、*0h、*4h、*8h、*Chのいずれかのタイプになるように設定しておけばよい。(ただし、*は0、1、2、3、4、5、6、7、8、9、A、B、C、D、E、Fのいずれか)
【0045】
このとき、第1読み出し用定型ビット列の3バイト目(図8(a)の(3)の1バイト)は、事前書き込み用定型ビット列の3バイト目(前記“T”=54hに相当)の文字コードに対して01h加算した値となるように設定し(本実施例では“U”=55hに相当)、また第2読み出し用定型ビット列の4バイト目(図11の(4)の1バイト)は、事前書き込み用定型ビット列の4バイト目(前記“P”=50hに相当)の文字コードに対して01h加算するように設定(本実施例では“Q”=51hに相当)しておけばどのような組み合せであってもよい。
すなわち、上述した*0h、*4h、*8h、*Chの何れかに対して01hを加算した*1h、*5h、*9h、*Dhの何れかのタイプになるように設定しておけば、対象のシリアルメモリが4の倍数のページ構成であれば、第1、第2読み出し処理においてページをまたいでデータが読み出されることはないので、前述した実施例と同様な判定ができる。
【0046】
なお、抽出した第1判定データと第2判定データが互いに異なる文字コードとなるようにした方が判定の確実性が高いので、事前書き込み用定型ビット列の2バイト目以降は各1バイトが互いに異なるように設定した方がよい。
【0047】
以上、図1に示した簡単な処理ステップに従えば、SPI準拠のシリアルメモリであれば8、9ビットアドレスタイプ、16ビットアドレスタイプ、24ビットアドレスタイプの何れかに容易に分類することが可能である。しかも、対象とするメモリがDoポートのデータ出力に特定な応答ビットを含む必要がないため、Doポートに現れるポートの不定状態に影響されずにメモリタイプの判定が可能であり、Doポートのプルアップ抵抗を不要にすることができる。
【0048】
【発明の効果】
本発明に係る請求項1〜4記載のシリアルメモリのメモリサイズ自動認識方法は、未知のシリアルメモリに対して事前書き込み用定型ビット列を与えて、事前書き込み処理を行い、前記事前書き込み処理を実行後、第1の読み出し処理と第2の読み出し処理を行い、前記第1、第2の読み出したデータから第1判定データ、及び第2判定データを抽出して、前記第1判定データと第2判定データの組順に基づき未知のメモリタイプを判定するようにしたので、また本発明に係る請求項5記載の発明は前記第1判定データ及び前記第2判定データをそれぞれ少なくとも1バイトとしたので、読み出しデータに応答ビットが付与されないメモリタイプであっても容易にメモリタイプを確実に判別可能な、処理速度が向上したシリアルメモリ自動認識方法を提供するのに著効を奏す。
【図面の簡単な説明】
【図1】本発明に係るメモリタイプ自動判別方法の処理フローチャート
【図2】8、9ビットアドレスタイプのデータ構造
【図3】8ビットアドレスタイプ(4バイト/ページ)の事前書き込み結果の例
【図4】9ビットアドレスタイプの事前書き込み結果の例
【図5】16ビットアドレタイプの事前書き込み結果の例
【図6】24ビットアドレスタイプの事前書き込み結果の例
【図7】8、9ビットタイプアドレスタイプ(8バイト/ページ)の事前書き込み結果
【図8】8、9ビットアドレスタイプの第1読み出し処理結果の例
【図9】16ビットアドレスタイプ、または24ビットアドレスタイプの第1読み出し処理結果の例
【図10】第1判定データの組み合わせ例
【図11】24ビットアドレタイプの第2読み出し処理結果の例
【図12】8、9ビットアドレスタイプ、または16アドレスタイプの第2読み出し処理結果の例
【図13】第1判定データ及び第2判定データの組み合わせ例
【図14】シリアルメモリのブロック図、及びアクセスのタイミングチャート
【符号の説明】
1…事前書き込み処理
2…第1読み出し処理
3…第1判定処理
4…第2読み出し処理
5…第2判定処理
[0001]
BACKGROUND OF THE INVENTION
  The present invention relates to a serial memory.Address lengthThe present invention relates to an automatic type discrimination method.
[0002]
[Prior art]
In recent years, due to advances in semiconductor technology, the capacity of memories mounted on electronic devices such as portable terminals has been increasing. In addition, it is well known that a memory having a serial interface that can easily cope with downsizing is often used because the number of input / output ports is small.
[0003]
FIG. 14A shows a block diagram of a general serial memory.
14A, it is known that a general serial memory includes at least four ports DI (input), Do (output), Cs (chip select), and SK (serial clock).
Here, the DI port is a port for inputting a write command, a read command, and a series of serial data for designating an address, and Do is a port for outputting serial data read from the memory.
[0004]
Further, Cs is a port for making the memory accessible. Normally, by setting Cs to the Lo level, the memory becomes active, and data can be written or read. . Further, SK is a port for inputting a serial clock, and after Cs is set from Hi to Lo level, the serial clock is input to perform predetermined writing and reading.
[0005]
FIGS. 14B and 14C show a read timing chart and a write timing chart of the serial memory, respectively. As shown in FIG. 14B, at the time of reading, a read command and a read address are given to the DI port as a series of serial data, and serial clock data synchronized therewith is given to the SK port. Then, read data corresponding to the read address is output in synchronization with the serial clock signal.
[0006]
On the other hand, as shown in FIG. 14C, at the time of writing, Cs is once set from Hi to Lo, and a write command, a write address and write data are given as a series of serial data from the DI port. When Cs is changed from Lo → Hi level, writing is executed.
[0007]
Generally, various memory sizes are prepared for serial memories mounted on electronic devices, but only the bit length of the read (write) address differs depending on the memory size. Accordingly, if only the bit length of the address is changed according to the corresponding memory size, it is possible to cope with various memory sizes. Further, in Japanese Patent Laid-Open No. 2000-122921, even if the mounted memory size is unknown, the start of serial data given to the DI port and the timing of read data output from the Do port differ depending on the memory size. A method of automatically recognizing the memory size using the synthesizer has been proposed.
[0008]
[Problems to be solved by the invention]
However, the memory size automatic recognition method proposed in Japanese Patent Application Laid-Open No. 2000-122921 has the following problems. That is, in the conventional automatic memory size recognition method, when a read command and a read address of a predetermined bit are given to a DI port of an unknown memory, a response bit (Lo level) is added to the head of read data output from the Do port. The change of the read data head from Hi level to Lo level (response bit) is detected, and the memory size is determined by the time difference between the read command head and the detected response bit. It is supposed to be. For this reason, for example, this automatic recognition method cannot be applied to a serial memory having a generally well-known interface such as an SPI (Serial Peripheral Interface) to which no response bit is added.
[0009]
In addition, in order to detect a change from the Hi level to the Lo level at the beginning of the read data, the output voltage of the port must be fixed at the Hi level in a state where the data is uncertain before the Do port outputs the response bit. There is a problem that the number of parts increases because a pull-up resistor to the power source must be added to the port.
The present invention has been made to solve the above problems, and an object of the present invention is to provide a memory size automatic determination method that can also be used for an SPI type serial memory.
[0010]
[Means for Solving the Problems]
  In order to solve the above-mentioned object, the invention according to claim 1 of the serial memory automatic determination method according to the present invention accesses an unknown serial memory andAddress length typeIs a method of automatically determiningThe first byteWrite command1 byte data (0 or multiple of 4) from the 2nd byte to the 4th byte is set differentlyA processing step of giving a pre-write fixed bit string of a predetermined bit length to the serial memory and performing a pre-write process;The first byteRead commandThe second byte data is the same value as that of the pre-write fixed bit string, and the third byte data is set to a value different from that of the pre-write fixed bit string.A processing step of applying a first read fixed bit string having a predetermined bit length to the serial memory to perform a first read process, and extracting first determination data from the data read in the first read processThe address length type is determined by the value of the first determination data.First determination processing step for determiningWhen,
WithIt is comprised as follows.
  Therefore, this configuration has an unknown memory size.(Address length type)It has the effect of giving basic processing for discriminating between the two.
[0011]
  The invention according to claim 2 according to the present invention is the invention according to claim 1,Further, the read command is included in the first byte, the data in the second byte and the third byte are set to the same values as those in the pre-write standard bit string, and the fourth byte data is in the pre-write standard bit string. A second reading fixed bit string having a predetermined bit length set to a value different from the above is provided to the serial memory to perform a second reading process, and second determination data is extracted from the data read in the second reading process And a second determination processing step for determining the address length type based on the value of the second determination data.Is.
[0012]
  Furthermore, the invention according to claim 3 according to the present invention isClaim 1LeaveIn the first determination processing step, it is determined whether there are three types of 8 or 9 bit address type, 10 to 16 bit address type, or 17 to 24 bit address type (including failure time).It is comprised as follows.
[0013]
  The invention of claim 4 relating to the present invention isClaim 2LeaveIn the second determination processing step, it is determined whether it is a 17 to 24 bit address type or a failure.It is comprised as follows.
[0014]
  The invention according to claim 5 relating to the present invention isClaim 1LeaveThe third byte data of the first read fixed bit string is a value obtained by adding 01h to the third byte data of the pre-write fixed bit string.It is a configuration.
[0015]
  The invention according to claim 6 relating to the present invention isClaim 2LeaveThe fourth byte data of the second read fixed bit string is a value obtained by adding 01h to the fourth byte data of the pre-write fixed bit string.It is a configuration.
[0016]
DETAILED DESCRIPTION OF THE INVENTION
Hereinafter, the present invention will be described in detail based on illustrated embodiments.
FIG. 1 is a flowchart showing processing steps of a serial memory automatic discrimination method according to the present invention. The serial memory described here is assumed to conform to the SPI (Serial Peripheral Interface), but the input / output ports of the memory and the access timing are basically the same as those shown in FIG. Omitted. The flowchart in FIG. 1 describes a processing program executed by the CPU, and it is assumed that each port of the serial memory is accessed via a general-purpose port provided in the CPU.
[0017]
Hereinafter, the processing procedure of the flowchart shown in FIG. 1 will be described.
First, the overall flow of the flowchart of FIG. 1 will be described. In this processing procedure, a predetermined bit string for writing having a predetermined length, which will be described later, is specified together with a plurality of addresses in the pre-writing process 1 and written to an unknown serial memory. Then, when the written data is read by the first reading process 2 and 2 bytes of 2 addresses (assuming that 1 address = 1 byte) are determined by the first determination process 3, the unknown serial memory has 8 and 9 It is classified into bit type, 16-bit type and others.
[0018]
Further, for those which are determined to be neither 8-, 9-bit, nor 16-bit types, in the second determination reading process 4, another address different from the address specified in the first reading process 2 is specified. Data is read out. Of these, 2 bytes of data for 2 addresses are determined in the second determination processing 5 to determine whether the data is a 24-bit type or a defective product, and the processing flow ends.
[0019]
Therefore, before describing each processing step, the data structure and page writing (reading) of an SPI-compliant serial memory will be described. Generally, the concept of a page is used for an SPI-compliant serial memory. This will be explained using an 8-bit or 9-bit memory as an example.
FIGS. 2A and 2B show the data structure of a memory having an 8-bit address and a 9-bit address. In FIG. 2, for example, in the memory of 8-bit address (a), the address can be specified from 00h to FFh, and data of 256 bytes in total of D1 to D256 (each data is in units of 1 byte) can be stored. it can.
[0020]
Here, a group of several bytes of each data is called one page. Normally, one page generally has a page size that is a multiple of 4 such as 4, 8, 16, 32, and 256 bytes depending on the memory size, and therefore, it is described here as 4 bytes / page.
Therefore, if it is 4 bytes / page, an 8-bit address memory has a data structure of 64 pages.
[0021]
In addition, the 9-bit address memory shown in FIG. 2B can specify addresses 00h to 1FFh, can store 512 bytes of D1 to D512, and has a 128-page data structure.
Here, when data is written to the memory, a write command and an address are input from the DI (input) port in FIG. 14, and subsequently, write data is continuously input for 4 bytes. Then, the write data is continuously written in the same page one byte at a time starting from the address. For example, in the case of an 8-bit address memory, if the address is specified as 00h and then D1 to D4 are input as 4 bytes of data, each byte of D1 to D4 is successively written to addresses 00h to 03h. It is.
[0022]
However, continuous writing of data across the next page is prohibited.
For example, even if address 00h is specified and 5 bytes of D1 to D5 are subsequently specified, D1 to D4 are written to 00h to 03h, and then D5 is written to the next address 04h, but the process proceeds to the next page. I can't. Therefore, it returns to the top address 00h of the same page, and D1 written earlier is overwritten with D5.
[0023]
On the other hand, in the case of reading, an address is input together with a read command, and then dummy data for a necessary byte is input. Then, data is continuously read out byte by byte in synchronization with the inputted dummy data in the order of consecutive addresses from the address. In the case of reading, if dummy data is added, it is possible to read continuously regardless of the page. Here, the dummy data may be any data.
[0024]
Now, the pre-writing process 1 of FIG. 1 will be described in detail below.
First, FIG. 3A shows a fixed bit string for pre-writing including a write command input from the DI port.
The first command (1) is data that specifies writing, and is usually given as 1-byte data. For the upper 5 bits, each bit is set to 0, and the lower 3 bits are set to bits corresponding to writing. Yes. Further, a series of data (2) to (7) is input following the 1-byte write command (1).
Here, 00h is 1-byte all-zero data (hexadecimal display), and “T”, “P”, “R”, “D”, and “G” indicate a 1-byte code of each character. (Hereinafter, when the address, data, or character code is expressed in hexadecimal notation, for example, 1Fh is suffixed with h.)
Further, when inputting the pre-written fixed bit string, predetermined signals are given to the Cs port and the SK port shown in FIG. 14, but the description thereof will be omitted below for the sake of simplicity. .
[0025]
Now, when the pre-programmed fixed bit string including the write command shown in FIG. 3A is input to the 8-bit address memory, 1 byte (8 bits) of (2) following the command (1) is recognized as an address. Therefore, the following 5 bytes (3) to (7) are processed as write data.
However, for the reason described above, writing cannot be performed across the first and second pages. Accordingly, as shown in FIG. 3B, “T”, “P”, “R”, and “D” are sequentially written to the addresses 00h to 03h of the first page, and the data D1 at the address 00h is further changed from “T” to “G”. "G", "P", "R", and "D" are stored in the addresses 00h to 03h, respectively.
[0026]
On the other hand, when the pre-programmed fixed bit string is input to the 9-bit address memory, the 5th bit (set to 0 here) from the beginning of the command (1) is interpreted as the most significant address, and the subsequent 1 byte is the lower order. Since it is interpreted as an 8-bit address, “G”, “P”, “R”, and “D” are stored in the addresses from 000h to 003h as shown in FIG. The
[0027]
Further, FIG. 5A and FIG. 5B show the result of inputting the pre-programmed fixed bit string to the memory having the 16-bit address. In this case, data 00h “T” of 2 bytes (2) and (3) following the command (1) is decoded as an address, and 4 bytes of (4) to (7) are processed as write data. Here, since the 1-byte character code of “T” is 54h, the 16-bit address is recognized as 0054h. As a result, data “P”, “R”, “D”, and “G” are stored in the addresses 0054h to 0057h, respectively. Even if the memory has a 10-15 bit address, the memory reads address information for each byte and decodes only the necessary number of address bits, so that the write results are exactly the same.
[0028]
  6A and 6B show the result of inputting the pre-programmed fixed bit string to the memory having a 24-bit address. In this example, the write command (1) is followed by (2) to(4)Three bytes 00h, “T”, “P” are decoded as addresses, and three bytes (5) to (7) are processed as write data. Here, since the character codes of “T” and “P” are 54h and 50h, respectively, “R”, “D”, and “G” are written in the addresses 005450h to 005452h, respectively. Even if the target memory has an address of 17 to 23 bits, the memory reads address information for each byte and decodes only the necessary number of address bits, so that the write results are exactly the same. Become.
[0029]
The example of the pre-write process has been described above. However, in the example of the pre-write process in the 8-, 9-bit address memory, only the data written at the head address is different when the page unit exceeds 4 bytes. The results in this case are shown in FIGS.
Note that in the pre-writing described above, the write address is determined as 00h, “T” (= 54h), and “P” (= 50h) for the second to fourth bytes from the beginning of the pre-programmed fixed bit string. is doing. At this time, when the first and second read processing described later is executed, each byte for determining the address is written so that the data is sequentially written from the top of the page so as not to read the data across the pages. Each is set to be 0 or a multiple of 4.
The pre-writing process 1 has been described above.
[0030]
Next, the first reading process in FIG. 1 will be described. When reading data from the target serial memory, first, 5 bytes of the first read fixed bit string including the read command is input to the DI (input) port of the serial memory. Then, data is output from the Do (output) port of the target serial memory, but the output data differs depending on the type of the target serial memory. The mechanism will be described below. FIG. 8 illustrates the first read result when the target serial memory is assumed to be an 8- or 9-bit address type. 8A shows an example in which one page has 4 bytes, and FIG. 8B shows an example in which one page has 8 bytes or more.
[0031]
As shown in FIG. 8A, 4 bytes of serial data (2) to (5) are input following a 1 byte read command (1) from DI (input). Here, for (3) “U” (= 55h) of the first read fixed bit string, 01h is set to 54h with respect to (3) “T” (= 54h) of the above-described fixed bit string for pre-writing. Set to the added value.
Then, when the target serial memory has an 8-bit address, the 1-byte data 00h of (2) following the command (1) is recognized as an address, and 3 bytes of (3) to (5) are recognized as dummy data. Alternatively, when the target serial memory has a 9-bit address, the total 9 bits of the fifth bit (set to 0) and (2) of the command (1) are recognized as the address 000h, and (3) to (5) 3 Bytes are recognized as dummy data.
[0032]
Here, the dummy data is arbitrary data to be added in order to continuously read data following the address 00h (000h), and here corresponds to 3 bytes of (3) to (5), The data at addresses 00h to 02h (000h to 002h) shown in FIGS. 3 and 4 are continuously read, and “G”, “P”, and “R” are output from the Do port of the target serial memory. Note that the output of the Do port is indefinite and data is not determined until an address for the necessary bits is input.
On the other hand, as shown in FIG. 8B, when the target serial memory is an 8 and 9-bit address type and one page has 8 bytes or more, the addresses 00h to 02h (000h) shown in FIGS. ... 002h) is read, and “T”, “P”, and “R” are output from the Do port of the target serial memory.
[0033]
When the target memory is a 16-bit address type, as shown in FIG. 9A, 2 bytes of (2) and (3) following the command (1) are recognized as the address 0055h, and (4 ) (5) is recognized as dummy data. Accordingly, the data “R” and “D” at the addresses 0055h and 0056h illustrated in FIG. 5 are output from the Do port of the target serial memory. At this time, it should be noted that the read start address is incremented by one with respect to the prewrite start address.
[0034]
When the target memory is a 24-bit address type, as shown in FIG. 9B, 3 bytes of (2), (3), and (4) following the command (1) are recognized as an address 005500h ( 5) is recognized as dummy data.
Note that the address 005500h is different from the address (see FIG. 6) specified in the pre-write, so that it is not known what data is stored here, so-called data is “undefined” It has become.
Here, the data portion corresponding to (4) and (5) output at the third and fourth bytes after the command (1) is given is called first determination data, and is used for the next first determination processing. Use. The first read process 2 for each memory type has been described above.
[0035]
Next, the first determination process 3 in FIG. 1 will be described.
In this processing step, first determination data is extracted based on the data read in the first reading process 2 described above. As a result of the first reading process 2, the target serial memory type is classified into one of the tables shown in FIG. 10 according to the order of the first determination data.
When the first determination data is in the order of “P” and “R”, the target serial memory is determined to be an 8- or 9-bit address type. When the first determination data is in the order of “R” and “D”, the target serial memory is determined to be a 16-bit address type (10 to 16-bit address). If the first determination data is “indefinite” or “indefinite”, that is, other than the above grouping order, the target serial memory is determined as a 24-bit address type (17 to 24-bit address) or a defective product. Note that although 2 bytes are extracted as the first determination data, the processing speed may be improved by extracting 1 byte.
The first determination process 3 has been described above.
[0036]
Next, the second reading process 4 in FIG. 1 will be described.
As a result of the first determination process 3 described above, for a target determined to be a 24-bit address type (17 to 24-bit address) or a defective product, it is determined whether or not it is a defective product after this processing step. It has become.
Therefore, first, as shown in FIG. 11, the 6-byte second read fixed bit string (1) to (6) including the read command is input to the DI port of the target memory.
Here, 1 byte of (1) is a read command, and the following 3 bytes of (2) 00h, (3) “T”, (4) “Q” are recognized as address 005451h (5) (6 ) Is recognized as dummy data.
[0037]
However, (2) and (3) of the second read fixed bit string are set to be the same as 00h and “T” of (2) and (3) of the pre-write fixed bit string described above. 2 (4) of the regular bit string for reading is set to be 51h obtained by adding 01h to 50h, corresponding to (4) “P” (= 50h) of the regular bit string for pre-writing described above. is there.
Then, if the target memory is a 24-bit address type, “D” and “G” are output from the Do port in synchronization with the dummy data of (5) and (6). (See Figure 6)
If the target memory is a faulty product, “undefined” and “undefined” other than the “D” and “G” grouping order.
[0038]
Here, the data portion corresponding to (5) and (6) output at the 4th and 5th bytes after the command (1) is given is called second determination data, and is used for the next second determination processing. Use. Even if the target memory is an 8-, 9-bit address type or a 16-bit address type (10 to 16-bit address), the last two bytes output from the Do port must be “R” “D”. Note that there is no possibility of determining a 24-bit address type as an 8- or 9-bit type (see FIG. 12). The second read process result has been described above.
[0039]
Next, the second determination process in FIG. 1 will be described.
In this processing step, second determination data is extracted based on the data read in the second reading process described above. As a result of the second reading process, the target serial memory type is classified into one of the tables shown in FIG. 13 according to the second determination data set. When the second determination data is “D” or “G”, the target serial memory can be specified as a 24-bit address type (17 to 24-bit address).
When the second determination data is “indefinite” or “indefinite”, that is, other than the pair of “D” and “G”, it can be determined as a defective product. Here, although the second determination data is 2 bytes, this may be 1 byte to improve the processing speed.
[0040]
In the embodiment described above, it is assumed that the target serial memory assigns an address in units of 1 byte, but an address such as AT25F512 manufactured by Atmel is 16 bits, but the address is There is a rare type that must be given 3 bytes. In such a case, it is determined as a 24-bit type. The following description is supplemented for such an example.
[0041]
For example, a description will be given by taking as an example a type in which an address is 13 bits but an address for 3 bytes must be given. This type of memory recognizes (decodes) only the lower 13 bits of the given 3-byte address.
Therefore, when the data shown in FIG. 6 is written in advance writing, only the lower 13 bits of the designated head address 005450h are decoded (only addresses 000000h to 001FFFh can be specified in the address range). "R", "D", and "G" are written in addresses 001450h to 001452h.
[0042]
On the other hand, when the first reading process 2 is performed, data is read from 005500h. However, for the same reason as described above, the address is interpreted as 001500h, and data is read therefrom. Accordingly, at this time, the first determination data is “indefinite” and “indefinite”, and the target memory is determined as a 24-bit address type or a defective product.
[0043]
However, when the second reading process is subsequently performed, data is read from the addresses 005451h and 005452h. For the same reason, the addresses are interpreted as 001451h and 001452h, and data is read therefrom.
Therefore, the second determination data is “D” and “G”, and the target memory is determined to be a 24-bit type as shown in the determination table of FIG. Therefore, even if the effective address length is short, paying attention to the number of bytes to which the address is assigned, all current memories are 8-, 9-bit address type, 16-bit address type or 24-bit address. It can be classified into any of the types.
[0044]
In the above, all the process steps in FIG. 1 were demonstrated.
It should be noted that the bit string after the second byte excluding the command for the pre-programmed fixed bit string input to the DI port of the target serial memory is 00h, “T”, “P”, “R”, “D”, “G”. It is not limited and other combinations may be used. For example, after writing data in an arbitrary page in the pre-write process 1, each of the second to fourth bytes of the bit string is read so that the data in the same page is read when the first and second read processes are executed. The byte may be set to be any type of * 0h, * 4h, * 8h, and * Ch so as to be 0 or a multiple of 4. (However, * is 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, A, B, C, D, E, or F)
[0045]
At this time, the third byte of the first read fixed bit string (the first byte of (3) in FIG. 8A) is the third byte of the pre-written fixed bit string (corresponding to “T” = 54h). The code is set to a value obtained by adding 01h (corresponding to “U” = 55h in this embodiment), and the fourth byte of the second read fixed bit string (1 byte of (4) in FIG. 11) Is set so that 01h is added to the character code of the fourth byte (corresponding to “P” = 50h) of the pre-programmed fixed bit string (corresponding to “Q” = 51h in this embodiment). Any combination is possible.
That is, if it is set to be any type of * 1h, * 5h, * 9h, * Dh obtained by adding 01h to any of the above-mentioned * 0h, * 4h, * 8h, * Ch If the target serial memory has a page configuration that is a multiple of 4, data is not read across pages in the first and second read processing, and therefore, the same determination as in the above-described embodiment can be made.
[0046]
In addition, since the certainty of determination is higher when the extracted first determination data and second determination data have different character codes, each byte after the second byte of the pre-written fixed bit string is different from each other. It is better to set as follows.
[0047]
As described above, according to the simple processing steps shown in FIG. 1, an SPI-compliant serial memory can be easily classified into any of 8, 9-bit address type, 16-bit address type, and 24-bit address type. It is. In addition, since the target memory does not need to include a specific response bit in the data output of the Do port, the memory type can be determined without being affected by the indeterminate state of the port appearing in the Do port, and the Do port pull Up resistance can be eliminated.
[0048]
【The invention's effect】
A method for automatically recognizing a memory size of a serial memory according to any one of claims 1 to 4 according to the present invention, wherein a predetermined bit string for pre-writing is given to an unknown serial memory, pre-writing processing is performed, and the pre-writing processing is executed. Thereafter, a first reading process and a second reading process are performed, and first determination data and second determination data are extracted from the first and second read data, and the first determination data and the second determination data are extracted. Since the unknown memory type is determined based on the set order of the determination data, the invention according to claim 5 according to the present invention has the first determination data and the second determination data at least 1 byte, respectively. Even if the memory type does not have a response bit added to the read data, it can easily determine the memory type easily. Sosu remarkable effects to provide a method.
[Brief description of the drawings]
FIG. 1 is a processing flowchart of a memory type automatic discrimination method according to the present invention.
FIG. 2 is a data structure of an 8- or 9-bit address type.
FIG. 3 shows an example of a pre-write result of an 8-bit address type (4 bytes / page)
[Fig. 4] Example of 9-bit address type pre-write result
FIG. 5 shows an example of a 16-bit address type pre-write result.
FIG. 6 shows an example of a 24-bit address type pre-write result.
[Fig. 7] Pre-write result of 8- and 9-bit type address type (8 bytes / page)
FIG. 8 shows an example of a first read processing result of an 8-, 9-bit address type.
FIG. 9 shows an example of a first read processing result of a 16-bit address type or a 24-bit address type.
FIG. 10 is a combination example of first determination data.
FIG. 11 shows an example of a second read processing result of a 24-bit address type.
FIG. 12 shows an example of a second read processing result of an 8-, 9-bit address type or a 16-address type.
FIG. 13 is a combination example of first determination data and second determination data.
FIG. 14 is a block diagram of a serial memory and an access timing chart;
[Explanation of symbols]
1 ... Pre-writing process
2 ... First reading process
3. First determination process
4. Second reading process
5 ... Second determination process

Claims (6)

未知のシリアルメモリにアクセスし該シリアルメモリのアドレス長のタイプを自動的に判別する方法であって、
先頭の1バイト目に書き込みコマンドを含み2バイト目から4バイト目までの各1バイトのデータ(0または4の倍数)をそれぞれ異なるように設定した所定ビット長の事前書き込み用定型ビット列を該シリアルメモリに与え事前書き込み処理を行う処理ステップと、
先頭の1バイト目に読み出しコマンドを含み2バイト目のデータを前記事前書き込み用定型ビット列のものと同じ値にし3バイト目のデータは前記事前書き込み用定型ビット列のものとは異なる値に設定した所定ビット長の第1読み出し用定型ビット列を前記シリアルメモリに与え第1読み出し処理を行う処理ステップと、
前記第1読み出し処理で読み出したデータから第1判定データを抽出し、当該第1判定データの値によってアドレス長のタイプを判別する第1判定処理ステップと、
を備えたことを特徴とするシリアルメモリの自動判別方法。
A method of accessing an unknown serial memory and automatically determining the type of address length of the serial memory,
A serial bit string for pre-writing with a predetermined bit length in which each 1-byte data (0 or multiples of 4) from the 2nd byte to the 4th byte is set differently , including the write command in the first byte. Processing steps for giving pre-write processing to the memory;
The first byte contains a read command and the second byte data is set to the same value as that of the pre-write fixed bit string, and the third byte data is set to a value different from that of the pre-write fixed bit string. A processing step of supplying a first read fixed bit string having a predetermined bit length to the serial memory and performing a first read process;
A first determination processing step of extracting first determination data from the data read in the first read processing and determining an address length type based on a value of the first determination data ;
A method for automatically determining serial memory, comprising:
更に、先頭の1バイト目に読み出しコマンドを含み2バイト目と3バイト目のデータを前記事前書き込み用定型ビット列のものと同じ値にし4バイト目のデータは前記事前書き込み用定型ビット列のものとは異なる値に設定した所定ビット長の第2読み出し用定型ビット列を前記シリアルメモリに与え第2読み出し処理を行う処理ステップと、
前記第2読み出し処理で読み出したデータから第2判定データを抽出し、当該第2判定データの値によってアドレス長のタイプを判別する第2判定処理ステップと、
を備えたことを特徴とする請求項1記載のシリアルメモリの自動判別方法。
Further, the read command is included in the first byte, the data in the second byte and the third byte are set to the same values as those in the pre-write standard bit string, and the fourth byte data is in the pre-write standard bit string. A processing step of giving a second read fixed bit string having a predetermined bit length set to a value different from that to the serial memory and performing a second read process;
A second determination processing step of extracting second determination data from the data read in the second read processing and determining an address length type based on a value of the second determination data;
Automatic discrimination method of the serial memory according to claim 1, comprising the.
前記第1判定処理ステップにより、8又は9ビットアドレスタイプか、10〜16ビットアドレスタイプか、17〜24ビットアドレスタイプ(故障時を含む)の3種類の何れであるかを判定することを特徴とする請求項1記載のシリアルメモリの自動判別方法。In the first determination processing step, it is determined whether there are three types of 8 or 9 bit address type, 10 to 16 bit address type, or 17 to 24 bit address type (including failure time). The serial memory automatic determination method according to claim 1. 前記第2判定処理ステップにより、17〜24ビットアドレスタイプか、または、故障の何れであるかを判定することを特徴とする請求項2記載のシリアルメモリの自動判別方法。3. The serial memory automatic determination method according to claim 2, wherein the second determination processing step determines whether the address type is a 17 to 24 bit address type or a failure. 前記第1読み出し用定型ビット列の3バイト目のデータは、前記事前書き込み用定型ビット列の3バイト目のデータに対して01hを加算した値としたことを特徴とする請求項1に記載のシリアルメモリの自動判別方法。2. The serial number according to claim 1, wherein the third byte data of the first read fixed bit string is a value obtained by adding 01h to the third byte data of the pre-write fixed bit string. Automatic memory detection method. 前記第2読み出し用定型ビット列の4バイト目のデータは、前記事前書き込み用定型ビット列の4バイト目のデータに対して01hを加算した値としたことを特徴とする請求項2記載のシリアルメモリの自動判別方法。3. The serial memory according to claim 2, wherein the fourth byte data of the second read fixed bit string is a value obtained by adding 01h to the fourth byte data of the pre-write fixed bit string. Automatic determination method.
JP2002204724A 2002-07-12 2002-07-12 Automatic identification method of serial memory Expired - Fee Related JP3985614B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2002204724A JP3985614B2 (en) 2002-07-12 2002-07-12 Automatic identification method of serial memory

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2002204724A JP3985614B2 (en) 2002-07-12 2002-07-12 Automatic identification method of serial memory

Publications (2)

Publication Number Publication Date
JP2004046649A JP2004046649A (en) 2004-02-12
JP3985614B2 true JP3985614B2 (en) 2007-10-03

Family

ID=31710245

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2002204724A Expired - Fee Related JP3985614B2 (en) 2002-07-12 2002-07-12 Automatic identification method of serial memory

Country Status (1)

Country Link
JP (1) JP3985614B2 (en)

Families Citing this family (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP5251353B2 (en) * 2008-08-14 2013-07-31 富士通セミコンダクター株式会社 Information processing device
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
JP5794965B2 (en) * 2012-10-10 2015-10-14 三菱電機株式会社 Memory inspection apparatus, memory inspection method, and memory inspection program

Also Published As

Publication number Publication date
JP2004046649A (en) 2004-02-12

Similar Documents

Publication Publication Date Title
US5179686A (en) Method for automatically detecting the size of a memory by performing a memory warp operation
JP3985614B2 (en) Automatic identification method of serial memory
EP3057100A1 (en) Memory device and operating method of same
KR100764260B1 (en) Variable-instruction-length processing
JP4374416B2 (en) SPI memory access mode automatic discrimination method and discrimination device
US3993980A (en) System for hard wiring information into integrated circuit elements
JPS60105040A (en) Sentence retrieving system
JPH0435780B2 (en)
JP3333265B2 (en) Semiconductor integrated circuit
KR0141639B1 (en) Apparatus and method of selecting songs making use of lyrics
JP3186320B2 (en) Access control circuit for storage device
JPS6331827B2 (en)
KR900013708A (en) Delay buffer circuit
JPS6117480Y2 (en)
JPH08221247A (en) Data processor
CN114756487A (en) Model identification and controller design method of serial EEPROM
JPH0438026B2 (en)
SU717771A1 (en) Device for addressing buffer storage
KR930008036B1 (en) Method and circuit generating address for registering data in compact disk rom
KR890004855Y1 (en) Address expending circuits of direct memory access device
JP3722231B2 (en) Product with a set of strings encoded and stored compactly
JPH04367043A (en) Memory controller
JPS6222164A (en) Updating system for substitution information
JPS59188785A (en) Reference level setting system of comparator circuit
JPH09293014A (en) Method for recognizing memory storage capacity

Legal Events

Date Code Title Description
A621 Written request for application examination

Free format text: JAPANESE INTERMEDIATE CODE: A621

Effective date: 20050216

A977 Report on retrieval

Free format text: JAPANESE INTERMEDIATE CODE: A971007

Effective date: 20070227

A131 Notification of reasons for refusal

Free format text: JAPANESE INTERMEDIATE CODE: A131

Effective date: 20070327

RD04 Notification of resignation of power of attorney

Free format text: JAPANESE INTERMEDIATE CODE: A7424

Effective date: 20070402

A521 Written amendment

Free format text: JAPANESE INTERMEDIATE CODE: A523

Effective date: 20070522

RD03 Notification of appointment of power of attorney

Free format text: JAPANESE INTERMEDIATE CODE: A7423

Effective date: 20070522

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: 20070619

A61 First payment of annual fees (during grant procedure)

Free format text: JAPANESE INTERMEDIATE CODE: A61

Effective date: 20070702

R150 Certificate of patent or registration of utility model

Free format text: JAPANESE INTERMEDIATE CODE: R150

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

Free format text: PAYMENT UNTIL: 20100720

Year of fee payment: 3

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

Free format text: PAYMENT UNTIL: 20100720

Year of fee payment: 3

S111 Request for change of ownership or part of ownership

Free format text: JAPANESE INTERMEDIATE CODE: R313113

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

Free format text: PAYMENT UNTIL: 20100720

Year of fee payment: 3

R360 Written notification for declining of transfer of rights

Free format text: JAPANESE INTERMEDIATE CODE: R360

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

Free format text: PAYMENT UNTIL: 20100720

Year of fee payment: 3

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

Free format text: PAYMENT UNTIL: 20100720

Year of fee payment: 3

R370 Written measure of declining of transfer procedure

Free format text: JAPANESE INTERMEDIATE CODE: R370

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

Free format text: PAYMENT UNTIL: 20100720

Year of fee payment: 3

S111 Request for change of ownership or part of ownership

Free format text: JAPANESE INTERMEDIATE CODE: R313113

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

Free format text: PAYMENT UNTIL: 20100720

Year of fee payment: 3

R350 Written notification of registration of transfer

Free format text: JAPANESE INTERMEDIATE CODE: R350

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

Free format text: PAYMENT UNTIL: 20110720

Year of fee payment: 4

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

Free format text: PAYMENT UNTIL: 20110720

Year of fee payment: 4

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

Free format text: PAYMENT UNTIL: 20120720

Year of fee payment: 5

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

Free format text: PAYMENT UNTIL: 20120720

Year of fee payment: 5

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

Free format text: PAYMENT UNTIL: 20120720

Year of fee payment: 5

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

Free format text: PAYMENT UNTIL: 20130720

Year of fee payment: 6

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

Free format text: PAYMENT UNTIL: 20130720

Year of fee payment: 6

S531 Written request for registration of change of domicile

Free format text: JAPANESE INTERMEDIATE CODE: R313531

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

Free format text: PAYMENT UNTIL: 20130720

Year of fee payment: 6

R350 Written notification of registration of transfer

Free format text: JAPANESE INTERMEDIATE CODE: R350

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

LAPS Cancellation because of no payment of annual fees