新聞中心

        EEPW首頁 > 模擬技術 > 設計應用 > 電腦鍵盤工作原理

        電腦鍵盤工作原理

        作者: 時間:2012-01-25 來源:網絡 收藏
        ines are high (open-collector).
        總線空閑時,兩條線都是高電平(集電極開路)。

        This is the only state where the keyboard/mouse is allowed begin transmitting data.
        在這種狀態下,/鼠標才允許開始傳輸數據。

        The host has ultimate control over the bus and may inhibit communication at any time by pulling the Clock line low.
        主機對總線有最高的控制權,在任何時候通過將時鐘線拉低就可以禁止通信。

        The device always generates the clock signal.
        時鐘信號總是由設備端生成的。

        If the host wants to send data, it must first inhibit communication from the device by pulling Clock low.
        如果主機想發送數據,它必須先將時鐘拉低來禁止來自設備端的通信。

        The host then pulls Data low and releases Clock.
        然后主機再拉低數據線,釋放時鐘。 注釋:釋放時鐘,就是再恢復時鐘為高

        This is the "Request-to-Send" state and signals the device to start generating clock pulses.
        這就是"請求發送(Request-to-Send)"狀態,提示 設備端 開始生成時鐘信號。

        Summary: Bus States
        Data = high, Clock = high: Idle state.
        Data = high, Clock = low: Communication Inhibited.
        Data = low, Clock = high: Host Request-to-Send
        總結:總線狀態
        數據 0 1

        0 ---------通信禁止-----------
        時鐘
        1 主機要求發送 總線空閑


        The clock and data pins are bidirectional, open-collector
        signals that are pulled to 5 V by pullup resistors in the keyboard.
        時鐘和數據 引腳時 雙向 集電極開路的信號,可以被內部的上拉電阻 拉高到5V


        Data sent from the device to the host is read on the falling edge of the clock signal; data sent from the host to the device is read on the rising edge.
        從設備發送給主機的數據時在時鐘信號的下降沿讀取的;從主機發給設備的數據是在上升沿讀取的。


        The clock frequency must be in the range 10 - 16.7 kHz. This means clock must be high for 30 - 50 microseconds and low for 30 - 50 microseconds..
        時鐘頻率必須在10-16.7KHz之間。這意味著時鐘必須是 高電平持續30~50毫秒,低電平持續
        30~50毫秒。


        If you're designing a keyboard, mouse, or host emulator, you should modify/sample the Data line in the middle of each cell. I.e. 15 - 25 microseconds after the appropriate clock transition.
        如果你設計一個 鼠標 或者 主機模擬器,你必須 在每個單元的中間時刻 (也就是,在時鐘跳變之后的15~25毫秒后) 修改/取樣數據線.


        Again, the keyboard/mouse always generates the clock signal, but the host always has ultimate control over communication.
        重復一遍,鍵盤/鼠標 總是 生成時鐘信號, 而 主機 控制著整個通信過程。


        Timing is absolutely crucial. Every time quantity I give in this article must be followed exactly.
        時序是非常重要的。在本文中給出的時間數必須嚴格遵循。


        設備發送數據到主機

        The Data and Clock lines are both open collector.
        數據和時鐘線都是集電極開路的。

        A resistor is connected between each line and +5V, so the idle state of the bus is high.
        在+5V 和每根線 之間連接著一個電阻,所以 總線的空閑狀態 是 高電平。


        When the keyboard or mouse wants to send information, it first checks the Clock line to make sure it's at a high logic level.
        當鍵盤或者鼠標想發送數據時,它首先必須檢查時鐘線 ,確認它處于高電平。

        If it's not, the host is inhibiting communication and the device must buffer any to-be-sent data until the host releases Clock.
        如果不是,主機禁止通信,設備必須緩沖任何要發送的數據,直到主機釋放時鐘。


        The Clock line must be continuously high for at least 50 microseconds before the device can begin to transmit its data.
        在設備開始傳輸數據之前,時鐘線 必須持續為 高電平的 時間 必須 至少50ms


        The keyboard/mouse writes a bit on the Data line when Clock is high, and it is read by the host when Clock is low.
        當時鐘為高電平時,鍵盤/鼠標寫一個bit到數據線上;當時鐘為低電平時,主機從數據線上讀取這個bit 。

        電腦鍵盤工作原理

        The Data line changes state when Clock is high and that data is valid when Clock is low.

        當時鐘位高時,數據線 改變狀態;
        當時鐘位低時,(數據線上的)數據是有效的。




        The clock frequency is 10-16.7 kHz.
        時鐘頻率是10-16.7KHz

        The time from the rising edge of a clock pulse to a Data transition must be at least 5 microseconds.
        從時鐘脈沖的上升沿到數據跳變 的時間必須至少 5ms

        The time from a data transition to the falling edge of a clock pulse must be at least 5 microseconds and no greater than 25 microseconds.
        從數據跳變 到時鐘脈沖的下降沿 必須 至少5ms,且不超過25ms

        The host may inhibit communication at any time by pulling the Clock line low for at least 100 microseconds.

        主機可在任何時間禁止通信,只需要將時鐘線下拉位低電平超過100ms即可


        If a transmission is inhibited before the 11th clock pulse, the device must abort the current transmission and prepare to retransmit the current "chunk" of data when host releases Clock.
        如果在第11個脈沖時禁止傳輸,設備必須中止當前的傳輸,準備重新傳輸當前的數據"chunk(塊)"當主機釋放時鐘時


        A "chunk" of data could be a make code, break code, device ID, mouse movement packet, etc.
        一個數據塊可能時 通碼,斷碼,設備ID,鼠標移動包 等等。

        For example, if a keyboard is interrupted while sending the second byte of a two-byte break code, it will need to retransmit both bytes of that break code, not just the one that was interrupted.
        舉個例子,如果當發送 一個兩字節斷碼的 第2個字節時,鍵盤被中斷,它將需要重新發送
        此斷碼的兩個字節,而不僅僅時被中斷掉的那個字節。


        If the host pulls clock low before the first high-to-low clock transition, or after the falling edge of the last clock pulse, the keyboard/mouse does not need to retransmit any data.
        如果在第一個 高->低 時鐘跳變 時,(或者在 最后一個時鐘脈沖的下降沿 之后)主機將時鐘拉低,鍵盤/鼠標 不必重新傳輸任何數據。


        However, if new data is created that needs to be transmitted, it will have to be buffered until the host releases Clock.
        但是,如果新產生的數據需要傳輸,它必須將數據緩沖,知道主機釋放時鐘。


        Keyboards have a 16-byte buffer for this purpose. If more than 16 bytes worth of keystrokes occur, further keystrokes will be ignored until there's room in the buffer.
        鍵盤有一個16字節的緩沖區。如果有超過16個字節的擊鍵存在,更多的擊鍵將被忽略。直到
        緩沖區有空地。


        Mice only store the most current movement packet for transmission.
        鼠標只能緩沖最近的一個要傳輸的(移動)數據包。

        電腦鍵盤工作原理


        時間參數 最大值/最小值
        T1數據跳變到時鐘的下降沿 5/25 us
        T2時鐘的上升沿 到 數據跳變 5/T4 - 5 us
        T3時鐘inactive 30-50 us
        T4時鐘active 30-50 us
        T5 >0/50 us



        Time to auxiliary device inhibit after clock 11 to ensure the auxiliary device does not start another transmission


        The auxiliary device checks the 'clock' l

        DIY機械鍵盤相關社區:機械鍵盤DIY




        關鍵詞: 電腦 鍵盤 工作原理

        評論


        相關推薦

        技術專區

        關閉
        主站蜘蛛池模板: 新巴尔虎右旗| 巫溪县| 岳阳市| 达州市| 洮南市| 将乐县| 扶沟县| 莱州市| 交城县| 富锦市| 司法| 都安| 玛沁县| 鹿邑县| 富裕县| 宁蒗| 胶南市| 江都市| 屏边| 炎陵县| 尉犁县| 虞城县| 纳雍县| 太仆寺旗| 黔江区| 尚志市| 建瓯市| 内江市| 大宁县| 土默特右旗| 始兴县| 临沭县| 郑州市| 石城县| 安庆市| 海门市| 科技| 专栏| 石阡县| 达州市| 信丰县|