要約:このアプリケーションノートはMAX1233/MAX1234の機能の使用方法を示します。MAX1233/MAX1234のデバイスレジスタに直接ローレベルでアクセスする簡単なコンソールメニューシステムが用意されています。各レジスタの読取りまたは書込み動作は、32個のSPI™クロックサイクルで行われます。ソフトウェアでは各レジスタに対して短い簡略名(mnemonic)を使います。MAX1234の評価キット(EVキット)ボードとMINIQUSB+コマンドモジュールを組み合わせて使うと、このソフトウェアは最大のローレベル制御を行うことができます。同梱のzipファイルには完全なソースコードが用意されています。
MAX1233の動作はMAX1234の動作と同じですが、MAX1233は3.3V電源で動作し、MAX1234は5.0Vで動作することが異なっています。MAX1234のEVキットボード上のジャンパJU1はMAX1234を3.3Vで動作させて、MAX1233をエミュレートします。
注:サフィックス「/」 (例、/CS)はCS、PENIRQ、KEYIRQ、およびBUSY端子がアクティブローの機能であることを示します。
目次
MAX1233/MAX1234タッチスクリーンコントローラを使ってみましょう
1.1) 必要とするハードウェア
1.2) MINIQUSB+ファームウェアの更新ノート
1.3) セットアップ
1.4) 手順
1.5) 実例フォーマットによるSPI data inの説明
2) アナログI/Oの例
2.1) DAC出力電圧の制御
2.2) ADCリファレンスの電源モードの選択
2.3) 外部電圧入力AUX1、AUX2の測定
2.4) AUX1とAUX2の変換結果を物理値に変換
2.5) 外部電圧入力BAT1、BAT2の測定
2.6) BAT1とBAT2の変換結果を物理値に変換
2.7) 内部温度TEMP1、TEMP2の測定
2.8) TEMP1の変換結果を物理値に変換
2.9) TEMP1とTEMP2の変換結果を物理値に変換
2.10) 外部電圧入力AUX1、AUX2、BAT1、BAT2、および温度の測定
3) タッチスクリーンの例
3.1) 低コスト、既製品のタッチスクリーンの入手
3.2) タッチスクリーンのEVキットへの接続
3.3) タッチスクリーン接続の確認
3.4) タッチの検出:デマンドスキャン
3.5) タッチの検出:自動スキャン
4) キーパッドと汎用入出力端子
4.1) キーパッドとGPIO端子の構成
4.2) GPIO端子への書込みと読取り
4.3) キープレスの検出:自動スキャン
4.4) キーパッドの個別キーのマスクオフ
4.5) キーパッドのコラムのマスクオフ
5) 電源消費の管理
6) メニューシステム
6.1) レジスタ読取り/書込みコマンド
6.2) 割込みおよびステータス端子コマンド
6.3) 更新されたMINIQUSB+ファームウェアに追加されたコマンド
7) 結論
1.1) 必要とするハードウェア
- マキシムMAX1234のEVキット(MAX1234EVKIT)を1個
- マキシムMINIQUSB+ (USB A-BケーブルおよびMINIQUSB-X+延長ボードを含む)を1式
- USB付Windows®2000/XPのPCを1式
- 4線式抵抗タッチスクリーン(代替PDAデジタイザー/ガラストップなど)
- オプション:DAC出力電圧を測定するDMM
- オプション:AUXとBAT入力を駆動する電圧源
- オプション:/PENIRQと/KEYIRQ端子の自動スキャンパルスを観測するオシロスコープ
1.2) MINIQUSB+ファームウェアの更新ノート
MAX1233/MAX1234は最初の変換が終わる前に/CS端子がデアサートしてハイになる必要があります。そうでなければADCは変換結果を格納することができません。このアプリケーションノートを使用する前に標準のMINIQUSB+モジュールファームウェアを更新して32番目のSCLKの1.4µs以内にSPIインタフェースの/CS端子がデアサートするようにしなければなりません。2MHzでは、32ビットの自動/CS制御モードは/CSを21.70µsの間、ローに保持します。MAXQ2000マイクロコントローラの不揮発性フラッシュメモリの中のMINIQUSB+ファームウェアは一回だけ更新する必要があります。この新しいファームウェアは標準の01.05.39ベースラインファームウェアと下位互換です。
SPIインタフェースの/CSタイミングの改良に加えて、ファームウェアの更新には割込み駆動アキュムレータが含まれており、/PENIRQと/KEYIRQがMAX1233/MAX1234が自動スキャンモードに構成されたときにそれを自己クリアする割込みパルスを発行したことを
確認することが可能になります。/PENIRQの期間は設定されたADCの変換速度に依存し、/KEYIRQの期間は設定されたスイッチのデバウンス時間に依存します。
1.3) セットアップ
アプリケーションノートファイル(ZIP、2.4MB)をダウンロードして解凍します。
図1に従って、ハードウェアを組み立てます。
- 表1に従って、MAX1234のEVキットコネクタJ1からMINIQUSB-X+拡張ボード(MINIQUSB+を含む)にワイヤを接続します。MAX1234のEVキットをワイヤで半田付けする代わりに3M®のイントラコネクタ922576-40をJ1にプラグインすると、便利な接続ポイントになります。ターミナルブロックTB1は未接続のままにします。
表1.MAX1234のEVキットとMINIQUSB+ボードセットとの接続
| MAX1234 Signal |
MAX1234 EV Kit |
MINIQUSB-X+ |
MINIQUSB Signal |
| GND |
J1-1 |
H2-8 |
GND |
| VCC |
J1-7 |
H2-1 |
3.3V supply from MINIQUSB+ |
| BUSY-Bar |
J1-27 |
H2-7 |
GPIO-K7 (MAXQ2000-INT2) |
| PENIRQ-Bar |
J1-29 |
H1-3 |
GPIO-K6 (MAXQ2000-INT1) |
| KEYIRQ-Bar |
J1-31 |
H1-8 |
GPIO-K5 (MAXQ2000-INT0) |
| DOUT |
J1-35* |
H2-2 |
MISO (SPI master in, slave out) |
| DIN |
J1-36* |
H2-5 |
MOSI (SPI master out, slave in) |
| SCLK |
J1-37* |
H2-3 |
SCLK (SPI clock) |
| CS-Bar |
J1-38 |
H2-4 |
CS-bar (SPI chip select) |
| USB+5V |
J1-5 |
J4-7 |
USB+5V supply from PC |
*注:MAX1234のEVキットへのディジタル入力はJ1を通して駆動しなければなりません。U1の周りの試験ポイントで、じかに駆動してはなりません。搭載したMAX1841レベル変換器はMAX1234のEVキットのディジタル信号を駆動するために使用されています。
- MINIQUSB+の上に拡張ボードを差し込みます。
- MINIQUSB+をPCのUSBポートに接続します。MINIQUSB+をPCに接続するのが初めてであれば、プラグアンドプレイのウィザードが現れます。デバイスドライバ(付属のzipファイルに入っています)をインストールした場所にWindowsを操作します。
- ファームウェア更新バッチファイルのFWUPDATE.BATを立ち上げてMINIQUSB+ファームウェアを更新します。
- ファームウェアの更新を終えたら、MINIQUSB+をPCのUSBポートから外します。

図1. ハードウェア構成(後の項でタッチスクリーンを接続します。)

図2. 3Mのイントラコネクタを使用して、MINIQUSB+をMAX1234のEVキットにワイヤ接続したシステム写真。
1.4) 手順
- MAX1234のEVキットのジャンパJU1を"MAX1234"の位置に設定します。
- MINIQUSB+をPCのUSBポートに接続します。DACOUT電圧 = 中間スケール(2.2V)となることを確認します。
- DEMO1234.EXEプログラムをスタートします。するとコンソールが画面に現れます。
- コンソールを使って次に示す一連のコマンドを入力します。
表2. コマンドシーケンスの接続と確認
DEMO1234 Command* |
Expected Program Output |
SPI data in |
Verification** |
C |
Board connected.
Got board banner: Maxim MINIQUSB V01.05.41 >
Firmware version is OK.
(configured for SPI auto-CS 4-byte mode) (SCLK=2MHz) ...
|
|
|
T W DD FF |
Write_Register(regAddr=0x000b wr_DAC_data ,
data=0x00ff
{(no bits defined for this register)}) result = 1
|
0x000b 0x00ff |
DACOUT = full-scale (4.5V) |
T R DD |
Read_Register(regAddr=0x800b wr_DAC_data ) result = 1,
buffer = 0x00ff = 255
{(no bits defined for this register)}
|
0x800b 0x0000 |
Data buffer = 0x00ff |
T W DD 80 |
Write_Register(regAddr=0x000b wr_DAC_data ,
data=0x0080
{(no bits defined for this register)}) result = 1
|
0x000b 0x0080 |
DACOUT = mid-scale (2.2V) |
T R DD |
Read_Register(regAddr=0x800b wr_DAC_data ) result = 1,
buffer = 0x0080 = 128
{(no bits defined for this register)}
|
0x800b 0x0000 |
data buffer = 0x0080 |
* DEMO1234 Command欄はDEMO1234.exeプログラムにタイプ入力するコマンドを掲げています。
** Verification欄はコマンドが実行されたことを確認するために行うことができる物理的試験を示しています。
1.5) 実例フォーマットでのSPI data inの説明
SPI data in欄はMAX1233/MAX1234のDIN端子に入力するSPIデータを16進数で最上位バイトを先頭として示しています。例えばシーケンスが0x000b 0x00ffのSPIデータはDINにクロック同期入力する32ビットシーケンスが0000 0000 0000 1011 0000 0000 1111 1111であることを意味します。最初のビットが0はレジスタへの書込み動作、1はレジスタの読取り動作になります。
レジスタへの書込み動作は0000 0000 a7-a0 d15-d0の形式での32ビットSPI転送です。
レジスタの読取り動作は1000 0000a7-a0 0000 0000の形式での32ビットSPI転送であり、受信したデータは最後の16ビットの間にDOUTからクロック同期入力されます。
2) アナログI/Oの例
以下の例はDAC出力の制御、リファレンス電圧の設定、AUX1/AUX2/BAT1/BAT2電圧入力の測定、およびMAX1234の内部温度の測定を行うためのDEMO1234.EXEプログラムの使用方法を示しています。
2.1) DAC出力電圧の制御
DACは2つのレジスタで制御します。出力電圧を設定するためにはDACのデータレジスタに書き込みます。DACをシャットダウンするか、または給電するためにはDAC制御レジスタに書き込みます。電源投入のデフォルト状態はDACが給電されて、DAC出力は中間スケールとなります。DACのフルスケール電圧は標準値でAVDDの90%です(85% min、95% max)。
AVDD = 3.3V ±5%の場合、DACOUTのフルスケール範囲は2.65V~3.27Vで標準値は2.96Vです。
AVDD = 5.0V ±5%の場合、DACOUTのフルスケール範囲は4.02V~4.97Vで標準値は4.48Vです。
表3.DAC出力コマンド
DEMO1234 Command |
Action |
SPI data in |
MAX1233 (3.3V) |
MAX1234 (5.0V) |
T W DD FF |
DACOUT = full-scale |
0x000b 0x00ff |
DACOUT = 2.96V |
DACOUT = 4.48V |
T W DD 00 |
DACOUT = 0V |
0x000b 0x0000 |
DACOUT = 0.0V |
DACOUT = 0.0V |
T W DD 80 |
DACOUT = mid-scale |
0x000b 0x0080 |
DACOUT = 1.485V |
DACOUT = 2.25V |
T W DC 8000 |
Disable DAC |
0x0042 0x8000 |
DACOUT = 0.0V |
DACOUT = 0.0V |
T W DC 0 |
Enable DAC |
0x0042 0x0000 |
DACOUT = 1.485V |
DACOUT = 2.25V |
2.2) ADCリファレンスの電源モード
ADCにはリファレンス電圧が必要です。通常の埋め込み型システムの動作ではデフォルト設定値で問題ないです。自動起動モード(ADC3210 = 0000, RES10 = 00)ではMAX1233/MAX1234は自身の内部リファレンス電圧を供給します。内部リファレンスは各測定の前に自動的に立ち上がり、測定が終わると、電源断になります。
最初の診断に常時電源オンモード(ADC3210 = 0000, RES10 = 01)を使うと、携帯型DVMによって外部からリファレンス電圧の確認が可能です。
ADCリファレンスパワーモードはADC制御レジスタ(0x40)のADCスキャン選択ビットを0000に設定することによって設定されます。RES1/RES0ビットによってリファレンスパワーモードを選択し、リファレンス制御ビットRFVによって内部の1.0Vまたは2.5Vリファレンスを選択します(MAX1233/MAX1234のデータシートの表13を参照)。
ADC制御ワード:x x 0 0 0 0 RES1 RES0 x x x x x x x RFV
表4. 内部リファレンスコマンド
DEMO1234 Command |
Action |
SPI data in |
Verification |
T W AC 0100 |
Internal 1V reference always powered; write ADC control word with
ADC3210 = 0000,
RES10 = 01,
RFV = 0 |
0x0040 0x0100 |
Voltage at pin 12 REF is between 0.98V and 1.02V |
T W AC 0101 |
Internal 2.5V reference always powered; write ADC control word with
ADC3210 = 0000,
RES10 = 01,
RFV = 1 |
0x0040 0x0101 |
Voltage at pin 12 REF is between 2.47V and 2.53V |
T W AC 0001 |
Internal 2.5V reference powered when needed; write ADC control word with
ADC3210 = 0000,
RES10 = 00,
RFV = 1 |
0x0040 0x0001 |
Voltage at pin 12 REF will be powered only briefly as necessary |
表5. 外部リファレンスコマンド
DEMO1234 Command |
Action |
SPI data in |
T W AC 0300 |
External reference must be provided;
ADC_control_wr_demand_scan:(write)demand scan
ADC_control_AD0000:configure reference
ADC_control_RES11:external reference |
0x0040 0x0300 |
2.3) 外部電圧入力AUX1、AUX2の測定
表6. ADC測定コマンドシーケンス
DEMO1234 Command |
Action (Triggered by A/D3210 Bits) |
SPI data in |
T M8 |
Measure AUX1 with 12-bit resolution and 3.5µs conversion rate |
0x0040 0x2301
0x8007 0x0000 |
T W AC 2301 |
Trigger ADC scan of AUX1;
ADC control word 0x2301 means:
ADC_control_wr_demand_scan
ADC_control_AD1000 /* measure AUX1 */
ADC_control_RES11 /* 12-bit resolution */
ADC_control_AVG00 /* no averaging */
ADC_control_CNR00 /* conversion rate 3.5µs */
ADC_control_RFV /* RFV=1: VREF=2.5V */ |
0x0040 0x2301 |
T R A1 |
Read AUX1 result AUX1_code |
0x8007 0x0000 |
T M9 |
Measure AUX2 with 12-bit resolution and 3.5µs conversion rate |
0x0040 0x2701
0x8008 0x0000 |
2.4) AUX1とAUX2の変換結果を物理値に変換
次に示すC/C++擬似コードの抜粋はAUX1とAUX2の変換結果がDEMO1234プログラムによってどのように解釈されるかを要約しています。
/* ADC control resolution value selects num_codes 4096 (12-bit), 1024 (10-bit), or 256 (8-bit) */
int num_codes = 4096; /* ADC_control_RES11: 12-bit resolution */
/* Voltage that corresponds to the full-scale ADC code; may be internal 1V or 2.5V ref, or ext ref. */
double ADC_fullscale_voltage = 2.5; /* ADC_control_RFV=1: VREF=2.5V. RFV=0: VREF=1.0V. */
/* AUX1_code is the 16-bit result read by SPI command 0x8007 */
double AUX1_Voltage = (AUX1_code * ADC_fullscale_voltage) / num_codes;
/* AUX2_code is the 16-bit result read by SPI command 0x8008 */
double AUX2_Voltage = (AUX2_code * ADC_fullscale_voltage) / num_codes;
2.5) 外部電圧入力BAT1、BAT2の測定
表7. ADC測定コマンドシーケンス
DEMO1234 Command |
Action (Triggered by A/D3210 Bits) |
SPI data in |
T M6 |
Measure BAT1 with 12-bit resolution and 3.5µs conversion rate |
0x0040 0x1b01
0x8005 0x0000 |
T W AC 1b01 |
Trigger ADC scan of BAT1;
ADC control word 0x1b01 means:
ADC_control_wr_demand_scan
ADC_control_AD0110 /* measure BAT1 */
ADC_control_RES11 /* 12-bit resolution */
ADC_control_AVG00 /* no averaging */
ADC_control_CNR00 /* conversion rate 3.5µs */
ADC_control_RFV /* RFV=1: VREF=2.5V */ |
0x0040 0x1b01 |
T R B1 |
Read BAT1 result BAT1_code |
0x8005 0x0000 |
T W AC 1b21 |
Trigger ADC scan of BAT1;
ADC control word 0x1b21 means:
ADC_control_wr_demand_scan
ADC_control_AD0110 /* measure BAT1 */
ADC_control_RES11 /* 12-bit resolution */
ADC_control_AVG00 /* no averaging */
ADC_control_CNR10 /* conversion rate 10µs */
ADC_control_RFV /* RFV=1: VREF=2.5V */ |
0x0040 0x1b21 |
T R B1 |
Read BAT1 result BAT1_code |
0x8005 0x0000 |
T M7 |
Measure BAT2 with 12-bit resolution and 3.5µs conversion rate |
0x0040 0x1f01
0x8006 0x0000 |
2.6) BAT1とBAT2の変換結果を物理値に変換
次に示すC/C++擬似コードの抜粋はBAT1とBAT2の変換結果がDEMO1234プログラムによってどのように解釈されるかを要約しています。注:BAT1とBAT2は4:1の入力分圧器によって測定されます。
/* ADC control resolution value selects num_codes 4096 (12-bit), 1024 (10-bit), or 256 (8-bit) */
int num_codes = 4096; /* ADC_control_RES11: 12-bit resolution */
/* Voltage that corresponds to the full-scale ADC code; may be internal 1V or 2.5V ref, or ext ref. */
double ADC_fullscale_voltage = 2.5; /* ADC_control_RFV=1: VREF=2.5V. RFV=0: VREF=1.0V. */
/* Note: BAT1 and BAT2 measure through a 4:1 input divider. */
/* BAT1_code is the 16-bit result read by SPI command 0x8005 */
double BAT1_Voltage = 4 * (BAT1_code * ADC_fullscale_voltage) / num_codes;
/* BAT2_code is the 16-bit result read by SPI command 0x8006 */
double BAT2_Voltage = 4 * (BAT2_code * ADC_fullscale_voltage) / num_codes;
2.7) 内部温度TEMP1、TEMP2の測定
表8. ADC測定コマンドシーケンス
DEMO1234 Command |
Action (Triggered by A/D3210 Bits) |
SPI data in |
T MA |
Measure TEMP1 with 12-bit resolution and 3.5µs conversion rate |
0x0040 0x2b01
0x8009 0x0000 |
T W AC 2b01 |
Trigger ADC scan of TEMP1;
ADC control word 0x2b01 means:
ADC_control_wr_demand_scan
ADC_control_ AD1010 /* measure TEMP1 */
ADC_control_RES11 /* 12-bit resolution */
ADC_control_AVG00 /* no averaging */
ADC_control_CNR00 /* conversion rate 3.5µs */
ADC_control_RFV /* RFV=1: VREF=2.5V */ |
0x0040 0x2b01 |
T R T1 |
Read TEMP1 result TEMP1 _code |
0x8009 0x0000 |
T MC |
Measure TEMP1, TEMP2 with 12-bit resolution and 3.5µs conversion rate |
0x0040 0x3301
0x8009 0x0000
0x800a 0x0000 |
T W AC 3301 |
Trigger ADC scan of TEMP1 and TEMP2;
ADC control word 0x3301 means:
ADC_control_wr_demand_scan
ADC_control_ AD1100 /* measure TEMP1,TEMP2 */
ADC_control_RES11 /* 12-bit resolution */
ADC_control_AVG00 /* no averaging */
ADC_control_CNR00 /* conversion rate 3.5µs */
ADC_control_RFV /* RFV=1: VREF=2.5V */ |
0x0040 0x3301 |
T R T1 |
Read TEMP1 result TEMP1 _code |
0x8009 0x0000 |
T R T2 |
Read TEMP2 result TEMP2 _code |
0x800a 0x0000 |
2.8) TEMP1の変換結果を物理値に変換
次に示すC/C++擬似コードの抜粋はTEMP1の変換結果がDEMO1234プログラムによってどのように解釈されるかを要約しています。
/* ADC control resolution value selects num_codes 4096 (12-bit), 1024 (10-bit), or 256 (8-bit) */
int num_codes = 4096; /* ADC_control_RES11: 12-bit resolution */
/* Voltage that corresponds to the full-scale ADC code; may be internal 1V or 2.5V ref, or ext ref. */
double ADC_fullscale_voltage = 2.5; /* ADC_control_RFV=1: VREF=2.5V. RFV=0: VREF=1.0V. */
/* TEMP1_code is the 16-bit result read by SPI command 0x8009 */
double TEMP1_Voltage = (TEMP1_code * ADC_fullscale_voltage) / num_codes;
/* Calibration values */
const double Temp1V_Room = 0.590; // temp1 voltage at room temperature 25C
const double Temp1K_Room = 298.15; // Room temperature Kelvins (298.15K=25C)
const double Temp1V_Per_K = -0.002; // TempCo -2mV per degree C
/* Convert to absolute temperature */
double Kelvin = (TEMP1_Voltage - Temp1V_Room) / Temp1V_Per_K + Temp1K_Room;
/* Optional conversion to commonly used temperature units */
double Centigrade = Kelvin - 273.15;
double Fahrenheit = (Centigrade * 9.0 / 5.0) + 32;
2.9) TEMP1とTEMP2の変換結果を物理値に変換
次に示すC/C++擬似コードの抜粋はTEMP1とTEMP2の変換結果がDEMO1234プログラムによってどのように解釈されるかを要約しています。TEMP2はTEMP1と比較される場合にのみ意味があります。
/* ADC control resolution value selects num_codes 4096 (12-bit), 1024 (10-bit), or 256 (8-bit) */
int num_codes = 4096; /* ADC_control_RES11: 12-bit resolution */
/* Voltage that corresponds to the full-scale ADC code; may be internal 1V or 2.5V ref, or ext ref. */
double ADC_fullscale_voltage = 2.5; /* ADC_control_RFV=1: VREF=2.5V. RFV=0: VREF=1.0V. */
/* TEMP1_code is the 16-bit result read by SPI command 0x8009 */
double TEMP1_Voltage = (TEMP1_code * ADC_fullscale_voltage) / num_codes;
/* TEMP2_code is the 16-bit result read by SPI command 0x800a */
double TEMP2_Voltage = (TEMP2_code * ADC_fullscale_voltage) / num_codes;
/* Calibration values */
const double K_Per_Temp21_Delta_V = 2680.0; // nominal 2680 5/27/2002
/* Convert to absolute temperature */
double Kelvin = (TEMP2_Voltage - TEMP1_Voltage) * K_Per_Temp21_Delta_V;
/* Optional conversion to commonly used temperature units */
double Centigrade = Kelvin - 273.15;
double Fahrenheit = (Centigrade * 9.0 / 5.0) + 32;
2.10) 外部電圧入力AUX1、AUX2、BAT1、BAT2、および温度の測定
表9. ADC測定コマンドシーケンス
DEMO1234 Command |
Action (Triggered by A/D3210 Bits) |
SPI data in |
T MB |
Measure BAT1/4, BAT2/4, AUX1, AUX2, TEMP1, TEMP2 with 12-bit resolution and 3.5µs conversion rate |
0x0040 0x2f01
0x8005 0x0000
0x8006 0x0000
0x8007 0x0000
0x8008 0x0000
0x8009 0x0000
0x800a 0x0000 |
T W AC 2f01 |
Trigger ADC scan of BAT1-2, AUX1-2, TEMP1-2;
ADC control word 0x2f01 means:
ADC_control_wr_demand_scan
ADC_control_ AD1011 /* measure AUX1 etc. */
ADC_control_RES11 /* 12-bit resolution */
ADC_control_AVG00 /* no averaging */
ADC_control_CNR00 /* conversion rate 3.5µs */
ADC_control_RFV /* RFV=1: VREF=2.5V */ |
0x0040 0x2f01 |
T R B1 |
Read BAT1 result BAT1 _code |
0x8005 0x0000 |
T R B2 |
Read BAT2 result BAT2_code |
0x8006 0x0000 |
T R A1 |
Read AUX1 result AUX1 _code |
0x8007 0x0000 |
T R A2 |
Read AUX2 result AUX2 _code |
0x8008 0x0000 |
T R T1 |
Read TEMP1 result TEMP1 _code |
0x8009 0x0000 |
T R T2 |
Read TEMP2 result TEMP2 _code |
0x800a 0x0000 |
3) タッチスクリーンの例
以下の例はタッチスクリーンデータを得るためのDEMO1234.EXEプログラムの使い方を示します。
3.1) 低コスト、既製品のタッチスクリーンの入手
"PDA Digitizer/Glasstop"という用語でインターネット検索をすると、適合する代替タッチスクリーンを探すことができます。モデルとガラスがディスプレイ全体に取り付けられているかどうかに依存しますが、クリアなタッチの感触のガラスは50~10ドルの範囲の価格です。
3.2) タッチスクリーンのEVキットへの接続
MAX1234のEVキットはブレークアウトヘッダH5/H6を備えているため、10mm以下の幅のフレキシブルケーブルに接続することができます。H6コネクタのピッチは0.5mmで、これは実際のタッチスクリーン用のケーブルピッチよりも微細にできています。単純にフレキシケーブルをH6に差し込み、ラッチを確実に行い、4つのフレキシブルケーブルトレースのおのおののほぼ中心にあるH5のピンを選択します。H5からのワイヤをU1とラベルを貼った試験ポイントのX+、 Y+、 X-、およびY-にジャンパしてください。
3.3) タッチスクリーン接続の確認
タッチスクリーンを初めて接続する場合は、XとY接続が正しいことを確認するために以下の手順としてください。タッチスクリーンの接続方法は幾つかありますが、ほとんどは旨く動作しません。これらの例ではX- = left、X+ = right、Y- = top、Y+ = bottomと仮定しています。
表10. タッチスクリーンの物理的接続の確認のためのコマンドシーケンス
DEMO1234 Command |
Action |
SPI data in |
Verification |
| |
Connect DVM to X+/GND |
|
|
T MD |
No measurement; drive Y+,Y- |
0x0040 0x3701 |
|
|
Touch top left |
|
X+ = approx. Y- |
|
Touch top right |
|
X+ = approx. Y- |
|
Touch bottom left |
|
X+ = approx. Y+ |
|
Touch bottom right |
|
X+ = approx. Y+ |
|
Connect DVM to Y+/GND |
|
|
T ME |
No measurement; drive X+,X- |
0x0040 0x3b01 |
|
|
Touch top left |
|
Y+ = approx. X- |
|
Touch top right |
|
Y+ = approx. X+ |
|
Touch bottom left |
|
Y+ = approx. X- |
|
Touch bottom right |
|
Y+ = approx. X+ |
表11. タッチスクリーンの接続問題の修正
| Symptom |
Correction |
| Touch coordinates are mirrored top-to-bottom |
Swap the Y+ and Y- connections |
| Touch coordinates are mirrored left-to-right |
Swap the X+ and X- connections |
| Touch coordinates are rotated 180 degrees |
Swap the X+ and X- connections, and swap the Y+ and Y- connections |
| Touch coordinates are mirrored diagonally |
Swap the X+ and Y+ connections, and swap the X- and Y- connections |
| Touch coordinates do not seem to track, and the distortion is not a simple flip/rotate/mirror transformation |
Swap the X+ and Y+ connections; if distortion persists, swap the X+ and Y- connections; if distortion still persists, disconnect touch screen and use DVM to verify X+ to X- resistance and Y+ to Y- resistance; verify with no touch X+ and X- are isolated from Y+ and Y- |
3.4) タッチの検出:デマンドスキャン
デマンドでタッチを検出してタッチの位置をディジタイズするようにMAX1234を構成するためには、レジスタ0x40 (ADC制御)でPENSTS=0およびADSTS=0と書き込みます(MAX1233/MAX1234のデータシートの表6を参照)。レジスタ0x00 (X座標)を読み取ると、次にタッチが検出されたら/PENIRQ信号ラッチがローになり、そしてADC制御がX、Y座標を計測するために書き込まれるまで、ローに留まります。
表12.タッチスクリーン測定コマンドシーケンス:デマンドスキャン
DEMO1234 Command |
Action |
SPI data in |
Verification |
T W AC 0b01 |
Demand scan |
0x0040 0x0b01 |
|
T R AX |
Read conversion result register X |
0x8000 0x0000 |
|
P R 6 |
Read PENIRQ-bar pin status |
|
PENIRQ = 1 |
|
Touch the touch screen |
|
|
P R 6 |
Read PENIRQ-bar pin status |
|
PENIRQ = 0 |
T M2 |
Measure X,Y,Z1,Z2 |
0x0040 0x0b01
0x8000 0x0000
0x8001 0x0000
0x8002 0x0000
0x8003 0x0000 |
|
P R 6 |
Read PENIRQ-bar pin status |
|
PENIRQ = 1 |
|
Touch and hold the touch screen |
|
|
P R 6 |
Read PENIRQ-bar pin status |
|
PENIRQ = 0 |
T M2 |
Measure X,Y,Z1,Z2 |
0x0040 0x0b01
0x8000 0x0000
0x8001 0x0000
0x8002 0x0000
0x8003 0x0000 |
|
P R 6 |
Read PENIRQ-bar pin status |
|
PENIRQ = 0 |
T M2 |
Measure X,Y,Z1,Z2 |
0x0040 0x0b01
0x8000 0x0000
0x8001 0x0000
0x8002 0x0000
0x8003 0x0000 |
|
P R 6 |
Read PENIRQ-bar pin status |
|
PENIRQ = 0 |
|
Release the touch screen |
|
|
P R 6 |
Read PENIRQ-bar pin status |
|
PENIRQ = 0 |
T M2 |
Measure X,Y,Z1,Z2 |
0x0040 0x0b01
0x8000 0x0000
0x8001 0x0000
0x8002 0x0000
0x8003 0x0000 |
|
P R 6 |
Read PENIRQ-bar pin status |
|
PENIRQ = 1 |
3.5) タッチの検出:自動スキャン
スクリーンタッチが検出されたとき自動的にタッチの位置をディジタイズするようにMAX1234を設定するためには、レジスタ0x40 (ADC制御)でPENSTS=1およびADSTS=0と書き込みます(MAX1233/MAX1234のデータシートの表6を参照)。スクリーンが最初にタッチされたとき、/PENIRQ信号は短い時間の間、ローになり、 Xレジスタが再び読み取られるまでパルス出力しません。
表13.タッチスクリーン測定コマンドシーケンス:自動スキャン
DEMO1234 Command |
Action |
SPI data in |
Verification |
|
Optional: connect oscilloscope to PENIRQ-bar |
|
|
I C 1 3 |
Configure PENIRQ-bar pulse accumulator: falling-edge trigger |
|
|
I 0 1 |
Reset the pulse accumulator |
|
|
I R 1 |
Read the number of times PENIRQ-bar has pulsed low |
|
count = 0 |
T W AC 8bff |
Wait for touch, then scan X,Y,Z1,Z2 |
0x0040 0x8bff |
|
|
Touch the touch screen |
|
PENIRQ pulse |
I R 1 |
Read the number of times PENIRQ-bar has pulsed low |
|
count has increased |
T R P |
Read X,Y,Z1,Z2 conversion results |
0x8000 0x0000
0x8001 0x0000
0x8002 0x0000
0x8003 0x0000 |
|
|
Touch the touch screen |
|
PENIRQ pulse |
I R 1 |
Read the number of times PENIRQ-bar has pulsed low |
|
count has increased |
T R P |
Read X,Y,Z1,Z2 conversion results |
0x8000 0x0000
0x8001 0x0000
0x8002 0x0000
0x8003 0x0000 |
|
|
Touch the touch screen |
|
PENIRQ pulse |
I R 1 |
Read the number of times PENIRQ-bar has pulsed low |
|
count has increased |
T R P |
Read X,Y,Z1,Z2 conversion results |
0x8000 0x0000
0x8001 0x0000
0x8002 0x0000
0x8003 0x0000 |
|
4) キーパッドと汎用入出力端子
以下の例はキーパッドをスキャンするためのDEMO1234 EXEプログラムの使い方とGPIO用のキースキャン端子の使い方を示しています。
4.1) キーパッドとGPIO端子の構成
GPIO制御レジスタによってC1-C4とR1-R4の各端子を入力、出力、またはキーパッドの部分のいずれかに設定します(MAX1233/MAX1234のデータシートの表26と27を参照してください)。さらに、GPIOプルアップディセーブルレジスタに書き込むことによって出力端子をオープンドレイン出力に設定することができます。
表14.キーパッドとGPIO設定の例
DEMO1234 Command |
Action |
SPI data in |
T W GC FFFF |
Keypad: none; GPIO outputs: C4,C3,C2,C1,R4,R3,R2,R1; GPIO inputs: none |
0x004f 0xffff |
T W GC FF00 |
Keypad: none; GPIO outputs: none; GPIO inputs: C4,C3,C2,C1,R4,R3,R2,R1 |
0x004f 0xff00 |
T W GC 0000 |
Keypad: (C4,C3,C2,C1) x (R4,R3,R2,R1); GPIO outputs: none; GPIO inputs: none |
0x004f 0x0000 |
T W GC C8C0 |
Keypad: (C2,C1) x (R3,R2,R1); GPIO outputs: C4,C3; GPIO input: R4 |
0x004f 0xc8c0 |
T W GP 4000 |
GPIO pullup disable: C3 |
0x004e 0x4000 |
4.2) GPIO端子への書込みと読取り
GPIOデータレジスタはGPIO入力端子を読み取り、GPIO出力端子に書き込みます。注:これらの例で、C3、C4、およびR4は端子名であり、部品名ではありません。
表15. GPIOの例
DEMO1234 Command |
Action |
SPI data in |
Verification |
T W GC C8C0 |
Keypad: (C2,C1) x (R3,R2,R1); GPIO outputs: C4,C3; GPIO input: R4 |
0x004f 0xc8c0 |
|
T W GP 4000 |
GPIO pullup disable: C3 |
0x004e 0x4000 |
|
|
Connect external resistor between C3 pin and DVDD |
|
|
|
Connect DVM to C4 pin |
|
|
T W GD 8000 |
GPIO write C4 = 1 |
0x000f 0x8000 |
C4 pin = high |
T W GD 0000 |
GPIO write C4 = 0 |
0x000f 0x0000 |
C4 pin = low |
T W GD 8000 |
GPIO write C4 = 1 |
0x000f 0x8000 |
C4 pin = high |
T W GD 0000 |
GPIO write C4 = 0 |
0x000f 0x0000 |
C4 pin = low |
|
Connect DVM to C3 pin |
|
|
T W GD 4000 |
GPIO write C3 = 1 |
0x000f 0x4000 |
C3 pin = high |
T W GD 0000 |
GPIO write C3 = 0 |
0x000f 0x0000 |
C3 pin = low |
T W GD 4000 |
GPIO write C3 = 1 |
0x000f 0x4000 |
C3 pin = high |
T W GD 0000 |
GPIO write C3 = 0 |
0x000f 0x0000 |
C3 pin = low |
|
Connect R4 pin to DVDD |
|
|
T R GD |
GPIO read |
0x800f 0x0000 |
Buffer = 0x0800 |
|
Connect R4 pin to GND |
|
|
T R GD |
GPIO read |
0x800f 0x0000 |
Buffer = 0x0000 |
4.3) キープレスの検出:自動スキャン
キーパッド制御レジスタはキーパッドを検出したら、自動的にキーパッドをスキャンするように設定することができます。
表16. キープレスコマンドシーケンス:自動スキャン
DEMO1234 Command |
Action |
SPI data in |
Verification |
|
Optional: connect oscilloscope to KEYIRQ-bar |
|
|
I C 0 3 |
Configure KEYIRQ-bar pulse accumulator: falling-edge trigger |
|
|
I 0 0 |
Reset the pulse accumulator |
|
|
I R 0 |
Read the number of times KEYIRQ-bar has pulsed low |
|
count = 0 |
T W GC 0000 |
Keypad: (C4,C3,C2,C1) x (R4,R3,R2,R1); GPIO outputs: none; GPIO inputs: none |
0x004f 0x0000 |
|
T W KC bf00 |
Wait for keypress; maximum debounce and hold times |
0x0041 0xbf00 |
|
|
Press and release R1C1 (key "1") |
|
KEYIRQ pulse |
I R 0 |
Read the number of times KEYIRQ-bar has pulsed low |
|
count has increased |
T R KB |
Read raw keypad result |
0x8004 0x0000 |
0x0001 = R1C1 key |
|
Press and release R2C2 (key "5") |
|
KEYIRQ pulse |
I R 0 |
Read the number of times KEYIRQ-bar has pulsed low |
|
count has increased |
T R KB |
Read raw keypad result |
0x8004 0x0000 |
0x0020 = R2C2 key |
|
Press and release R3C2 (key "8") |
|
KEYIRQ pulse |
I R 0 |
Read the number of times KEYIRQ-bar has pulsed low |
|
count has increased |
T R KB |
Read raw keypad result |
0x8004 0x0000 |
0x0040 = R3C2 key |
4.4) キーパッドの個別キーのマスクオフ
キーマスクレジスタとキーパッド2結果レジスタを用いて個別キーをマスクオフにします。マスクされたキーはKPDレジスタにスキャン入力されますが、キーパッド2結果レジスタには通知されません。
表17. キープレスコマンドシーケンス:個別キーのマスク解除
DEMO1234 Command |
Action |
SPI data in |
Verification |
T W GC 0000 |
Keypad: (C4,C3,C2,C1) x (R4,R3,R2,R1); GPIO outputs: none; GPIO inputs: none |
0x004f 0x0000 |
|
T W KC bf00 |
Wait for keypress; maximum debounce and hold times |
0x0041 0xbf00 |
|
T W KM 0020 |
Mask only R2C2 key |
0x0050 0x0020 |
|
|
Press and release R1C1 (key "1") |
|
|
T R KB |
Read raw keypad result |
0x8004 0x0000 |
0x0001 = R1C1 key |
T R K2 |
Read masked keypad result |
0x8011 0x0000 |
0x0001 = R1C1 key |
|
Press and release R2C2 (key "5") |
|
|
T R KB |
Read raw keypad result |
0x8004 0x0000 |
0x0020 = R2C2 key |
T R K2 |
Read masked keypad result |
0x8011 0x0000 |
0x0000 = no key |
|
Press and release R3C2 (key "8") |
|
|
T R KB |
Read raw keypad result |
0x8004 0x0000 |
0x0040 = R3C2 key |
T R K2 |
Read masked keypad result |
0x8011 0x0000 |
0x0040 = R3C2 key |
4.5) キーパッドのコラムのマスクオフ
キーコラムレジスタを用いて全体コラムをマスクオフにします。マスクされたコラムはスキャンされないため、KPDレジスタはそのコラムの中のキーを検出することはありません。
表18. キープレスコマンドシーケンス:キーコラム全体のマスクをオフにする
DEMO1234 Command |
Action |
SPI data in |
Verification |
T W GC 0000 |
Keypad: (C4,C3,C2,C1) x (R4,R3,R2,R1); GPIO outputs: none; GPIO inputs: none |
0x004f 0x0000 |
|
T W KC bf00 |
Wait for keypress; maximum debounce and hold times |
0x0041 0xbf00 |
|
T W KK 2000 |
Mask entire C2 column |
0x0051 0x2000 |
|
|
Press and release R1C1 (key "1") |
|
|
T R KB |
Read raw keypad result |
0x8004 0x0000 |
0x0001 = R1C1 key |
|
Press and release R2C2 (key "5") |
|
|
T R KB |
Read raw keypad result |
0x8004 0x0000 |
(previous value) |
|
Press and release R3C2 (key "8") |
|
|
T R KB |
Read raw keypad result |
0x8004 0x0000 |
(previous value) |
|
Press and release R2C3 (key "6") |
|
|
T R KB |
Read raw keypad result |
0x8004 0x0000 |
0x0200 = R2C3 key |
5) 電源消費の管理
表19. 電源オフコマンド
DEMO1234 Command |
Action |
SPI data in |
Verification |
T W AC C000 |
Power off ADC |
0x0040 0xc000 |
— |
T W AC 0300 |
Power off internal reference |
0x0040 0x0300 |
REF = not driven |
T W DC 8000 |
Disable DAC |
0x0042 0x8000 |
DACOUT = 0.0V |
T W KC C000 |
Power off keypad |
0x0041 0xc000 |
— |
6) メニューシステム
全体のソースコードはMINIQUSB+モジュールに接続する次に示すコンソールメニューシステムを実装します。
CmodComm試験プログラムのメインメニュー—接続の前に
A) adjust timing parameters
L) CmodLog... functions
C) connect
D) Debug Messages
X) exit
C (接続)コマンドへの応答
C
Hardware supports optimized native SMBus commands.
Board connected.
Got board banner: Maxim MINIQUSB V01.05.41 >
Firmware version is OK.
(configured for SPI auto-CS 4-byte mode) (SCLK=2MHz) ...
メインメニュー—接続した後で検証
T) Test the device
8) CmodP8Bus... functions
A) adjust timing parameters
L) CmodLog... functions
P) CmodPin... functions
S) CmodSpi... functions
M) CmodSMBus... functions
$) CmodCommStringWrite list of hex codes
R) CmodBoardReset
D) Disconnect
テストメニューコマンドー接続した後で検証
R) Read register
W) Write register
M0) measure no measurement; configure reference
M1) measure X,Y
M2) measure X,Y,Z1,Z2
M3) measure X
M4) measure Y
M5) measure Z1,Z2
M6) measure BAT1/4
M7) measure BAT2/4
M8) measure AUX1
M9) measure AUX2
MA) measure TEMP1
MB) measure BAT1/4,BAT2/4,AUX1,AUX2,TEMP1,TEMP2
MC) measure TEMP1,TEMP2
MD) no measurement; drive Y+,Y-
ME) no measurement; drive X+,X-
MF) no measurement; drive Y+,X-
.) Exit this menu
6.1) レジスタ読取り/書込みコマンド
表20. レジスタのMnemonicの読取り
DEMO1234 Command |
Mnemonic |
SPI data in |
T R A1 |
Test Read AUX1 register |
0x8007 0x0000 |
T R A2 |
Test Read AUX2 register |
0x8008 0x0000 |
T R AC |
Test Read ADC_control register |
0x8040 0x0000 |
T R AX |
Test Read X register |
0x8000 0x0000 |
T R AY |
Test Read Y register |
0x8001 0x0000 |
T R AZ1 |
Test Read Z1 register |
0x8002 0x0000 |
T R AZ2 |
Test Read Z2 register |
0x8003 0x0000 |
T R B1 |
Test Read BAT1 register |
0x8005 0x0000 |
T R B2 |
Test Read BAT2 register |
0x8006 0x0000 |
T R DC |
Test Read DAC_control register |
0x8042 0x0000 |
T R DD |
Test Read DAC_data register |
0x800b 0x0000 |
T R GC |
Test Read GPIO_control register |
0x804f 0x0000 |
T R GD |
Test Read GPIO_data register |
0x800f 0x0000 |
T R GP |
Test Read GPIO_pullup register |
0x804e 0x0000 |
T R K1 |
Test Read KPDATA1 register |
0x8010 0x0000 |
T R K2 |
Test Read KPDATA2 register |
0x8011 0x0000 |
T R KB |
Test Read KPD register |
0x8004 0x0000 |
T R KC |
Test Read KEY_control register |
0x8041 0x0000 |
T R KK |
Test Read KPCOLMASK register |
0x8051 0x0000 |
T R KM |
Test Read KPKEYMASK register |
0x8050 0x0000 |
T R T1 |
Test Read TEMP1 register |
0x8009 0x0000 |
T R T2 |
Test Read TEMP2 register |
0x800a 0x0000 |
表21. レジスタのMnemonicへの書込み
DEMO1234 Command |
Mnemonic |
SPI data in |
T W AC hexValue |
Test Write ADC_control register |
0x0040 hexValue |
T W DC hexValue |
Test Write DAC_control register |
0x0042 hexValue |
T W DD hexValue |
Test Write DAC_data register |
0x000b hexValue |
T W GC hexValue |
Test Write GPIO_control register |
0x004f hexValue |
T W GD hexValue |
Test Write GPIO_data register |
0x000f hexValue |
T W GP hexValue |
Test Write GPIO_pullup register |
0x004e hexValue |
T W KC hexValue |
Test Write KEY_control register |
0x0041 hexValue |
T W KK hexValue |
Test Write KPCOLMASK register |
0x0051 hexValue |
T W KM hexValue |
Test Write KPKEYMASK register |
0x0050 hexValue |
表22.タッチスクリーン測定コマンドシーケンス
DEMO1234 Command |
Action (Triggered by A/D3210 Bits) |
SPI data in Sequence |
T M1 |
Measure X,Y |
0x0040 0x0701
0x8000 0x0000
0x8001 0x0000 |
T M2 |
Measure X,Y,Z1,Z2 |
0x0040 0x0b01
0x8000 0x0000
0x8001 0x0000
0x8002 0x0000
0x8003 0x0000 |
T M3 |
Measure X |
0x0040 0x0f01
0x8000 0x0000 |
T M4 |
Measure Y |
0x0040 0x1301
0x8001 0x0000 |
T M5 |
Measure Z1,Z2 |
0x0040 0x1701
0x8002 0x0000
0x8003 0x0000 |
T MD |
No measurement; drive Y+,Y- |
0x0040 0x3701 |
T ME |
No measurement; drive X+,X- |
0x0040 0x3b01 |
T MF |
No measurement; drive Y+,X- |
0x0040 0x3f01 |
6.2) 割込みおよびステータス端子コマンド
表23. 端子状態読取りコマンド
DEMO1234 Command |
Action |
SPI data in |
P R 5 |
Read KEYIRQ-bar pin status |
N/A |
I C 0 3 |
Enable KEYIRQ-bar falling-edge trigger pulse accumulator |
N/A |
I C 0 1 |
Enable KEYIRQ-bar rising-edge trigger pulse accumulator |
N/A |
I C 0 0 |
Disable KEYIRQ-bar pulse accumulator |
N/A |
I R 0 |
Read the number of times KEYIRQ-bar has pulsed low |
N/A |
I 0 0 |
Clear the KEYIRQ-bar pulse accumulator |
N/A |
P R 6 |
Read PENIRQ-bar pin status |
N/A |
I C 1 3 |
Enable PENIRQ-bar falling-edge trigger pulse accumulator |
N/A |
I C 1 1 |
Enable PENIRQ-bar rising-edge trigger pulse accumulator |
N/A |
I C 1 0 |
Disable PENIRQ-bar pulse accumulator |
N/A |
I R 1 |
Read the number of times PENIRQ-bar has pulsed low |
N/A |
I 0 1 |
Clear the PENIRQ-bar pulse accumulator |
N/A |
P R 7 |
Read BUSY-bar pin status |
N/A |
6.3) 更新されたMINIQUSB+ファームウェアに追加されたコマンド
表24. 更新されたMINIQUSB+ファームウェア01.05.40で使用可能なSPIコマンド
DEMO1234 Command |
Action |
CPOL |
CPHA |
CS-Bar Control |
AF Length |
S C L0 |
Configure SPI for CPOL=0 |
0 |
— |
GPIO-K9 |
1 byte |
S C L1 |
Configure SPI for CPOL=1 |
1 |
— |
GPIO-K9 |
1 byte |
S C A0 |
Configure SPI for CPHA=0 |
— |
0 |
GPIO-K9 |
1 byte |
S C A1 |
Configure SPI for CPHA=1 |
— |
1 |
GPIO-K9 |
1 byte |
S C C0 |
Configure SPI for 8-bit |
— |
— |
GPIO-K9 |
1 byte |
S C C1 |
Configure SPI for 8-bit auto-CS-bar |
— |
— |
Automatic |
1 byte |
S C C2 |
Configure SPI for 16-bit auto-CS-bar |
— |
— |
Automatic |
2 bytes |
S C C3 |
Configure SPI for 24-bit auto-CS-bar |
— |
— |
Automatic |
3 bytes |
S C C4 |
Configure SPI for 32-bit auto-CS-bar |
— |
— |
Automatic |
4 bytes |
$ 2 AE 00 |
Configure SPI for 8-bit |
0 |
0 |
GPIO-K9 |
1 byte |
$ 2 AE 01 |
Configure SPI for 8-bit |
0 |
1 |
GPIO-K9 |
1 byte |
$ 2 AE 02 |
Configure SPI for 8-bit |
1 |
0 |
GPIO-K9 |
1 byte |
$ 2 AE 03 |
Configure SPI for 8-bit |
1 |
1 |
GPIO-K9 |
1 byte |
$ 2 AE 08 |
Configure SPI for 8-bit auto-CS-bar |
0 |
0 |
Automatic |
1 byte |
$ 2 AE 09 |
Configure SPI for 8-bit auto-CS-bar |
0 |
1 |
Automatic |
1 byte |
$ 2 AE 0A |
Configure SPI for 8-bit auto-CS-bar |
1 |
0 |
Automatic |
1 byte |
$ 2 AE 0B |
Configure SPI for 8-bit auto-CS-bar |
1 |
1 |
Automatic |
1 byte |
$ 2 AE 18 |
Configure SPI for 16-bit auto-CS-bar |
0 |
0 |
Automatic |
2 bytes |
$ 2 AE 19 |
Configure SPI for 16-bit auto-CS-bar |
0 |
1 |
Automatic |
2 bytes |
$ 2 AE 1A |
Configure SPI for 16-bit auto-CS-bar |
1 |
0 |
Automatic |
2 bytes |
$ 2 AE 1B |
Configure SPI for 16-bit auto-CS-bar |
1 |
1 |
Automatic |
2 bytes |
$ 2 AE 28 |
Configure SPI for 24-bit auto-CS-bar |
0 |
0 |
Automatic |
3 bytes |
$ 2 AE 29 |
Configure SPI for 24-bit auto-CS-bar |
0 |
1 |
Automatic |
3 bytes |
$ 2 AE 2A |
Configure SPI for 24-bit auto-CS-bar |
1 |
0 |
Automatic |
3 bytes |
$ 2 AE 2B |
Configure SPI for 24-bit auto-CS-bar |
1 |
1 |
Automatic |
3 bytes |
$ 2 AE 38 |
Configure SPI for 32-bit auto-CS-bar |
0 |
0 |
Automatic |
4 bytes |
$ 2 AE 39 |
Configure SPI for 32-bit auto-CS-bar |
0 |
1 |
Automatic |
4 bytes |
$ 2 AE 3A |
Configure SPI for 32-bit auto-CS-bar |
1 |
0 |
Automatic |
4 bytes |
$ 2 AE 3B |
Configure SPI for 32-bit auto-CS-bar |
1 |
1 |
Automatic |
4 bytes |
$ 2 AF xx |
Perform an 8-bit SPI transfer (CS-bar = GPIO or auto-CS-bar = 1-byte) |
— |
— |
— |
1 byte |
$ 3 AF xx xx |
Perform a 16-bit SPI transfer (requires auto-CS-bar = 2-byte mode) |
— |
— |
— |
2 bytes |
$ 4 AF xx xx xx |
Perform a 24-bit SPI transfer (requires auto-CS-bar = 3-byte mode) |
— |
— |
— |
3 bytes |
$ 5 AF xx xx xx xx |
Perform a 32-bit SPI transfer (requires auto-CS-bar = 4-byte mode) |
— |
— |
— |
4 bytes |
$ 2 F9 0 |
Drive CS-bar pin low |
— |
— |
GPIO-K9 |
— |
$ 2 F9 1 |
Drive CS-bar pin high |
— |
— |
GPIO-K9 |
— |
表25. 更新されたMINIQUSB+ファームウェア01.05.41の割込みパルスアキュムレータコマンド
DEMO1234 Command |
Action |
Int |
GPIO Input |
Firmware Command |
$ 2 C3 00 |
Query which of the C3 commands are supported; the return value is a 2-byte bitmap of commands C300 to C30F, msb first |
— |
— |
C3 00 |
I Q 0 |
Query configuration of pulse accumulator |
INT0 |
GPIO-K5 |
C3 01 00 |
I Q 1 |
Query configuration of pulse accumulator |
INT1 |
GPIO-K6 |
C3 01 01 |
I Q 2 |
Query configuration of pulse accumulator |
INT2 |
GPIO-K7 |
C3 01 02 |
I Q 3 |
Query configuration of pulse accumulator |
INT3 |
GPIO-K8 |
C3 01 03 |
I C 0 0 |
Configure pulse accumulator: disable interrupt |
INT0 |
GPIO-K5 |
C3 02 00 00 |
I C 1 0 |
Configure pulse accumulator: disable interrupt |
INT1 |
GPIO-K6 |
C3 02 01 00 |
I C 2 0 |
Configure pulse accumulator: disable interrupt |
INT2 |
GPIO-K7 |
C3 02 02 00 |
I C 3 0 |
Configure pulse accumulator: disable interrupt |
INT3 |
GPIO-K8 |
C3 02 03 00 |
I C 0 1 |
Configure pulse accumulator: rising-edge trigger |
INT0 |
GPIO-K5 |
C3 02 00 01 |
I C 1 1 |
Configure pulse accumulator: rising-edge trigger |
INT1 |
GPIO-K6 |
C3 02 01 01 |
I C 2 1 |
Configure pulse accumulator: rising-edge trigger |
INT2 |
GPIO-K7 |
C3 02 02 01 |
I C 3 1 |
Configure pulse accumulator: rising-edge trigger |
INT3 |
GPIO-K8 |
C3 02 03 01 |
I C 0 3 |
Configure pulse accumulator: falling-edge trigger |
INT0 |
GPIO-K5 |
C3 02 00 03 |
I C 1 3 |
Configure pulse accumulator: falling-edge trigger |
INT1 |
GPIO-K6 |
C3 02 01 03 |
I C 2 3 |
Configure pulse accumulator: falling-edge trigger |
INT2 |
GPIO-K7 |
C3 02 02 03 |
I C 3 3 |
Configure pulse accumulator: falling-edge trigger |
INT3 |
GPIO-K8 |
C3 02 03 03 |
I R 0 |
Read pulse accumulator |
INT0 |
GPIO-K5 |
C3 03 00 |
I R 1 |
Read pulse accumulator |
INT1 |
GPIO-K6 |
C3 03 01 |
I R 2 |
Read pulse accumulator |
INT2 |
GPIO-K7 |
C3 03 02 |
I R 3 |
Read pulse accumulator |
INT3 |
GPIO-K8 |
C3 03 03 |
I 0 0 |
Clear pulse accumulator |
INT0 |
GPIO-K5 |
C3 04 00 |
I 0 1 |
Clear pulse accumulator |
INT1 |
GPIO-K6 |
C3 04 01 |
I 0 2 |
Clear pulse accumulator |
INT2 |
GPIO-K7 |
C3 04 02 |
I 0 3 |
Clear pulse accumulator |
INT3 |
GPIO-K8 |
C3 04 03 |
I S 0 xx |
Set pulse accumulator count xx = 0 to 255 |
INT0 |
GPIO-K5 |
C3 05 00 xx |
I S 1 xx |
Set pulse accumulator count xx = 0 to 255 |
INT1 |
GPIO-K6 |
C3 05 01 xx |
I S 2 xx |
Set pulse accumulator count xx = 0 to 255 |
INT2 |
GPIO-K7 |
C3 05 02 xx |
I S 3 xx |
Set pulse accumulator count xx = 0 to 255 |
INT3 |
GPIO-K8 |
C3 05 03 xx |
7) 結論
これらの例では簡単なコンソールベースのC++プログラムを用いて測定およびハードウェアを制御するためのMAX1233/MAX1234の主な機能ブロックのおのおのの使用方法を簡単に説明しました。さらに詳細はMAX1233/MAX1234のデータシートを調べてください。
3Mは3M Companyの登録商標です。
SPIはMotorola, Inc.の商標です。
WindowsはMicrosoft Corp.の登録商標です。
フィードバックをお寄せください。 内容に満足されましたか、あるいは満足されていませんか?もっと良いページにできると思いますか?あるいは、単なるコメントでも結構です。フィードバックをお待ちしています。—マキシムはお客様からいただく訂正、提案を元に改善していきます。
このページを評価し、フィードバックを送信する。
自動アップデート
お客様が関心のある分野でアプリケーションノートが新規に掲載された際に自動通知Eメールの受信を希望する場合は、EE-Mail™にご登録ください。
| その他の情報 | |
APP 4125: Feb 20, 2008
|
|
|
|
ダウンロード、PDFフォーマット (139kB)
AN4125,
AN 4125,
APP4125,
Appnote4125,
Appnote 4125
|
|