JP2004118419A - Semiconductor device, microcomputer, electronic device, control method for semiconductor device - Google Patents
Semiconductor device, microcomputer, electronic device, control method for semiconductor device Download PDFInfo
- Publication number
- JP2004118419A JP2004118419A JP2002279134A JP2002279134A JP2004118419A JP 2004118419 A JP2004118419 A JP 2004118419A JP 2002279134 A JP2002279134 A JP 2002279134A JP 2002279134 A JP2002279134 A JP 2002279134A JP 2004118419 A JP2004118419 A JP 2004118419A
- Authority
- JP
- Japan
- Prior art keywords
- data
- status
- communication control
- output
- reception
- 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.)
- Withdrawn
Links
- 238000000034 method Methods 0.000 title claims abstract description 34
- 239000004065 semiconductor Substances 0.000 title description 6
- 238000004891 communication Methods 0.000 claims abstract description 58
- 238000012546 transfer Methods 0.000 claims description 25
- 238000001514 detection method Methods 0.000 claims description 6
- 230000007274 generation of a signal involved in cell-cell signaling Effects 0.000 description 12
- 238000012545 processing Methods 0.000 description 11
- 238000010586 diagram Methods 0.000 description 10
- 230000006870 function Effects 0.000 description 3
- 238000012544 monitoring process Methods 0.000 description 3
- 238000006243 chemical reaction Methods 0.000 description 2
- 230000004044 response Effects 0.000 description 2
- 239000002131 composite material Substances 0.000 description 1
- 230000003111 delayed effect Effects 0.000 description 1
- 238000013461 design Methods 0.000 description 1
- 238000012986 modification Methods 0.000 description 1
- 230000004048 modification Effects 0.000 description 1
- 238000010248 power generation Methods 0.000 description 1
Images
Landscapes
- Bus Control (AREA)
- Communication Control (AREA)
Abstract
Description
【0001】
【発明の属する技術分野】
本発明は、通信制御回路、通信制御装置、マイクロコンピュータ及び電子機器に関する。
【0002】
【背景技術】
通信制御装置は、HDLC手順にしたがって受信したデータについてビット誤り検出を行い、検出結果に基づき各バイト毎にステータスを生成する。そして受信データを処理する側(例えばCPU)ではこのステータスを見ることで、データが正しく転送されているかを判断することができる。
【0003】
ここにおいて受信データのフラグチェックシーケンスの最終データに対応して生成されるステータスが、受信データ全体が正しく転送されているかを判断可能なステータスである。
【0004】
ところが従来のハードウエア構成では、データの受信終了を知らせるデータ終了割り込み処理よりDMA転送が優先されるため、最終データの読み出し後にデータ終了割り込みが行われる事になり、最終データが読み出された後ではステータスの保証がなくなる為に最終データに対応したステータスを取り出すことが困難であった。
【0005】
【特許文献1】特開平01−73944号公報
【特許文献2】特許第2763009号公報
【特許文献3】特開平03−11848号公報
【0006】
【発明が解決しようとする課題】
このようなステータスの処理としては、従来下記の方法が提案されている。
【0007】
「特02520905」「特開平01−73944」では、データ受信時受信データと共に毎回ステータスをDMA転送する方法が提案されている。しかし毎回ステータスを読み出すため、毎回のDMA転送のバス占有時間が長くなり、かつDMA転送先のバッファの容量も大きくなるという問題点があった。
【0008】
「特02763009」ではフレーム終了を認識した場合、最終データ割り込み信号でDMA転送をマスクし、割込み処理を先に行い、ステータスを読み出す方法が提案されている。しかし、割込み処理においてステータスの読み出しを行う為に、他にプライオリティの高い割込みが存在した場合は処理がおくれ、受信データオーバーランが発生する可能性がある。フレームサイズが特定できない場合においては、ステータスだけでなく最終データの読み出しや、フラグシーケンスが後続フレームと兼用になっていないかを判断してのDMAコントローラの設定まで行う必要がある。さらに他の割り込みの発生が重なった場合を想定すると受信データオーバーランへの影響は大きいと考えられる。
【0009】
「特開平02−224542」「特開平03−11848」は、ともに通信制御部にDMA機能を内蔵したものである。前者は転送データ数+1を転送データ数設定レジスタに設定するもの、後者は転送データ数設定レジスタにセットできる最大数をセットしておくもので任意のデータ長に対応したものである。ともにステータスは最後に付加して転送する。ステータス転送の為のDMAのトリガは、前者は転送データ数設定レジスタの設定値が“1”になった時、後者は終了フラグを検出しての終了割込みの発生時であり、一連の連続したDMA動作でステータスまで読み出す。しかしながら、通信制御装置自身にDMAを持つ構成である事から、複数のチャネルを設けるとそのチャネル数分のバス使用権の調停が発生し、場合によってはこの負荷の為にバスサイクルに影響がでる可能性があるという問題がある。また、ステータスを退避するバッファが無い為に、受信データの転送後かつステータスの転送前に次のフレームのデータを受信した場合には、転送すべきステータスを消失してしまう事になるので、受信エラーの確率が高くなるという問題がある。
【0010】
本発明は以上のような問題点に鑑みてなされたものであり、その目的とするところは、HDLC手順のフレーム構成を有するデータを受信して、DMA方式で転送する通信制御回路において、ステータスを取り出し可能な通信制御回路、通信制御装置、マイクロコンピュータ及び電子機器の提供を目的とする。
【0011】
【課題を解決するための手段】
(1)本発明は、HDLC手順のフレーム構成を有するデータを受信して、DMA方式で転送する通信制御回路であって、
受信データを先入れ先出しで格納する受信データバッファと、
前記受信データを所定ビット毎にビット誤り検出を行い、ステータスを生成するステータス生成回路と、
受信データバッファと同じ段数を有し受信データバッファと同期して入出力が行われるよう制御され、ステータス生成回路からの出力を先入れ先出しで格納するステータスバッファと、
ステータスバッファからの1段分の出力を保持するステータス保持レジスタと、
最終データ読み出し終了後にセレクタ回路に向け切り替え制御信号を出力するとともに、セレクタ回路の出力をDMA方式で転送するためのDAMリクエスト信号を出力する制御回路と、
受信データバッファからの出力とステータスバッファからの出力を受け付け、前記切り替え制御信号に基づきいずれかのデータを選択して出力するセレクタ回路と、
を含むことを特徴とする。
【0012】
HDLC手順とはハイレベル・データリンク制御手順を意味する。なお受信データの転送データサイズは、固定長でも良いし可変長でもよい。
【0013】
最終データ読み出し終了の検出は、例えば通信制御回路のデータ受信終了処理の過程で発生する受信終了割り込みによって検出してもよいし、例えば受信データが固定長の場合には当該固定のデータ長と受信データのカウント値を比較することによって最終データ読み出し終了を検出するようにしてもよい。
【0014】
本発明によれば、受信データバッファとステータスバッファは段数が同じで、同期して入出力が行われるため、フレームの最終データが受信データバッファから出力されるときに、フレームの最終データに対応したステータスがステータスバッファからステータス保持レジスタに出力される。その後にステータス保持レジスタの値の出力がセレクタ回路によって選択されるとともにDMAリクエスト信号が出力され、ステータスの転送が行われる。
【0015】
このように本発明は、最終データの読み出し後に、最終データに対応したステータスをDMA転送することが出来るため、HDLC手順のフレーム構成を有するデータを受信して、DMA方式で転送する通信制御回路において、データの受信終了を知らせるデータ終了割り込み処理よりDMA転送が優先されるハードウエア構成でも、最終データに対応したステータスをとりだすことが可能になる。
【0016】
なお本発明は、フレームサイズが不明の場合でも適用可能である。
【0017】
また本発明によれば、バス占有率の増大やDMA転送領域の増大を招くこともなく、余分なプログラム制御も必要なく最終データに対応したステータスをとりだすことができる。
【0018】
(2)本発明の通信制御装置は、
前記制御回路は、
発生した受信終了割り込みを最終データの読み出し終了後にアサートする回路と、
受信データイネーブル割り込み及びアサートされた受信終了割り込みの少なくとも一方に基づきDAMリクエスト信号を生成するDAMリクエスト信号を生成回路とを含み、
最終データの読み出し終了前は、受信データイネーブル割り込みに基づきDAMリクエスト信号を生成し、最終データの読み出し終了後はアサートされた受信終了割り込みに基づきDAMリクエスト信号を生成することを特徴とする。
【0019】
(3)本発明の通信制御装置は、
前記制御回路は、
ステータス保持レジスタ転送の為のDMAリクエストの生成以降に終了割り込み信号を出力することを特徴とする。
【0020】
出力された割り込み信号は、例えば割り込みコントローラに入力される。
【0021】
(4)本発明の通信制御装置は、上記のいずれかの通信制御回路を含むことを特徴とする。
【0022】
(5)本発明のマイクロコンピュータは、上記いずれかの通信制御回路を含むことを特徴とする。
【0023】
(6)本発明の電子機器は、上記記載のマイクロコンピュータと、
前記マイクロコンピュータの処理対象となるデータの入力手段と、
前記マイクロコンピュータにより処理されたデータを出力するための出力手段とを含むことを特徴とする。
【0024】
【発明の実施の形態】
1.通信制御回路
以下、本発明の好適な実施形態について図面を用いて詳細に説明する。
【0025】
本実施の形態は、HDLC手順のフレーム構成を有するデータを受信して、DMA方式で転送する通信制御回路に関する。
【0026】
HDLC手順のフレームには、情報を伝送するときのフレームである情報(I)フレームと、データリンクの監視、制御のためのフレームである監視(S)フレームと、モード設定の要求、応答、以上の報告のためのフレームである非番号制(U)フレームがある。
【0027】
図1は、HDLC手順のフレーム構成(情報(I)フレーム)について説明するための図である。
【0028】
情報(I)フレーム10は、フラグシーケンス(F)11、アドレスフィールド(A)12、コントロールフィールド(C)13,情報データ部(I)14,フレームチェックシーケンス(FCS)15,フラグシーケンス16とを含む。
【0029】
フラグシーケンス(F)11は、フレームの開始を示すものであり、開始フラグ’7E’(16進)が格納されている。
【0030】
アドレスフィールド(A)12は、二次局(複合局)の識別コードであり、コマンドの場合には受信すべき局の識別コードが、レスポンスの場合には送信した局の識別コードが格納される。
【0031】
コントロールフィールド(C)13は,フレームの種類(情報フレーム(I)、監視(S)フレーム、非番号制(U)フレームのいずれであるか)を示すデータが格納される。
【0032】
情報データ部(I)14は,ユーザーデータがおかれる部分であり、ビット構成、ビット長の制限はないが送受信局間での合意は必要である。
【0033】
フレームチェックシーケンス(FCS)15は,誤り制御のためのフィールドであり、16ビットのシーケンスが格納される。
【0034】
フラグシーケンス(F)16は、フレームの終了を示すものであり、終了フラグ’7E’(16進)が格納されている。
【0035】
図2は本実施の形態の通信制御回路の構成について説明するための図である。
【0036】
本通信制御回路100は、HDLC手順のフレーム構成を有するシリアルデータ160を受信し、シリアル−パラレル変換部150で変換したパラレルデータ151を、DMA方式で転送する通信制御回路であり、受信データバッファ110と、ステータス生成回路140と、ステータスバッファ120と、ステータス保持レジスタ190と、制御回路180と、セレクタ回路130とを含む。
【0037】
受信データバッファ110は、パラレルデータ151を先入れ先出しで格納する。
【0038】
ステータス生成回路140は、前記パラレルデータ151を所定ビット毎にビット誤り検出を行い、ステータスを生成する。
【0039】
ステータス保持レジスタ190は、受信データバッファ110と同じ段数を有し受信データバッファ110と同期して入出力が行われるよう制御され、ステータス生成回路140からの出力を先入れ先出しで格納する。
【0040】
ステータス保持レジスタ190は、ステータスバッファ120からの1段分の出力を保持する。
【0041】
制御回路180は、受信終了割り込みアサート回路182,DMAリクエスト信号生成回路184,切り替え制御信号生成回路186,割り込み信号生成回路188とを含む。切り替え制御信号生成回路186は、最終データ読み出し終了後にセレクタ回路130に向け切り替え制御信号187を出力する。DMAリクエスト信号生成回路184は、セレクタ回路140の出力をDMA方式で転送するためのDAMリクエスト信号185を出力する。
【0042】
また受信終了割り込みアサート回路182が、発生した受信終了割り込みを最終データの読み出し終了後にアサートし、DMAリクエスト信号生成回路184が、受信データイネーブル割り込み及びアサートされた受信終了割り込みの少なくとも一方に基づきDAMリクエスト信号185を生成するDAMリクエスト信号を生成するようにし、最終データの読み出し終了前は、受信データイネーブル割り込みに基づきDAMリクエスト信号185を生成し、最終データの読み出し終了後はアサートされた受信終了割り込みに基づきDAMリクエスト信号185を生成する。
【0043】
また割り込み信号生成回路188は、ステータス保持レジスタ190の値の転送終了後に割り込み信号189を出力するようにしてもよい。出力された割り込み信号は、例えば割り込みコントローラにいく。
【0044】
セレクタ回路130は、受信データバッファ110からの出力とステータスバッファ120からの出力を受け付け、前記切り替え制御信号186に基づきいずれかのデータを選択してバス170に出力する。
【0045】
また受信データバッファ110は例えば1バイト毎に先入れ先出しで入出力可能なFIFOとして構成されている。
【0046】
ステータス生成回路140は、ビット誤り検出としてフレームチェックシーケンス(FCS)(図1の15参照)を用いてCRCチェックを行う。
【0047】
最終データ読み出し終了の検出は、例えば通信制御回路のデータ受信終了処理の過程で発生する受信終了割り込みによって検出してもよいし、例えば受信データが固定長の場合には当該固定のデータ長と受信データのカウント値を比較することによって最終データ読み出し終了を検出するようにしてもよい。
【0048】
本発明によれば、受信データバッファ110とステータスバッファ120は段数が同じで、同期して入出力が行われるため、フレームの最終データが受信データバッファ110から出力されるときに、フレームの最終データに対応したステータスがステータスバッファ120からステータス保持レジスタ190に出力される。その後にステータス保持レジスタ120の値の出力がセレクタ回路130によって選択されバスに出力されるとともにDMAリクエスト信号185が出力される。
【0049】
このように本発明は、最終データの読み出し後に、最終データに対応したステータスをDMA転送することが出来るため、HDLC手順のフレーム構成を有するデータを受信して、DMA方式で転送する通信制御回路において、データの受信終了を知らせるデータ終了割り込み処理よりDMA転送が優先されるハードウエア構成でも、最終データに対応したステータスをとりだすことが可能になる。
【0050】
なお本発明は、フレームサイズが不明の場合でも適用可能である。
【0051】
また本発明によれば、バス占有率の増大やDMA転送領域の増大を招くこともなく、余分なプログラム制御も必要なく最終データに対応したステータスをとりだすことができる。
【0052】
図3は、DMAリクエスト信号生成回路の構成の一例である。
【0053】
同図に示すように、DMAリクエスト生成回路184は、受信データイネーブル割り込み212と受信終了割り込み214を入力してDMAリクエスト信号184を出力する論理和回路として構成することが出来る。受信データイネーブル割り込み212は通信制御回路の中で例えばデータ受信処理の1つとして発生するものであり、受信終了割り込み214は通信制御回路の中で例えばデータ受信終了処理の1つとして発生するものを使用することが出来る。
【0054】
このようにすると、割り込み信号を使用するという簡易な構成でDMAリクエストを生成することができる。
【0055】
図4は通信制御回路における割り込み信号の働きと動作の関係について説明するための図である。
【0056】
本実形態の通信制御装置の受信動作においては、受信データイネーブル、受信データオーバーランエラー、受信終了割り込みの3種類の割り込みが発生する。受信データイネーブルは、データを受信したことを知らせる割り込みである。受信データオーバーランエラーは、データが上書きされたことを知らせる割り込みであり、これは受信バッファがフルになった状態でもデータの読み出しが行われない状態で次のデータを受信したときに発生するもので、この時の動作は失敗ということになる。受信終了割り込みは、受信の終了を知らせる割り込みである。
【0057】
ここで本通信制御回路では、前記受信データイネーブルをDMAコントローラへのリクエスト信号として使用し、受信データはDMAを使用して読み出される。この場合受信データの読み出しとともに、受信データイネーブルが一旦解除されるようなハードウエアを設計することが好ましい。
【0058】
すなわち図4のS1〜S8に示すようにデータを受信すると、受信データイネーブルが発生する。これをDMAリクエストとして、セレクタ回路により受信データバッファからの出力が選択されて、DMAにより受信データを転送する。
【0059】
そして最終データを受信したら(S9)、受信データイネーブル割り込みと受信終了割り込みが発生する(S10)。ここで受信終了割り込みは、最終受信データがDAMにより転送されるまでマスクされ、最終データ読み出し終了後にアサート状態となる。
【0060】
ここで制御回路は、最終データ読み出し終了後にセレクタ回路に向け切り替え制御信号を出力するとともに、セレクタ回路の出力をDMA方式で転送するためのDAMリクエスト信号を出力するため、セレクタ回路によりステータスバッファからの出力が選択されて、DMAによりステータスが転送される(S11)。
【0061】
図5は、本通信制御回路を含んだ半導体集積回路装置(IC)の一例である。
【0062】
半導体集積回路装置(IC)300は、通信制御回路310、割り込みコントローラ320、DMAコントローラ330、CPU350とを含み、これらは内部バス360を介して接続されている。 通信制御回路310は、HDLC手順のフレーム構成を有するデータ370を受信して、DMAリクエスト312をDMAコントローラ330に向け出力する。
【0063】
DMAコントローラ330によって読み出された受信データ316は、一旦メモリ340に格納されて、CPU350等によって使用されるようにしてもよい。
【0064】
また通信制御回路310が検出した受信終了割り込みを割り込みコントローラ320に向け出力し、割り込みコントローラが、CPU350に対し受信終了割り込み322を行う。
【0065】
なお図5では本通信制御回路が、CPU350、DMAコントローラ330、割り込みコントローラ320と共に1つのICチップに集積されている場合について説明したがこれに限られない。例えば通信制御回路が、CPU350、DMAコントローラ330、割り込みコントローラ320とは別個に通信制御装置用のチップに集積されている場合でもよい。
【0066】
図6は、本通信制御装置を含んだボードの一例である。
【0067】
ボード400は、通信制御装置410、割り込みコントローラ420、DMAコントローラ430、CPU450とを含み、これらは外部バス460を介して接続されている。このように通信制御装置410、割り込みコントローラ420、DMAコントローラ430、CPU450はそれぞれ別個に集積されたチップをボード上で接続する場合でもよい。
【0068】
2.マイクロコンピュータ
図7は、本実施の形態のマイクロコンピュータのハードウエアブロック図の一例である。
【0069】
本マイクロコンピュータ700は、CPU510、キャッシュメモリ520、メモリマネジメントユニット(MMU)730、LCDコントローラ530、リセット回路540、プログラマブルタイマ550、リアルタイムクロック(RTC)560、DMAコントローラF570、割り込みコントローラ580、通信制御回路590、バスコントローラ600、A/D変換器610、D/A変換器620、入力ポート630、出力ポート640、I/Oポート650、クロック発生装置560、プリスケーラ570及びそれらを接続する各種バス680等、各種ピン690等を含む。
【0070】
ここで通信制御回路590は、例えば図2又は図3で説明したような構成を有している。
【0071】
3.電子機器
図8に、本実施の形態の電子機器のブロック図の一例を示す。本電子機器800は、マイクロコンピュータ(またはASIC)810、入力部820、メモリ830、電源生成部840、LCD850、音出力部860を含む。
【0072】
ここで、入力部820は、種々のデータを入力するためのものである。マイクロコンピュータ810は、この入力部820により入力されたデータに基づいて種々の処理を行うことになる。メモリ830は、マイクロコンピュータ810などの作業領域となるものである。電源生成部840は、電子機器800で使用される各種電源を生成するためのものである。LCD850は、電子機器が表示する各種の画像(文字、アイコン、グラフィック等)を出力するためのものである。 音出力部860は、電子機器800が出力する各種の音(音声、ゲーム音等)を出力するためのものであり、その機能は、スピーカなどのハードウェアにより実現できる。
【0073】
ここでマイクロコンピュータ(またはASIC)810は、例えば図7で説明したような構成を有している。
【0074】
図9(A)に、電子機器の1つである携帯電話950の外観図の例を示す。この携帯電話950は、入力部として機能するダイヤルボタン952や、電話番号や名前やアイコンなどを表示するLCD954や、音出力部として機能し音声を出力するスピーカ956を備える。
【0075】
図9(B)に、電子機器の1つである携帯型ゲーム装置960の外観図の例を示す。この携帯型ゲーム装置960は、入力部として機能する操作ボタン962、十字キー964や、ゲーム画像を表示するLCD966や、音出力部として機能しゲーム音を出力するスピーカ968を備える。
【0076】
図9(C)に、電子機器の1つであるパーソナルコンピュータ970の外観図の例を示す。このパーソナルコンピュータ970は、入力部として機能するキーボード972や、文字、数字、グラフィックなどを表示するLCD974、音出力部976を備える。
【0077】
なお、本実施形態を利用できる電子機器としては、図9(A)、(B)、(C)に示すもの以外にも、携帯型情報端末、ページャー、電子卓上計算機、タッチパネルを備えた装置、プロジェクタ、ワードプロセッサ、ビューファインダ型又はモニタ直視型のビデオテープレコーダ、カーナビゲーション装置等のLCDを使用する種々の電子機器を考えることができる。
【0078】
なお、本発明は本実施形態に限定されず、本発明の要旨の範囲内で種々の変形実施が可能である。
【図面の簡単な説明】
【図1】HDLC手順のフレーム構成(情報(I)フレーム)について説明するための図である。
【図2】本実施の形態の通信制御回路の第1の実施例の構成について説明するための図である。
【図3】DMAリクエスト信号生成回路の構成の一例である。
【図4】通信制御回路における割り込み信号の働きと動作の関係について説明するための図である。
【図5】本通信制御回路を含んだ半導体集積回路装置(IC)の一例である。
【図6】本通信制御装置を含んだボードの一例である。
【図7】本実施の形態のマイクロコンピュータのハードウエアブロック図の一例である。
【図8】マイクロコンピュータを含む電子機器のブロック図の一例を示す。
【図9】図9(A)(B)(C)は、種々の電子機器の外観図の例である。
【符号の説明】
100 通信制御回路、 110 受信データバッファ、 120 ステータスバッファ、 130 セレクタ回路、 140 ステータス生成回路、 150シリアル−パラレル変換部、 151 パラレルデータ、 160 受信データ、 170 データバス、 180 制御回路、 182 受信終了割り込みアサート回路、 184 DMAリクエスト信号生成回路、 185 DMAリクエスト信号、 186 切り替え制御信号生成回路、 187 切り替え制御信号、 188 割り込み信号生成回路、 189 割り込み信号、 190 ステータス保持レジスタ、 210 論理和回路、 212 受信データイネーブル割り込み、 214 受信終了割り込み、 300 半導体集積回路装置、310 通信制御回路、 320 割り込みコントローラ、 330 DMAコントローラ、 340 メモリ、 350 CPU、 510 CPU、
520 キャッシュメモリ、 530 LCDコントローラ、 540 リセット回路、 550 プログラマブルタイマ、 560 リアルタイムクロック(RTC)、 570 DMAコントローラ、 580 割り込みコントローラ、590 通信制御回路、 600 バスコントローラ、 610 A/D変換器、 620 D/A変換器、 630 入力ポート、 640 出力ポート、650 I/Oポート、 660 クロック発生装置(PLL)、 670 プリスケーラ、 680 各種バス、 690 各種ピン、 700 マイクロコンピュータ、 710 ROM、 720 RAM、 730 MMU、
800 電子機器[0001]
TECHNICAL FIELD OF THE INVENTION
The present invention relates to a communication control circuit, a communication control device, a microcomputer, and an electronic device.
[0002]
[Background Art]
The communication control device performs bit error detection on the received data in accordance with the HDLC procedure, and generates a status for each byte based on the detection result. The side that processes the received data (for example, the CPU) can determine whether the data is correctly transferred by checking this status.
[0003]
Here, the status generated corresponding to the final data of the flag check sequence of the received data is a status that can determine whether the entire received data is correctly transferred.
[0004]
However, in the conventional hardware configuration, since the DMA transfer is given priority over the data end interrupt processing for notifying the end of data reception, a data end interrupt is performed after reading the last data. In such a case, it is difficult to retrieve the status corresponding to the final data because the status is not guaranteed.
[0005]
[Patent Document 1] Japanese Patent Application Laid-Open No. 01-73944 [Patent Document 2] Japanese Patent No. 2766309 [Patent Document 3] Japanese Patent Application Laid-Open No. 03-11848 [0006]
[Problems to be solved by the invention]
As the processing of such status, the following method has been conventionally proposed.
[0007]
Japanese Patent Application Publication No. 0520905 and Japanese Patent Application Laid-Open No. 01-73944 propose a method of DMA-transmitting the status together with the received data at the time of data reception. However, since the status is read every time, there is a problem that the bus occupation time of the DMA transfer every time becomes long and the capacity of the buffer of the DMA transfer destination also becomes large.
[0008]
Japanese Patent Application Publication No. 02763009 proposes a method in which when the end of a frame is recognized, DMA transfer is masked by a final data interrupt signal, interrupt processing is performed first, and status is read. However, in order to read the status in the interrupt processing, if there is another interrupt with a higher priority, the processing is delayed, and there is a possibility that the received data overrun occurs. If the frame size cannot be specified, it is necessary to read not only the status but also the final data, and to set the DMA controller by judging whether the flag sequence is shared with the subsequent frame. If it is assumed that other interrupts occur at the same time, it is considered that the influence on the received data overrun is great.
[0009]
Both JP-A-02-224542 and JP-A-03-11848 incorporate a DMA function in a communication control unit. The former sets the transfer data number + 1 in the transfer data number setting register, and the latter sets the maximum number that can be set in the transfer data number setting register, corresponding to an arbitrary data length. In both cases, the status is added at the end and transferred. The DMA trigger for the status transfer is the former when the set value of the transfer data number setting register becomes “1”, and the latter when the end interrupt is generated by detecting the end flag. The status is read out by the DMA operation. However, since the communication control device itself has a DMA, if a plurality of channels are provided, arbitration of the right to use the bus for the number of channels occurs, and in some cases, this load affects the bus cycle. There is a problem that there is a possibility. Also, since there is no buffer to save the status, if the data of the next frame is received after the transfer of the received data and before the transfer of the status, the status to be transferred will be lost. There is a problem that the probability of an error increases.
[0010]
The present invention has been made in view of the above problems, and an object of the present invention is to provide a communication control circuit that receives data having a frame configuration of an HDLC procedure and transfers the data in a DMA system. An object of the present invention is to provide a communication control circuit, a communication control device, a microcomputer, and an electronic device that can be taken out.
[0011]
[Means for Solving the Problems]
(1) The present invention is a communication control circuit that receives data having a frame configuration of an HDLC procedure and transfers the data by a DMA method.
A reception data buffer for storing reception data on a first-in first-out basis;
A status generation circuit that performs a bit error detection on the received data for each predetermined bit and generates a status;
A status buffer that has the same number of stages as the reception data buffer and is controlled so that input / output is performed in synchronization with the reception data buffer, and stores the output from the status generation circuit on a first-in first-out basis;
A status holding register for holding one stage of output from the status buffer;
A control circuit that outputs a switching control signal to the selector circuit after the end of the final data read, and that outputs a DAM request signal for transferring the output of the selector circuit by the DMA method;
A selector circuit that receives an output from the reception data buffer and an output from the status buffer, and selects and outputs any data based on the switching control signal;
It is characterized by including.
[0012]
The HDLC procedure means a high level data link control procedure. The transfer data size of the received data may be a fixed length or a variable length.
[0013]
The end of the final data reading may be detected by, for example, a reception end interrupt generated in the process of the data reception end processing of the communication control circuit, or, for example, when the reception data has a fixed length, the fixed data length and the reception The end of the final data reading may be detected by comparing the data count values.
[0014]
According to the present invention, the reception data buffer and the status buffer have the same number of stages, and input and output are performed synchronously. Therefore, when the final data of the frame is output from the reception data buffer, the reception data buffer and the status buffer correspond to the final data of the frame. The status is output from the status buffer to the status holding register. Thereafter, the output of the value of the status holding register is selected by the selector circuit, the DMA request signal is output, and the status is transferred.
[0015]
As described above, according to the present invention, since the status corresponding to the final data can be DMA-transferred after the reading of the final data, the communication control circuit which receives the data having the frame structure of the HDLC procedure and transfers the data by the DMA method is used. Even in a hardware configuration in which DMA transfer is prioritized over data end interrupt processing for notifying the end of data reception, a status corresponding to final data can be obtained.
[0016]
The present invention is applicable even when the frame size is unknown.
[0017]
Further, according to the present invention, the status corresponding to the final data can be obtained without increasing the bus occupancy or the DMA transfer area, and without requiring extra program control.
[0018]
(2) The communication control device of the present invention
The control circuit includes:
A circuit for asserting the generated reception end interrupt after reading the last data,
A DAM request signal for generating a DAM request signal based on at least one of a reception data enable interrupt and an asserted reception end interrupt, and
Before the end of the reading of the final data, a DAM request signal is generated based on the reception data enable interrupt, and after the end of the reading of the final data, the DAM request signal is generated based on the asserted reception end interrupt.
[0019]
(3) The communication control device of the present invention
The control circuit includes:
A termination interrupt signal is output after a DMA request for status register transfer is generated.
[0020]
The output interrupt signal is input to, for example, an interrupt controller.
[0021]
(4) A communication control device according to the present invention includes any one of the communication control circuits described above.
[0022]
(5) A microcomputer according to the present invention includes any one of the communication control circuits described above.
[0023]
(6) The electronic device of the present invention includes the microcomputer described above,
Input means for data to be processed by the microcomputer,
Output means for outputting data processed by the microcomputer.
[0024]
BEST MODE FOR CARRYING OUT THE INVENTION
1. Communication Control Circuit Hereinafter, a preferred embodiment of the present invention will be described in detail with reference to the drawings.
[0025]
The present embodiment relates to a communication control circuit that receives data having a frame configuration of the HDLC procedure and transfers the data using a DMA method.
[0026]
The frames of the HDLC procedure include an information (I) frame that is a frame for transmitting information, a monitoring (S) frame that is a frame for monitoring and controlling a data link, and a request and a response for mode setting. There is an unnumbered (U) frame, which is a frame for reporting the number.
[0027]
FIG. 1 is a diagram for describing a frame configuration (information (I) frame) of the HDLC procedure.
[0028]
The information (I)
[0029]
The flag sequence (F) 11 indicates the start of a frame, and stores a start flag '7E' (hexadecimal).
[0030]
The address field (A) 12 is an identification code of the secondary station (composite station). In the case of a command, the identification code of the station to be received is stored. In the case of a response, the identification code of the transmitting station is stored. .
[0031]
The control field (C) 13 stores data indicating the type of frame (whether the frame is an information frame (I), a monitoring (S) frame, or an unnumbered (U) frame).
[0032]
The information data section (I) 14 is a section where user data is placed, and there is no limitation on the bit configuration and bit length, but agreement between the transmitting and receiving stations is required.
[0033]
The frame check sequence (FCS) 15 is a field for error control, and stores a 16-bit sequence.
[0034]
The flag sequence (F) 16 indicates the end of the frame, and stores an end flag '7E' (hexadecimal).
[0035]
FIG. 2 is a diagram for describing the configuration of the communication control circuit according to the present embodiment.
[0036]
The communication control circuit 100 is a communication control circuit that receives the serial data 160 having the frame configuration of the HDLC procedure and transfers the parallel data 151 converted by the serial-
[0037]
The
[0038]
The
[0039]
The
[0040]
The
[0041]
The
[0042]
Further, the reception end interrupt asserting
[0043]
Further, the interrupt
[0044]
The
[0045]
Further, the
[0046]
The
[0047]
The end of the final data reading may be detected by, for example, a reception end interrupt generated in the process of the data reception end processing of the communication control circuit, or, for example, when the reception data has a fixed length, the fixed data length and the reception The end of the final data reading may be detected by comparing the data count values.
[0048]
According to the present invention, since the
[0049]
As described above, according to the present invention, since the status corresponding to the final data can be DMA-transferred after the reading of the final data, the communication control circuit which receives the data having the frame structure of the HDLC procedure and transfers the data by the DMA method is used. Even in a hardware configuration in which DMA transfer is prioritized over data end interrupt processing for notifying the end of data reception, a status corresponding to final data can be obtained.
[0050]
The present invention is applicable even when the frame size is unknown.
[0051]
Further, according to the present invention, the status corresponding to the final data can be obtained without increasing the bus occupancy or the DMA transfer area, and without requiring extra program control.
[0052]
FIG. 3 is an example of the configuration of the DMA request signal generation circuit.
[0053]
As shown in the figure, the DMA
[0054]
This makes it possible to generate a DMA request with a simple configuration using an interrupt signal.
[0055]
FIG. 4 is a diagram for explaining the relationship between the function and operation of the interrupt signal in the communication control circuit.
[0056]
In the reception operation of the communication control device according to the present embodiment, three types of interrupts, that is, a reception data enable, a reception data overrun error, and a reception end interrupt occur. The reception data enable is an interrupt notifying that data has been received. A receive data overrun error is an interrupt that indicates that data has been overwritten, and occurs when the next data is received without reading data even when the receive buffer is full. At this time, the operation fails. The reception end interrupt is an interrupt notifying the end of reception.
[0057]
In this communication control circuit, the received data enable is used as a request signal to the DMA controller, and the received data is read out using the DMA. In this case, it is preferable to design the hardware such that the reception data enable is temporarily released together with the reading of the reception data.
[0058]
That is, when data is received as shown in S1 to S8 of FIG. 4, a reception data enable occurs. With this as a DMA request, the output from the reception data buffer is selected by the selector circuit, and the reception data is transferred by DMA.
[0059]
When the last data is received (S9), a reception data enable interrupt and a reception end interrupt are generated (S10). Here, the reception end interrupt is masked until the last received data is transferred by the DAM, and becomes an asserted state after the end of reading the last data.
[0060]
Here, the control circuit outputs the switching control signal to the selector circuit after the end of the final data reading and outputs the DAM request signal for transferring the output of the selector circuit by the DMA method. The output is selected, and the status is transferred by the DMA (S11).
[0061]
FIG. 5 is an example of a semiconductor integrated circuit device (IC) including the present communication control circuit.
[0062]
The semiconductor integrated circuit device (IC) 300 includes a
[0063]
The received data 316 read by the
[0064]
The reception end interrupt detected by the
[0065]
Although FIG. 5 illustrates the case where the communication control circuit is integrated on a single IC chip together with the
[0066]
FIG. 6 is an example of a board including the communication control device.
[0067]
The board 400 includes a communication control device 410, an interrupt
[0068]
2. FIG. 7 is an example of a hardware block diagram of the microcomputer according to the present embodiment.
[0069]
The microcomputer 700 includes a
[0070]
Here, the
[0071]
3. Electronic Device FIG. 8 shows an example of a block diagram of an electronic device of the present embodiment. The electronic device 800 includes a microcomputer (or ASIC) 810, an
[0072]
Here, the
[0073]
Here, the microcomputer (or ASIC) 810 has, for example, the configuration described with reference to FIG.
[0074]
FIG. 9A illustrates an example of an external view of a
[0075]
FIG. 9B illustrates an example of an external view of a
[0076]
FIG. 9C illustrates an example of an external view of a
[0077]
Note that, as electronic devices that can use the present embodiment, in addition to those shown in FIGS. 9A, 9B, and 9C, devices including a portable information terminal, a pager, an electronic desk calculator, and a touch panel, Various electronic devices using an LCD, such as a projector, a word processor, a viewfinder type or a monitor direct-view type video tape recorder, and a car navigation device can be considered.
[0078]
The present invention is not limited to the present embodiment, and various modifications can be made within the scope of the present invention.
[Brief description of the drawings]
FIG. 1 is a diagram for describing a frame configuration (information (I) frame) of an HDLC procedure.
FIG. 2 is a diagram for describing a configuration of a first example of the communication control circuit according to the present embodiment;
FIG. 3 is an example of a configuration of a DMA request signal generation circuit.
FIG. 4 is a diagram for explaining the relationship between the function and operation of an interrupt signal in a communication control circuit.
FIG. 5 is an example of a semiconductor integrated circuit device (IC) including the communication control circuit.
FIG. 6 is an example of a board including the communication control device.
FIG. 7 is an example of a hardware block diagram of a microcomputer of the present embodiment.
FIG. 8 illustrates an example of a block diagram of an electronic device including a microcomputer.
FIGS. 9A, 9B, and 9C are examples of external views of various electronic devices.
[Explanation of symbols]
Reference Signs List 100 communication control circuit, 110 reception data buffer, 120 status buffer, 130 selector circuit, 140 status generation circuit, 150 serial-parallel conversion unit, 151 parallel data, 160 reception data, 170 data bus, 180 control circuit, 182 reception end interrupt Assert circuit, 184 DMA request signal generation circuit, 185 DMA request signal, 186 switching control signal generation circuit, 187 switching control signal, 188 interrupt signal generation circuit, 189 interrupt signal, 190 status holding register, 210 OR circuit, 212 received data Enable interrupt, 214 reception end interrupt, 300 semiconductor integrated circuit device, 310 communication control circuit, 320 interrupt controller, 330
520 cache memory, 530 LCD controller, 540 reset circuit, 550 programmable timer, 560 real-time clock (RTC), 570 DMA controller, 580 interrupt controller, 590 communication control circuit, 600 bus controller, 610 A / D converter, 620 D / A converter, 630 input port, 640 output port, 650 I / O port, 660 clock generator (PLL), 670 prescaler, 680 various buses, 690 various pins, 700 microcomputer, 710 ROM, 720 RAM, 730 MMU,
800 Electronic equipment
Claims (6)
受信データを先入れ先出しで格納する受信データバッファと、
前記受信データを所定ビット毎にビット誤り検出を行い、ステータスを生成するステータス生成回路と、
受信データバッファと同じ段数を有し受信データバッファと同期して入出力が行われるよう制御され、ステータス生成回路からの出力を先入れ先出しで格納するステータスバッファと、
ステータスバッファからの1段分の出力を保持するステータス保持レジスタと、
最終データ読み出し終了後にセレクタ回路に向け切り替え制御信号を出力するとともに、セレクタ回路の出力をDMA方式で転送するためのDAMリクエスト信号を出力する制御回路と、
受信データバッファからの出力とステータスバッファからの出力を受け付け、前記切り替え制御信号に基づきいずれかのデータを選択して出力するセレクタ回路と、
含むことを特徴とする通信制御回路。A communication control circuit for receiving data having a frame configuration of an HDLC procedure and transferring the data by a DMA method,
A reception data buffer for storing reception data on a first-in first-out basis;
A status generation circuit that performs a bit error detection on the received data for each predetermined bit, and generates a status.
A status buffer that has the same number of stages as the reception data buffer and is controlled so that input / output is performed in synchronization with the reception data buffer, and stores the output from the status generation circuit on a first-in first-out basis;
A status holding register for holding one stage of output from the status buffer;
A control circuit that outputs a switching control signal to the selector circuit after the end of the final data read, and outputs a DAM request signal for transferring the output of the selector circuit by the DMA method;
A selector circuit that receives an output from the reception data buffer and an output from the status buffer, and selects and outputs any data based on the switching control signal;
A communication control circuit characterized by including:
前記制御回路は、
発生した受信終了割り込みを最終データの読み出し終了後にアサートする回路と、
受信データイネーブル割り込み及びアサートされた受信終了割り込みの少なくとも一方に基づきDAMリクエスト信号を生成するDAMリクエスト信号を生成回路とを含み、
最終データの読み出し終了前は、受信データイネーブル割り込みに基づきDAMリクエスト信号を生成し、最終データの読み出し終了後はアサートされた受信終了割り込みに基づきDAMリクエスト信号を生成することを特徴とする通信制御装置。In claim 1,
The control circuit includes:
A circuit for asserting the generated reception end interrupt after reading the last data,
A DAM request signal for generating a DAM request signal based on at least one of a reception data enable interrupt and an asserted reception end interrupt, and
A communication control device for generating a DAM request signal based on a reception data enable interrupt before the end of the reading of the final data, and generating a DAM request signal based on the asserted reception end interrupt after the completion of the reading of the final data .
前記制御回路は、
ステータス保持レジスタの値の転送終了後に割り込み信号を出力することを特徴とする通信制御装置。In any one of claims 1 and 2,
The control circuit includes:
A communication control device for outputting an interrupt signal after completion of transfer of a value of a status holding register.
前記マイクロコンピュータの処理対象となるデータの入力手段と、
前記マイクロコンピュータにより処理されたデータを出力するための出力手段とを含むことを特徴とする電子機器。A microcomputer according to claim 5,
Input means for data to be processed by the microcomputer,
Output means for outputting data processed by the microcomputer.
Priority Applications (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| JP2002279134A JP2004118419A (en) | 2002-09-25 | 2002-09-25 | Semiconductor device, microcomputer, electronic device, control method for semiconductor device |
Applications Claiming Priority (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| JP2002279134A JP2004118419A (en) | 2002-09-25 | 2002-09-25 | Semiconductor device, microcomputer, electronic device, control method for semiconductor device |
Publications (1)
| Publication Number | Publication Date |
|---|---|
| JP2004118419A true JP2004118419A (en) | 2004-04-15 |
Family
ID=32274228
Family Applications (1)
| Application Number | Title | Priority Date | Filing Date |
|---|---|---|---|
| JP2002279134A Withdrawn JP2004118419A (en) | 2002-09-25 | 2002-09-25 | Semiconductor device, microcomputer, electronic device, control method for semiconductor device |
Country Status (1)
| Country | Link |
|---|---|
| JP (1) | JP2004118419A (en) |
Cited By (2)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| JP2009048298A (en) * | 2007-08-15 | 2009-03-05 | Sony Corp | Information processor, information processing method, program for implementing this information processing method, medium for recording this program, dma controller, dma transfer method, program for implementing this dma transfer method, and medium for recording this program |
| EP4095698A4 (en) * | 2020-01-20 | 2023-03-15 | Fujitsu Limited | Processor, simulator program, assembler program, and information processing program |
-
2002
- 2002-09-25 JP JP2002279134A patent/JP2004118419A/en not_active Withdrawn
Cited By (3)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| JP2009048298A (en) * | 2007-08-15 | 2009-03-05 | Sony Corp | Information processor, information processing method, program for implementing this information processing method, medium for recording this program, dma controller, dma transfer method, program for implementing this dma transfer method, and medium for recording this program |
| US8151015B2 (en) | 2007-08-15 | 2012-04-03 | Sony Corporation | Systems and methods for effecting DMA data transfers |
| EP4095698A4 (en) * | 2020-01-20 | 2023-03-15 | Fujitsu Limited | Processor, simulator program, assembler program, and information processing program |
Similar Documents
| Publication | Publication Date | Title |
|---|---|---|
| JP2678283B2 (en) | Data communication controller | |
| JP5500741B2 (en) | Interrupt approval in data processing systems | |
| TW561399B (en) | Math coprocessor | |
| US6816750B1 (en) | System-on-a-chip | |
| US6931470B2 (en) | Dual access serial peripheral interface | |
| JPH0887462A (en) | State machine and communication control method | |
| WO2001096992A1 (en) | Clock generator circuitry | |
| CN115086248B (en) | Data packet processing method, communication chip and computer equipment | |
| US20060206763A1 (en) | Debugging system, semiconductor integrated circuit device, microcomputer, and electronic apparatus | |
| US7093039B2 (en) | Communication terminal increasing effective data rate on asynchronous transmission and a data transmission method therefor | |
| JP2004118419A (en) | Semiconductor device, microcomputer, electronic device, control method for semiconductor device | |
| JP2003085127A (en) | Semiconductor device having dual bus, dual bus system, memory sharing dual bus system, and electronic equipment using same | |
| JP2004129129A (en) | Communication control circuit, communication control device, microcomputer and electronic device | |
| JP2004104418A (en) | Semiconductor device, microcomputer, electronic device, control method for semiconductor device | |
| JP4284501B2 (en) | Image data reduction device, microcomputer and electronic device | |
| JP2006050503A (en) | Integrated circuit device, communication control device, microcomputer and electronic device | |
| JP4291368B2 (en) | Memory bus check procedure | |
| JP3606124B2 (en) | Semiconductor integrated circuit device and electronic device | |
| US20040215867A1 (en) | Control chip, circuit and method thereof for inhibiting bus cycle | |
| JP2004129130A (en) | Communication control circuit, communication control device, microcomputer and electronic device | |
| US7363465B2 (en) | Semiconductor device, microcomputer, and electronic equipment | |
| US20080288692A1 (en) | Semiconductor integrated circuit device and microcomputer | |
| JP2004199115A (en) | Semiconductor integrated circuit | |
| JP2004061612A (en) | Semiconductor integrated circuit device, microcomputer and electronic equipment | |
| JP2002064584A (en) | HDLC transmitting / receiving device, HDLC receiving device, and HDLC transmitting device |
Legal Events
| Date | Code | Title | Description |
|---|---|---|---|
| A300 | Application deemed to be withdrawn because no request for examination was validly filed |
Free format text: JAPANESE INTERMEDIATE CODE: A300 Effective date: 20060110 |