新聞中心

        EEPW首頁 > 模擬技術(shù) > 設(shè)計應(yīng)用 > MAX1233/MAX1234觸摸屏控制器入門

        MAX1233/MAX1234觸摸屏控制器入門

        作者: 時間:2012-03-17 來源:網(wǎng)絡(luò) 收藏
        6Read PENIRQ-bar pin statusPENIRQ = 1Touch the touch screen
        P R 6
        Read PENIRQ-bar pin statusPENIRQ = 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 statusPENIRQ = 1Touch and hold the touch screen
        P R 6
        Read PENIRQ-bar pin statusPENIRQ = 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 statusPENIRQ = 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 statusPENIRQ = 0Release the touch screen
        P R 6
        Read PENIRQ-bar pin statusPENIRQ = 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 statusPENIRQ = 1

        3.5) 檢測操作:自動掃描

        在檢測操作,配置,自動數(shù)字化的接觸位置時,寫入寄存器0x40 (ADC控制),其PENSTS=1,ADSTS=0 (請參考/數(shù)據(jù)資料的表6)。第一次接觸屏幕時,/PENIRQ信號暫時變?yōu)榈碗娖剑⒃谧x取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 lowcount = 0
        T W AC 8bff
        Wait for touch, then scan X,Y,Z1,Z2
        0x0040 0x8bff
        Touch the touch screenPENIRQ pulse
        I R 1
        Read the number of times PENIRQ-bar has pulsed lowcount has increased
        T R P
        Read X,Y,Z1,Z2 conversion results
        0x8000 0x0000

        0x8001 0x0000

        0x8002 0x0000

        0x8003 0x0000
        Touch the touch screenPENIRQ pulse
        I R 1
        Read the number of times PENIRQ-bar has pulsed lowcount has increased
        T R P
        Read X,Y,Z1,Z2 conversion results
        0x8000 0x0000

        0x8001 0x0000

        0x8002 0x0000

        0x8003 0x0000
        Touch the touch screenPENIRQ pulse
        I R 1
        Read the number of times PENIRQ-bar has pulsed lowcount 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引腳分別配置為輸入、輸出或者是鍵盤的一部分(請參考/數(shù)據(jù)資料的表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數(shù)據(jù)寄存器讀取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

          關(guān)鍵詞: MAX1233 MAX1234 觸摸屏 控制器

          評論


          相關(guān)推薦

          技術(shù)專區(qū)

          主站蜘蛛池模板: 昌邑市| 上高县| 宣化县| 焦作市| 乌兰察布市| 涡阳县| 云龙县| 西乌| 岱山县| 丰顺县| 米脂县| 拜泉县| 合川市| 石首市| 从江县| 合阳县| 铜川市| 忻城县| 濮阳市| 朝阳县| 台北县| 班玛县| 香格里拉县| 新平| 武宣县| 肃宁县| 凤翔县| 芜湖县| 石嘴山市| 惠来县| 梨树县| 蓬安县| 无锡市| 昭通市| 伽师县| 三门县| 乐安县| 西昌市| 白沙| 观塘区| 读书|
              <strike id="qqoca"><input id="qqoca"></input></strike>
              <fieldset id="qqoca"></fieldset>
            • <ul id="qqoca"></ul>