JP2004090232A - Recorder and its control method - Google Patents
Recorder and its control method Download PDFInfo
- Publication number
- JP2004090232A JP2004090232A JP2002250763A JP2002250763A JP2004090232A JP 2004090232 A JP2004090232 A JP 2004090232A JP 2002250763 A JP2002250763 A JP 2002250763A JP 2002250763 A JP2002250763 A JP 2002250763A JP 2004090232 A JP2004090232 A JP 2004090232A
- Authority
- JP
- Japan
- Prior art keywords
- program
- storage
- stored
- data
- storage unit
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Pending
Links
Images
Landscapes
- Record Information Processing For Printing (AREA)
- Stored Programmes (AREA)
Abstract
Description
【0001】
【発明の属する技術分野】
本発明は、例えば記録装置のような電子機器において、制御するためのデータをダウンロードすることにより更新可能とする電子機器と、そのダウンロードするデータの構造と、格納方法に関する。
【0002】
【背景の技術】
従来の記録装置など電子機器は書き換え不能なマスクROM内にプログラムを格納し、そのプログラムを実行することにより記録装置を動作させていた。このような構成では記録装置単体でのプログラムの更新は不可能で、搭載されているマスクROMを交換することで、プログラムの更新を行っていた。
【0003】
また、最近の記録装置ではこの記録装置を動作させるプログラムを書き換え可能な不揮発性の素子に格納し、書き換え可能な不揮発性の素子(メモリ素子)からプログラムを実行している。このような記録装置では予め決められたメモリサイズ単位やブロック単位で書き換えが出来る素子が存在している。
【0004】
【発明が解決しようとしている課題】
しかしながら、マスクROMの変更のためには、マスクROMを作成するための時間、コストを要する。また、書き換え可能な不揮発性メモリ素子を使用する場合にも、プログラムすべてを格納できるメモリ容量を確保するためには、製品コストが上昇する。
【0005】
さらに、この書き換え可能な不揮発性メモリに格納されたプログラムを実行する場合、不揮発性メモリへのアクセスの遅延もある。
【0006】
本発明は上記課題に鑑みてなされたものであり、その目的は、従来よりも性能を劣化させることなく、安価で、容易にプログラムの更新が可能な電子機器、記録装置を提供することである。
【0007】
【課題を解決するための手段】
上記課題を解決するために、本発明の記録装置は、記録ヘッドを用いた記録動作の制御を行う制御手段と、制御手段が実行するプログラムを予め格納された書き換え不能な記憶手段と、プログラムのアドレステーブルを格納する第2記憶手段と、プログラムの代わりに実行する修正プログラムを格納する第3記憶手段とを備えた記録装置であって、修正プログラムとアドレステーブル変換プログラムとを格納する第4記憶手段と、アドレステーブル変換プログラムを実行させることでアドレステーブルを変更するテーブル変換手段と、記録装置の起動時に、テーブル変換手段の実行と、第4記憶手段に格納された修正プログラムを第3記憶手段への格納を行った後、制御手段は修正プログラムを実行する。
【0008】
また、本発明の記録装置の制御方法は、記録ヘッドを用いた記録動作の制御を行う制御手段と、前記制御手段が実行するプログラムを予め格納された書き換え不能な記憶手段と、前記プログラムのアドレステーブルを格納する第2記憶手段と、前記プログラムの代わりに実行する修正プログラムを格納する第3記憶手段と、前記修正プログラムと前記アドレステーブル変換プログラムとを格納する第4記憶手段とを備えた記録装置の制御方法であって、前記アドレステーブル変換プログラムを実行させることで前記アドレステーブルを変更するテーブル変換工程と、前記第4記憶手段に格納された修正プログラムの前記第3記憶手段への格納工程と、前記記録装置の起動時に、前記テーブル変換工程と、前記格納工程を実行させる制御工程とを有する。
【0009】
【発明の実施の形態】
以下に、本発明に係る実施の形態について添付図面を参照して詳細に説明する。
【0010】
[実施例]
図1は電子機器であり、例えばインクジェット方式の記録装置(プリンタ)である。CPU101はプリンタの画像データの作成、記録制御のためのモータ駆動、記録ヘッド(印字ヘッド)の吐出制御、上位装置(ホスト装置)から転送されたコマンドの解析、パネル112からの入力による各種設定などを行う。
【0011】
本実施例ではその他にプログラム更新時のプログラムデータの解析、フラッシュROM110に対する書き込み、また、システムの起動時においては、110フラッシュROMから読み出したプログラムを訂正用RAM111に書き込み、その後、RAM103に格納されている関数とグローバル変数のアドレステーブルを更新する。
【0012】
ROM102は、プリンタを駆動するための制御プログラム、各種固定値データ(モータの駆動テーブル等)、フォントデータ等が格納されている。ROM102のプログラムはCPU101によって読み出され実行される。各種固定値データはそのまま初期値として使用されるものと、RAM103に展開されCPUにより加工され使用される。本実施例では、ROMは書き換え不能なマスクROMが使用されていて、読み出し専用として動作している。
【0013】
なお、関数を実行するための関数テーブル(説明のため関数テーブルAと表わす)は、起動時にRAM103に格納(展開)され、そのアドレス値が関数の呼び出しに使用される。(このアドレス値を参照して、各アドレスに対応した関数を使用することができる)グローバル変数も同様にアドレスがテーブル化され、そのアドレスは起動時にRAM103に呼び出され、テーブルのアドレスを使用してアクセスされる。
【0014】
RAM103はイメージデータの場合、CPU101によって読み込まれたイメージデータを指定された記録位置(印字位置)と対応するRAM103上に展開され画像データ(印字データ)として使用する。更にRAM103はプログラム実行に必要なワークメモリ、インターフェース(I/F)104から入力データの一時格納場所としての受信バッファとしても使用している。
【0015】
また、本実施例では上述したように、関数とグローバル変数のアドレスをテーブル化したものを格納している。更に、ダウンロードモード時におけるデータの一時保管などにも使用している。
【0016】
I/F104は不図示のホスト装置と接続され、画像データ(印字データ)、プリント指示コマンド、ダウンロードのプログラムデータ等のデータを受信するためのものである。
【0017】
本実施例のI/F104はUSBの規格に準拠した電気的仕様となっており、ホスト装置からのデータだけでなく、プリンタの状態をホストに転送するため、双方向の通信が可能となっている。
【0018】
EEPROM105はプリンタの設定状態を保管しておくだけでなく、その他、記録(印刷)枚数、インク残量なども格納されている。プリンタの状態としては、対応用紙、自動電源ON/OFFなどの機能項目、として格納されている。
【0019】
モータコントローラ106は本実施例のプリンタにおいては、主走査方向に印字ヘッドを走査させて印字を行うプリンタ、印字ヘッドを1回、又は複数回走査させて印字を行うために使用する。モータコントローラ106への制御はCPU101が行い記録(印字)はモータの等速域と加減速領域を使用して行われる。モータコントローラ106のもう一つの制御は被記録媒体(例えば記録用紙)を搬送方向へ移動させるための搬送モータ(LFモータ)である搬送モータコントローラ(ラインフィードモータコントローラ)である。
【0020】
このモーターは記録ヘッドを走査させるキャリッジモーター(記録ヘッド走査用モーター)とは独立で動作可能であり、通常の記録動作においては、記録ヘッド走査用モーターが1回または複数回走査後、ラインフィードモータコントローラが記録用紙を所定量搬送する制御を行う。
【0021】
図8は、プリンタの斜視図である。205は記録ヘッドであり、キャリッジ204上に搭載されてシャフト203に沿って長手方向に往復運動可能となっている。記録ヘッドより吐出されたインクは、記録ヘッドと微小な間隔をおいて、プラテン201に記録面を規制された被記録材202に到達し、その上に画像を形成する。
【0022】
記録ヘッドには、フレキシブルケーブル219を介して画像データに応じて吐出信号が供給される。なお、214はキャリッジ204をシャフト203に沿って走査させるためのキャリッジモーターである。213はモーター214の駆動力をキャリッジ204に伝達するワイヤである。また、218はプラテンローラー201に結合して被記録材202を搬送させるための搬送モーターである。
【0023】
なお、記録ヘッドの解像度は600DPIである。この記録ヘッドは、インクジェット方式でブラック用は320本、カラー用は128本の記録素子が配列されている。記録素子は駆動部とノズルから構成されており、駆動部は、ヒーターによりインクに熱を与えることが可能になっている。この熱によりインクは膜沸騰し、この膜沸騰による気泡の成長または収縮によって生じる圧力変化によって、ノズルからインクが吐出される。
【0024】
図1の説明に戻ると、バスライン109はデータを転送するためのデータ及びアドレスバスである。CPU101が109バスラインを使用し、102から111までの各ユニットを制御する。
【0025】
110はフラッシュROMでありデータの入出力がシリアル形式、メモリ容量は16Kバイトの安価なメモリである。ROM102に格納されているプログラムの代わりに別のプログラムを実行させるために、その代わりのプログラムをフラッシュROM110に格納する。
【0026】
このフラッシュROM110の書き込み、読み出しはCPU101が行う。書き込みは印字装置がダウンロードモードの場合に行われ、読み出しはプログラム起動時(例えば、プリンタの電源オン時)に、CPU101によりフラッシュROM110の内容を確認し、所定のキーワードが格納されている場合に行われる。本実施例では、このキーワードは“BJPR”である。
【0027】
111は訂正用RAMである。この訂正用RAM111はフラッシュROM110と共にROM102に格納されたプログラムの代わりになるプログラムを用意するために使われる。使い方はフラッシュROM110から読み出したプログラムを訂正用RAM111に書き込み、実行される。この訂正用RAM111は、格納されたプログラムの実行速度が高速になるような高速アクセスが可能なSRAMである。
【0028】
フラッシュROM110に格納されたプログラムを訂正用RAM111に書き込むときには、キーワードは読み出さずプログラムのみを訂正用RAM111に書き込む。また同時にテーブル変換用プログラムも、訂正用RAM111に書き込まれる。
【0029】
その後、テーブル変換用プログラムを実行することにより、関数テーブルAの一部に格納されているアドレスが変換後の訂正用RAM111のアドレスを格納するようになる。
【0030】
この動作により、従来ROM102に格納されていた関数が呼ばれていたものが111訂正RAM111に格納されている関数が呼ばれるようになる。
【0031】
本実施例におけるメモリ空間の割り付けは、例えば、0x0000〜0x5FFFFをROM102に割り当て、0x60000以降を訂正用RAM111に割り当てている。
【0032】
図2、7を用いては本実施例でのプログラムをダウンロードする時の処理を説明する。
【0033】
図7において、ダウンロードモードへの移行は、プリンタの電源立ち上げ時にパワーキー、リセットキー、ドアキーの全てのキーを押すことにより行われる。この全てのキーが押されていれば(S31)、このダウンロードモードへの移行し、USBインターフェースにより、受信待ち状態となる(S32)。ダウンロードデータの受信があれば、ダウンロードの処理が行われる(S33)。受信が開始されれば予め決められた時間にデータの受信があるか否か判断し(S34)、予め決められた時間内にデータがなければ通常状態に復帰する(終了する)。本実施例では、データの受信完了までの時間として20秒を設定している。
【0034】
図2では、ダウンロードモードではプログラムデータの受信状態でヘッダー解析が行われる(S11)。受信されたデータを解析し、ヘッダー情報から送られてきたデータがダウンロードデータであるか否かの判断を行う。
【0035】
ダウンロードデータの場合はS12に移行し、ヘッダー情報に付加されているレングスデータを読み込み、レングスに基づいて残りのデータを全て受信する。受信が完了するまでは処理時間のカウントを行う。
【0036】
レングス分のデータを全て受信すると、ヘッダー情報に付加されているSUM値と実際に受信したデータのSUM値を比較し、適切にデータを受信したかチェックする(S13)。SUM値がヘッダー情報と転送されたデータで同じ場合にはS14に進み、書き込みに使用するフラッシュROMの内容を消去(削除)する。使用する条件により、フラッシュROMの全体消去、あるいは部分消去することが選択可能であるが、本実施例では全体容量が16Kバイトと少量なため、全体消去を行っている。
【0037】
次に、SUM値のチェックが完了したプログラムデータをフラッシュROMに格納する(S15)。この場合、ヘッダー部を取り除いて、指定されたアドレスに格納する。その後、書き込んだプログラムの容量(データ数)と書き込みが完了したことを示すキーワード(格納完了情報)を決められたアドレスに格納して(S16)処理を終了しシステムをリセットする。
【0038】
図3では図2で示したようにプログラムをダウンロードした後のプリンタの起動処理を示している。この起動時には、フラッシュROMのキーワード格納アドレスのデータを読み込み、書込み完了(格納完了)を示すキーワード(情報)が格納されているか判断する(S21)。指定されているキーワードが格納されている場合にS22に進み、フラッシュROMに格納されているプログラムの容量(データの長さ)を読み込み、その後そのプログラムの容量(プログラムサイズ)に基づいて、プログラムをフラッシュROMから読み出す(S23)。その後、読み出したプログラムを訂正用RAMに書き込む(S24)。
【0039】
その後、訂正用RAMに書き込まれたプログラムの中で関数とグローバル変数のアドレステーブルを更新するプログラムを起動する(S25)。これらの処理により、従来使用されていたROM102に格納された関数の代わりに、訂正RAM上の関数が使用できるようになる。
【0040】
図4は実際にプログラムがどのように変更されるかを図示したものである。
401は書き換え不能なROM空間である。関数Func1が関数funcAを呼び出す場合、402のfunc[][]と言うテーブルを参照し、そのテーブルの一番目の要素である関数funcAを見つけそのアドレスを参照し関数を呼び出す。この方法は関数だけでなく変数のテーブルを参照することで、グローバル変数においても同様に実行できる。
【0041】
ここまでは、変更前のプログラム(ROM102に格納された)の動作である。仮に、プログラムに変更が必要になった場合は、以下のように、ダウンロードするプログラムを用意する。
【0042】
まず、プログラム中の変更する関数と同じタイプの関数を定義する。関数の内容を修正後、訂正用のRAMにおいて実行可能になるようにアドレスの指定を変更しコンパイル、リンク作業を行う。
【0043】
次に、関数の修正と、修正対象の関数のアドレスと修正のための代わりの関数のアドレスとを入れ替える(修正対象の関数のアドレスを代わりの関数のアドレスに変更する)ため、その関数のアドレス変換をプログラム化した403のようなプログラムを作成し、コンパイル、リンクを行います。
【0044】
このようなプログラムを実行することにより、RAM103に格納されているfunc[][]の一番目の要素がfuncAのアドレスからfuncBのアドレスへの変更されます。これにより、funcBが呼び出されることが可能となり、funcAの代わりにfuncBが実行される。
【0045】
なお、書き換え不能なROM102にある関数は修正前と同様にfunc[][]と言うアドレステーブルから一番目の要素のアドレスを参照します。しかしながら、403でアドレスが変更されているため、今度はfuncAのアドレスではなく、funcBのアドレスを参照し、そのfuncBを呼び出します。このfuncBは修正されているプログラムである為、プログラム全体としては修正された形で動作する。
【0046】
以上のようにプログラムの修正を、1つの関数あるいは1つのグローバル変数を修正単位とすることができ、従来よりも少ないメモリ容量でプログラムの変更が可能となる。
【0047】
図5は上位装置から転送されるデータの構造である。本実施例ではヘッダー部501で使用するダウンロードデータを識別する。このヘッダー部の内容は“0x1B,0x00,0x18,0x00”である。
【0048】
最初のデータである0x1Bはエスケープシーケンスとして認識され、データの区切り、あるいは先頭として認識される。その後の3バイトのデータが認識コードとなり、ダウンロードデータを意味するコードになっている。502はサム値データであり16ビットで表現される。この値は504のプログラムデータのサム値である。503はプログラムデータ全体の容量(データの長さ)を16ビットで格納している。504は実際にフラッシュROMに格納されるデータでデータ形式がバイナリ構造となっており、訂正用RAM111にて使用されないエリアは全て0xFFで埋められている。
【0049】
図6はフラッシュROMと訂正用RAMのマップである。アドレスの先頭には書き込み終了を表すキーワードが4バイト分の領域に格納されている。その後2バイト分の領域に、プログラムの容量(長さ)が格納されている。この容量はアドレス0x10番地から始まるアドレス変換プログラムからアドレス0x400番地以降に格納される変更用関数プログラムの最終アドレスまでの長さとなっている。
【0050】
アドレス変換プログラムの最終アドレスの次のアドレスから変更用関数プログラムの先頭の手前(アドレス0x3FF)まではデータ値0xFFが埋め込まれており、このエリアも全てプログラム容量に含まれる。
【0051】
その後、前述したように0x10番地からはアドレス変換プログラムが格納され、0x400番地以降は変更用関数プログラムが格納されている。このマップはフラッシュROMと訂正用RAMのマップで全く同じ構成で、記録装置の電源オン時に全てコピーされる。その後、アドレス変換プログラムを実行することにより、変更用関数プログラムが有効となり、プログラムが修正される。
【0052】
[その他の実施例]
なお、以上の実施例においては、変更用プログラムデータ転送時に送信エラー検出用にチェックサムを用いたが、CRC−16などのデータ通信エラー検出機能を使っても構わない。
【0053】
また、変更用プログラムデータの構成では、メモリに格納する際、アドレス変換プログラムと変更用関数プログラムとを2つの領域に分けているが、変更用プログラムを作成する際に隣接するアドレスに配置することによりアドレス変換プログラムと変更用関数プログラムの間に生じる未使用領域を無くすことも可能である。
【0054】
更に、変更用プログラムデータの構成では、変更用プログラムのイメージデータはデータ構造としてバイナリーデータの構造をとったが、インテルHEXやモトローラSフォーマットなどのROM化に用いられるデータ構造をとった場合の方が、16バイト単位でデータチェック機構が使えるため、より、信頼性が向上する。
【0055】
【発明の効果】
以上、説明したように、本発明によれば、書き換え不能なROMに格納されているプログラムの代わりのプログラムを、低コストで修正することができる。
【0056】
特に、プログラムの修正の最小単位として、関数ごとに、あるいは、変数ごとに修正できるため、少ないメモリ容量でプログラムの変更が可能となる。
【0057】
また、この代わりのプログラムの実行速度を、フラッシュROMに格納されたプログラムを実行するよりも、より速く行うことができる。
【図面の簡単な説明】
【図1】実施例におけるプリンタのブロック図
【図2】実施例のフラッシュROMへの書込み処理の制御フロー
【図3】実施例のプリンタの起動時の制御フロー
【図4】実施例の関数変更部の説明
【図5】実施例の転送データ構造
【図6】実施例のフラッシュROMのデータ配置図
【図7】実施例のダウンロード処理の制御フロー
【図8】実施例におけるプリンタの斜視図[0001]
TECHNICAL FIELD OF THE INVENTION
The present invention relates to an electronic device such as a recording device that can be updated by downloading control data, a structure of the downloaded data, and a storage method.
[0002]
[Background technology]
2. Description of the Related Art A conventional electronic device such as a recording apparatus stores a program in a non-rewritable mask ROM and operates the recording apparatus by executing the program. In such a configuration, it is impossible to update the program in the recording apparatus alone, and the program is updated by replacing the mounted mask ROM.
[0003]
In a recent recording apparatus, a program for operating the recording apparatus is stored in a rewritable nonvolatile element, and the program is executed from the rewritable nonvolatile element (memory element). In such a recording apparatus, there are elements that can be rewritten in a predetermined memory size unit or a block unit.
[0004]
[Problems to be solved by the invention]
However, changing the mask ROM requires time and cost for creating the mask ROM. Further, even when a rewritable nonvolatile memory element is used, product cost increases in order to secure a memory capacity capable of storing all programs.
[0005]
Further, when executing a program stored in the rewritable nonvolatile memory, there is a delay in accessing the nonvolatile memory.
[0006]
The present invention has been made in view of the above problems, and an object of the present invention is to provide an inexpensive electronic device and a recording device that can easily update a program without deteriorating performance as compared with the related art. .
[0007]
[Means for Solving the Problems]
In order to solve the above-described problems, a recording apparatus of the present invention includes a control unit that controls a recording operation using a recording head, a non-rewritable storage unit in which a program executed by the control unit is stored in advance, What is claimed is: 1. A recording apparatus comprising: a second storage unit for storing an address table; and a third storage unit for storing a correction program to be executed instead of a program, wherein the fourth storage stores a correction program and an address table conversion program. Means, table conversion means for changing the address table by executing the address table conversion program, execution of the table conversion means at the time of starting the recording apparatus, and correction program stored in the fourth storage means to the third storage means. After performing the storage, the control unit executes the correction program.
[0008]
Further, the control method of the recording apparatus of the present invention includes a control unit for controlling a recording operation using a recording head, a non-rewritable storage unit in which a program executed by the control unit is stored in advance, and an address of the program. A record comprising: a second storage unit for storing a table; a third storage unit for storing a correction program executed in place of the program; and a fourth storage unit for storing the correction program and the address table conversion program. A method for controlling an apparatus, comprising: a table conversion step of changing the address table by executing the address table conversion program; and a storing step of a correction program stored in the fourth storage unit in the third storage unit. And a control step of executing the table conversion step and the storage step at the time of starting the recording device. A.
[0009]
BEST MODE FOR CARRYING OUT THE INVENTION
Hereinafter, embodiments of the present invention will be described in detail with reference to the accompanying drawings.
[0010]
[Example]
FIG. 1 shows an electronic apparatus, for example, an ink jet recording apparatus (printer). The
[0011]
In this embodiment, in addition to this, analysis of program data at the time of program update, writing to the
[0012]
The
[0013]
A function table for executing the function (referred to as function table A for the sake of explanation) is stored (developed) in the
[0014]
In the case of image data, the
[0015]
Further, in this embodiment, as described above, the table stores the addresses of the functions and the global variables. Further, it is also used for temporarily storing data in the download mode.
[0016]
The I /
[0017]
The I /
[0018]
The EEPROM 105 not only stores the settings of the printer, but also stores the number of records (prints), the remaining amount of ink, and the like. The status of the printer is stored as corresponding paper, function items such as automatic power ON / OFF, and the like.
[0019]
In the printer of this embodiment, the motor controller 106 is used for printing by scanning the print head in the main scanning direction, and for printing by scanning the print head once or a plurality of times. The control of the motor controller 106 is performed by the
[0020]
This motor can operate independently of a carriage motor (a printhead scanning motor) that scans the printhead. In a normal printing operation, the printhead scanning motor scans once or a plurality of times and then a line feed motor. The controller controls the recording paper to be conveyed by a predetermined amount.
[0021]
FIG. 8 is a perspective view of the printer. A
[0022]
An ejection signal is supplied to the print head via the
[0023]
The resolution of the recording head is 600 DPI. This recording head has an ink jet system in which 320 recording elements for black and 128 recording elements for color are arranged. The recording element includes a driving unit and a nozzle, and the driving unit can apply heat to the ink by a heater. The ink causes the film to boil due to the heat, and the pressure change caused by the growth or shrinkage of the bubble due to the film boiling causes the ink to be ejected from the nozzle.
[0024]
Returning to the description of FIG. 1, the
[0025]
A
[0026]
The writing and reading of the
[0027]
Reference numeral 111 denotes a correction RAM. The correction RAM 111 is used to prepare a program that can replace the program stored in the
[0028]
When writing the program stored in the
[0029]
Thereafter, by executing the table conversion program, the addresses stored in a part of the function table A store the addresses of the corrected RAM 111 after conversion.
[0030]
With this operation, the function stored in the
[0031]
In the allocation of the memory space in this embodiment, for example, 0x0000 to 0x5FFFF is allocated to the
[0032]
2 and 7, a description will be given of processing when downloading a program in the present embodiment.
[0033]
In FIG. 7, the shift to the download mode is performed by pressing all of the power key, the reset key, and the door key when the power of the printer is turned on. If all the keys have been pressed (S31), the mode shifts to the download mode, and the USB interface enters a reception waiting state (S32). If the download data is received, a download process is performed (S33). If the reception is started, it is determined whether or not data is received at a predetermined time (S34), and if there is no data within the predetermined time, the operation returns to the normal state (ends). In this embodiment, 20 seconds is set as the time until data reception is completed.
[0034]
In FIG. 2, in the download mode, header analysis is performed in a state of receiving program data (S11). The received data is analyzed to determine whether or not the data transmitted from the header information is download data.
[0035]
In the case of download data, the process proceeds to S12, where the length data added to the header information is read, and all remaining data is received based on the length. The processing time is counted until the reception is completed.
[0036]
When all the data for the length is received, the SUM value added to the header information is compared with the SUM value of the actually received data, and it is checked whether the data is properly received (S13). If the SUM value is the same in the header information and the transferred data, the flow advances to S14 to erase (delete) the contents of the flash ROM used for writing. Either the entire erasure or partial erasure of the flash ROM can be selected depending on the conditions to be used. However, in this embodiment, the entire erasure is performed because the entire capacity is as small as 16 Kbytes.
[0037]
Next, the program data whose SUM value check is completed is stored in the flash ROM (S15). In this case, the header is removed and stored at the specified address. After that, the capacity (the number of data) of the written program and a keyword (storage completion information) indicating that the writing has been completed are stored in the determined address (S16), and the processing is terminated to reset the system.
[0038]
FIG. 3 shows the printer startup processing after downloading the program as shown in FIG. At the time of this startup, the data at the keyword storage address of the flash ROM is read, and it is determined whether or not a keyword (information) indicating completion of writing (storage completion) is stored (S21). If the designated keyword is stored, the process proceeds to S22, where the program capacity (data length) stored in the flash ROM is read, and then the program is loaded based on the program capacity (program size). Read from the flash ROM (S23). After that, the read program is written to the correction RAM (S24).
[0039]
Thereafter, a program for updating the address table of functions and global variables in the program written in the correction RAM is started (S25). By these processes, the function on the correction RAM can be used instead of the function stored in the
[0040]
FIG. 4 illustrates how the program is actually changed.
[0041]
The operation up to this point is the operation of the program before the change (stored in the ROM 102). If the program needs to be changed, prepare a program to be downloaded as follows.
[0042]
First, a function of the same type as the function to be changed in the program is defined. After correcting the contents of the function, the address specification is changed so that the function can be executed in the correction RAM, and compilation and linking are performed.
[0043]
Next, in order to modify the function and replace the address of the function to be modified with the address of the substitute function for modification (change the address of the function to be modified to the address of the substitute function), the address of that function Create a program like 403 with the conversion program, compile and link.
[0044]
By executing such a program, the first element of func [] [] stored in the
[0045]
The function in the
[0046]
As described above, the program can be modified using one function or one global variable as a modification unit, and the program can be modified with a smaller memory capacity than before.
[0047]
FIG. 5 shows the structure of data transferred from the host device. In this embodiment, the download data to be used is identified in the
[0048]
0x1B, which is the first data, is recognized as an escape sequence and is recognized as a data delimiter or head. Subsequent 3-byte data is a recognition code, which is a code meaning download data. Reference numeral 502 denotes sum value data, which is represented by 16 bits. This value is the sum value of the program data 504. Reference numeral 503 stores the capacity (length of data) of the entire program data in 16 bits. Reference numeral 504 denotes data actually stored in the flash ROM, which has a binary data format, and all areas not used in the correction RAM 111 are filled with 0xFF.
[0049]
FIG. 6 is a map of the flash ROM and the correction RAM. At the beginning of the address, a keyword indicating the end of writing is stored in a 4-byte area. Thereafter, the capacity (length) of the program is stored in an area of 2 bytes. This capacity is the length from the address conversion program starting at address 0x10 to the last address of the changing function program stored at address 0x400 and thereafter.
[0050]
The data value 0xFF is embedded from the address next to the last address of the address conversion program to just before the head of the change function program (address 0x3FF), and this area is also included in the program capacity.
[0051]
Thereafter, as described above, the address conversion program is stored from address 0x10, and the function program for change is stored from address 0x400. This map has exactly the same configuration as the map of the flash ROM and the correction RAM, and is all copied when the power of the recording apparatus is turned on. Thereafter, by executing the address conversion program, the function program for change becomes effective, and the program is modified.
[0052]
[Other Examples]
In the above embodiment, the checksum is used to detect a transmission error when transferring the program data for change, but a data communication error detection function such as CRC-16 may be used.
[0053]
Further, in the configuration of the change program data, the address conversion program and the change function program are divided into two areas when stored in the memory, but they are arranged at adjacent addresses when the change program is created. Thus, an unused area generated between the address conversion program and the change function program can be eliminated.
[0054]
Further, in the structure of the change program data, the image data of the change program has a binary data structure as a data structure. However, the image data of the change program has a data structure used for ROMization such as Intel HEX or Motorola S format. However, since the data check mechanism can be used in units of 16 bytes, the reliability is further improved.
[0055]
【The invention's effect】
As described above, according to the present invention, a program in place of a program stored in a non-rewritable ROM can be modified at low cost.
[0056]
In particular, since the program can be modified for each function or for each variable as the minimum unit for modifying the program, the program can be modified with a small memory capacity.
[0057]
In addition, the execution speed of this alternative program can be faster than executing the program stored in the flash ROM.
[Brief description of the drawings]
FIG. 1 is a block diagram of a printer according to an embodiment. FIG. 2 is a control flow of a writing process to a flash ROM according to the embodiment. FIG. 3 is a control flow at the time of starting up the printer according to the embodiment. Description of the part [FIG. 5] Transfer data structure of the embodiment [FIG. 6] Data arrangement diagram of flash ROM of the embodiment [FIG. 7] Control flow of download processing of the embodiment [FIG. 8] Perspective view of printer in the embodiment
Claims (7)
前記修正プログラムと前記アドレステーブル変換プログラムとを格納する第4記憶手段と、
前記アドレステーブル変換プログラムを実行させることで前記アドレステーブルを変更するテーブル変換手段と、
前記記録装置の起動時に、前記テーブル変換手段の実行と、前記第4記憶手段に格納された修正プログラムの前記第3記憶手段への格納を行った後、前記制御手段は前記修正プログラムを実行することを特徴とする記録装置。Control means for controlling a printing operation using a printhead, non-rewritable storage means in which a program executed by the control means is stored in advance, second storage means for storing an address table of the program, and the program A storage device for storing a correction program to be executed in place of the storage device,
Fourth storage means for storing the correction program and the address table conversion program;
Table conversion means for changing the address table by executing the address table conversion program,
At the time of starting the recording device, after executing the table conversion unit and storing the correction program stored in the fourth storage unit in the third storage unit, the control unit executes the correction program. A recording device characterized by the above-mentioned.
前記アドレステーブル変換プログラムを実行させることで前記アドレステーブルを変更するテーブル変換工程と、
前記第4記憶手段に格納された修正プログラムの前記第3記憶手段への格納工程と、
前記記録装置の起動時に、前記テーブル変換工程と、前記格納工程を実行させる制御工程とを有することを特徴とする記録装置の制御方法。Control means for controlling a printing operation using a printhead, non-rewritable storage means in which a program executed by the control means is stored in advance, second storage means for storing an address table of the program, and the program A control method for a recording apparatus, comprising: a third storage unit that stores a correction program to be executed instead of the storage unit; and a fourth storage unit that stores the correction program and the address table conversion program.
A table conversion step of changing the address table by executing the address table conversion program,
Storing the correction program stored in the fourth storage means in the third storage means;
A control method for a printing apparatus, comprising: a control step of executing the table conversion step and the storing step when the printing apparatus is started.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
JP2002250763A JP2004090232A (en) | 2002-08-29 | 2002-08-29 | Recorder and its control method |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
JP2002250763A JP2004090232A (en) | 2002-08-29 | 2002-08-29 | Recorder and its control method |
Publications (2)
Publication Number | Publication Date |
---|---|
JP2004090232A true JP2004090232A (en) | 2004-03-25 |
JP2004090232A5 JP2004090232A5 (en) | 2007-05-24 |
Family
ID=32057510
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
JP2002250763A Pending JP2004090232A (en) | 2002-08-29 | 2002-08-29 | Recorder and its control method |
Country Status (1)
Country | Link |
---|---|
JP (1) | JP2004090232A (en) |
Cited By (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
WO2018159691A1 (en) * | 2017-02-28 | 2018-09-07 | 日本電信電話株式会社 | Communication processing device, information processing device, and communication processing device control method |
CN112463230A (en) * | 2020-11-23 | 2021-03-09 | 浙江地芯引力科技有限公司 | Program operation method and device, electronic equipment and storage medium |
Citations (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
JPH03186927A (en) * | 1989-12-18 | 1991-08-14 | Olympus Optical Co Ltd | Program alteration device for microcomputer |
JPH0962502A (en) * | 1995-08-22 | 1997-03-07 | Hitachi Ltd | Information processor |
JPH11306006A (en) * | 1998-04-20 | 1999-11-05 | Brother Ind Ltd | Peripheral device and storage medium |
JP2001117782A (en) * | 1999-10-22 | 2001-04-27 | Hitachi Ltd | Microcomputer, disk drive device and information processor |
JP2001282541A (en) * | 2000-03-28 | 2001-10-12 | Internatl Business Mach Corp <Ibm> | Semiconductor device having external rom terminal, method for controlling semiconductor device and hard disk device |
-
2002
- 2002-08-29 JP JP2002250763A patent/JP2004090232A/en active Pending
Patent Citations (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
JPH03186927A (en) * | 1989-12-18 | 1991-08-14 | Olympus Optical Co Ltd | Program alteration device for microcomputer |
JPH0962502A (en) * | 1995-08-22 | 1997-03-07 | Hitachi Ltd | Information processor |
JPH11306006A (en) * | 1998-04-20 | 1999-11-05 | Brother Ind Ltd | Peripheral device and storage medium |
JP2001117782A (en) * | 1999-10-22 | 2001-04-27 | Hitachi Ltd | Microcomputer, disk drive device and information processor |
JP2001282541A (en) * | 2000-03-28 | 2001-10-12 | Internatl Business Mach Corp <Ibm> | Semiconductor device having external rom terminal, method for controlling semiconductor device and hard disk device |
Cited By (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
WO2018159691A1 (en) * | 2017-02-28 | 2018-09-07 | 日本電信電話株式会社 | Communication processing device, information processing device, and communication processing device control method |
US11360758B2 (en) | 2017-02-28 | 2022-06-14 | Nippon Telegraph And Telephone Corporation | Communication processing device, information processing device, and communication processing device control method |
CN112463230A (en) * | 2020-11-23 | 2021-03-09 | 浙江地芯引力科技有限公司 | Program operation method and device, electronic equipment and storage medium |
CN112463230B (en) * | 2020-11-23 | 2023-08-25 | 浙江地芯引力科技有限公司 | Program running method and device, electronic equipment and storage medium |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
JP3706694B2 (en) | Information processing apparatus, printer control method, and storage medium | |
US7839527B2 (en) | Data control apparatus, data control method thereof and image forming apparatus | |
KR100503484B1 (en) | Image forming device | |
JP2004090232A (en) | Recorder and its control method | |
JP2007223163A (en) | Image forming apparatus and image displaying method | |
JP2005094301A (en) | Image forming apparatus | |
JP2000108463A (en) | Printing control apparatus, print system using the same, and recording medium having printing control program recorded therein | |
JP3001213B2 (en) | Printer control device | |
JP2008059360A (en) | Printer | |
JPH05274157A (en) | Image generating device | |
JP2003114807A (en) | Electronics device and method for rewriting main body control program | |
JP2001344156A (en) | Device with flash memory and data rewriting method | |
JP2745360B2 (en) | Printer device | |
JP3176192B2 (en) | Page printer | |
JP2812285B2 (en) | Network interface card for printer | |
JP2000020262A (en) | Printer device | |
JP7058984B2 (en) | Firmware embedded device, control method, program | |
JPH07314798A (en) | Printer device | |
JP2685773B2 (en) | Printing device and printing control method | |
JP2002358209A (en) | Information processing method and device thereof | |
KR100346107B1 (en) | Method for downloading control program in image printing apparatus and control unit of image printing engine therefor | |
JP2001350601A (en) | Image forming apparatus | |
JP2004164510A (en) | Printer driver, and installing method for printer | |
JPS5922766A (en) | Space control system of line dot printer | |
JPH11184651A (en) | Printer |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
A621 | Written request for application examination |
Free format text: JAPANESE INTERMEDIATE CODE: A621 Effective date: 20040609 |
|
A521 | Written amendment |
Free format text: JAPANESE INTERMEDIATE CODE: A523 Effective date: 20070330 |
|
A131 | Notification of reasons for refusal |
Free format text: JAPANESE INTERMEDIATE CODE: A131 Effective date: 20080624 |
|
A521 | Written amendment |
Free format text: JAPANESE INTERMEDIATE CODE: A523 Effective date: 20080822 |
|
A131 | Notification of reasons for refusal |
Free format text: JAPANESE INTERMEDIATE CODE: A131 Effective date: 20090818 |
|
A521 | Written amendment |
Free format text: JAPANESE INTERMEDIATE CODE: A523 Effective date: 20091019 |
|
RD04 | Notification of resignation of power of attorney |
Free format text: JAPANESE INTERMEDIATE CODE: A7424 Effective date: 20100201 |
|
RD01 | Notification of change of attorney |
Free format text: JAPANESE INTERMEDIATE CODE: A7421 Effective date: 20100630 |
|
A02 | Decision of refusal |
Free format text: JAPANESE INTERMEDIATE CODE: A02 Effective date: 20100824 |