メンテナンス用に大型LCD表示を製作
メンテナンス用に見やすくするために、LCDの大型化(20文字×4行)にすることにしました。まず、プログラムの修正箇所を調査してみたら、意外と簡単でLCDのアドレスを追加修正してあれば出来そうなことがわかりました。問題はどのフリーソフトでコンパイルするかですが、やはり、定評のあるMPLAB ICEを利用することにしました。出来上がったバイナリファイル(HEXファイル)を先日製作したRCDライターで書き込みました。
超ローコストRS232Cモニターを参考に製作しましたが、RS232Cなど余計な回路は省いていますから、部品はPICと半固定抵抗とコネクタだけです。
書き換えた例 (MPLABにて、main.cを書き換えた)
//----------- 修正前のLCD表示アドレス(16×2)
case 13 : //return command
if (lcd_loccnt <= 0x10) lcd_loccnt = 0x40;
else if (lcd_loccnt <= 0x50) lcd_loccnt = 0x00;
break;
//-----------
という箇所を次のように修正する。
//----------- 修正後のLCD表示アドレス(20×4)
case 13 : //return command
if (lcd_loccnt <= 0x14) lcd_loccnt = 0x40;
else if (lcd_loccnt <= 0x54) lcd_loccnt = 0x14;
else if (lcd_loccnt <= 0x28) lcd_loccnt = 0x54;
else if (lcd_loccnt <= 0x68) lcd_loccnt = 0x00;
break;
//----------
もう1箇所
//----------- 修正前のLCD表示アドレス(16×2)
if (lcd_loccnt == 0x10) lcd_loccnt = 0x40;
if (lcd_loccnt == 0x50) lcd_loccnt = 0x00;
//-----------
という箇所を次のように修正する。
//----------- 修正後のLCD表示アドレス(20×4)
if (lcd_loccnt == 0x14) lcd_loccnt = 0x40;
if (lcd_loccnt == 0x54) lcd_loccnt = 0x14;
if (lcd_loccnt == 0x28) lcd_loccnt = 0x54;
if (lcd_loccnt == 0x68) lcd_loccnt = 0x00;
//-----------
RCDライタ−は安く出来たが、動作の信頼度はありますね。LCD代とPIC代だけで表示器が出来てしまう時代に改めて驚きですね。
超ローコストRS232Cモニターを参考に製作しましたが、RS232Cなど余計な回路は省いていますから、部品はPICと半固定抵抗とコネクタだけです。
書き換えた例 (MPLABにて、main.cを書き換えた)
//----------- 修正前のLCD表示アドレス(16×2)
case 13 : //return command
if (lcd_loccnt <= 0x10) lcd_loccnt = 0x40;
else if (lcd_loccnt <= 0x50) lcd_loccnt = 0x00;
break;
//-----------
という箇所を次のように修正する。
//----------- 修正後のLCD表示アドレス(20×4)
case 13 : //return command
if (lcd_loccnt <= 0x14) lcd_loccnt = 0x40;
else if (lcd_loccnt <= 0x54) lcd_loccnt = 0x14;
else if (lcd_loccnt <= 0x28) lcd_loccnt = 0x54;
else if (lcd_loccnt <= 0x68) lcd_loccnt = 0x00;
break;
//----------
もう1箇所
//----------- 修正前のLCD表示アドレス(16×2)
if (lcd_loccnt == 0x10) lcd_loccnt = 0x40;
if (lcd_loccnt == 0x50) lcd_loccnt = 0x00;
//-----------
という箇所を次のように修正する。
//----------- 修正後のLCD表示アドレス(20×4)
if (lcd_loccnt == 0x14) lcd_loccnt = 0x40;
if (lcd_loccnt == 0x54) lcd_loccnt = 0x14;
if (lcd_loccnt == 0x28) lcd_loccnt = 0x54;
if (lcd_loccnt == 0x68) lcd_loccnt = 0x00;
//-----------
RCDライタ−は安く出来たが、動作の信頼度はありますね。LCD代とPIC代だけで表示器が出来てしまう時代に改めて驚きですね。
- 2008.02.29 Friday
- プログラム
- comments(0)
- trackbacks(0)
- by takuo1