CN102955561B - 基于嵌入式处理器的模拟ps/2接口实现系统及实现方法 - Google Patents

基于嵌入式处理器的模拟ps/2接口实现系统及实现方法 Download PDF

Info

Publication number
CN102955561B
CN102955561B CN201110253313.4A CN201110253313A CN102955561B CN 102955561 B CN102955561 B CN 102955561B CN 201110253313 A CN201110253313 A CN 201110253313A CN 102955561 B CN102955561 B CN 102955561B
Authority
CN
China
Prior art keywords
interface
foot
flush bonding
bonding processor
data
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.)
Active
Application number
CN201110253313.4A
Other languages
English (en)
Other versions
CN102955561A (zh
Inventor
徐畅
胡胜发
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Guangzhou Ankai Microelectronics Co.,Ltd.
Original Assignee
Anyka Guangzhou Microelectronics Technology Co Ltd
Priority date (The priority date 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 date listed.)
Filing date
Publication date
Application filed by Anyka Guangzhou Microelectronics Technology Co Ltd filed Critical Anyka Guangzhou Microelectronics Technology Co Ltd
Priority to CN201110253313.4A priority Critical patent/CN102955561B/zh
Publication of CN102955561A publication Critical patent/CN102955561A/zh
Application granted granted Critical
Publication of CN102955561B publication Critical patent/CN102955561B/zh
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Abstract

本发明涉及计算机设备的输入输出接口,具体公开一种基于嵌入式处理器的模拟PS/2接口实现系统及实现方法。该系统包括装配嵌入式处理器的主机、带有PS/2接口的PS/2设备,嵌入式处理器带有UART口,UART口和PS/2口电性连接,其中:UART口的发送脚连接PS/2接口的时钟脚;UART口的接收脚连接PS/2接口的数据脚。该方法包括:主机发送数据时,通过主机嵌入式处理器中UART口发送脚采集来自PS/2设备中PS/2接口时钟脚的时钟信号,同时通过UART口接收脚同步输出数据信号至PS/2接口数据脚;主机接收数据时,通过UART口接收脚直接输入来自PS/2接口数据脚的数据信号,同时使来自PS/2接口时钟脚的时钟信号无效。通过UART口与PS/2接口通信,嵌入式处理器的模拟PS/2接口,既不增加芯片成本,也不影响系统性能。

Description

基于嵌入式处理器的模拟PS/2接口实现系统及实现方法
技术领域
本发明涉及计算机设备的输入输出接口,特别一种基于嵌入式处理器的模拟PS/2接口实现系统及实现方法。
背景技术
PS/2设备接口用于许多现代的鼠标和键盘,它是由IBM开发并且最初出现在IBM技术参考手册里。图1示出一种5-PINPS/2接口的定义,其中1为时钟脚,2为数据脚,3脚保留,4接5V电源正,5脚接地。在嵌入式处理器领域,要支持该PS/2接口要么增加单独的控制器驱动,要么采用GPIO(GeneralPurposeInputOutput,通用输入/输出)来模拟。对于前者,芯片成本上会有一定的增加;而对于后者,则提高软件复杂度,且在一定程度上降低了系统性能。
发明内容
有鉴于此,本发明的目的在于,在既不增加芯片成本也不影响系统性能的基础上,提供一种基于嵌入式处理器的模拟PS/2接口实现系统及实现方法。
为解决以上技术问题,本发明的技术方案是,一种基于嵌入式处理器的模拟PS/2接口实现系统,包括装配嵌入式处理器的主机、带有PS/2接口的PS/2设备,嵌入式处理器带有UART口,UART口和PS/2口电性连接,其中:UART口的发送脚连接PS/2接口的时钟脚;UART口的接收脚连接PS/2接口的数据脚。
较优地,UART口的电源脚连接PS/2接口的电源脚。
较优地,UART口的接地脚连接PS/2接口的接地脚。
较优地,PS/2设备为输入设备。
可选地,输入设备为键盘。
可选地,输入设备为鼠标。
较优地,主机设置有UART控制器,用于完成数据的采集处理。
相应地,本发明还提供一种基于嵌入式处理器的模拟PS/2接口实现方法,包括:
主机发送数据时,通过主机嵌入式处理器中UART口发送脚采集来自PS/2设备中PS/2接口时钟脚的时钟信号,同时通过UART口接收脚同步输出数据信号至PS/2接口数据脚;
主机接收数据时,通过UART口接收脚直接输入来自PS/2接口数据脚的数据信号,同时使来自PS/2接口时钟脚的时钟信号无效。
较优地,通过UART控制器完成数据采集处理。
较优地,从UART控制器的FIFO内获取数据,以进行后续处理。
与现有技术相比,本发明通过UART口与PS/2接口通讯,可以简化软件设计和降低系统运行损耗,还可以最大程度保证数据采集的正确性。特别地,数据采集过程基本都是UART控制器来完成,软件干预较少;而且由于硬件控制器自身的精密性,不会发生数据采集错误。因此,采用这种模拟接口,既不会增加芯片成本,也不会影响系统性能的要求。
附图说明
图1是5-PINPS/2接口的定义图;
图2是PS/2接口的信号时序图;
图3是本发明基于嵌入式处理器的模拟PS/2接口实现系统的硬件框图;
图4是本发明基于嵌入式处理器的模拟PS/2接口实现方法的流程图。
具体实施方式
本发明的核心思想是提出一种新的方式来实现PS/2接口,具体是通过UART口与PS/2的连接来实现的,由此保证既不增加芯片成本也不会对系统性能带来任何影响。
所谓UART(UniversalAsynchronousReceiver/Transmitter,通用异步接收/发送装置),为一种用于控制计算机与串行设备的芯片,提供了RS-232C数据终端设备接口;同时,作为接口的一部分,还可将由计算机内部传送过来的并行数据转换为输出的串行数据流。
参见图2,表示PS/2接口的信号时序图,分别示出时钟信号CLOCK和数据信号DATA。从该图可以看出,DATA信号和UART的发送接收信号时序格式完全一致:都有起始位和停止位且起始位为低,停止位为高;都有奇偶校验位,且8位数据都是低位在前。因此,采用UART接口的接收脚UART_RX和PS/2接口数据脚DATA相连,在HOST接收数据时完全可以通过UART控制器来完成数据采集;同时,依照CLOCK信号同步数据后,也可以相应进行发送。
由于常见的嵌入式处理器都带有UART口,由此通过该UART接口就可以轻松模拟嵌入式处理器的PS/2接口。这既不增加芯片成本,也不会对系统性能带来任何影响。
为了使本领域的技术人员更好地理解本发明的技术方案,下面结合附图和具体实施例对本发明作进一步的详细说明。
参见图3,表示本发明基于嵌入式处理器的模拟PS/2接口实现系统的硬件结构。该系统包括装配嵌入式处理器的主机HOST、带有PS/2接口的PS/2设备,其中嵌入式处理器的UART口和PS/2口电性连接,具体是:UART口的发送脚UART_TX接PS/2接口的时钟脚CLOCK;UART口的接收脚UART_RX连接PS/2接口的数据脚;UART口的电源脚POWER连接PS/2接口的+5V电源脚;UART口的接地脚GND连接PS/2接口的接地脚GND。
因为连接的PS/2设备一般都是输入设备,如鼠标、键盘等。也就是说HOST主机通常都是处于数据接收状态,只在需要对设备完成初始化等操作时才处于发送状态。所以,采用该连接方式可以由UART控制器来完成数据的采集处理,此时软件只需要从UART控制器的FIFO内获得数据即可,从而极大地简化了软件设计和降低系统运行损耗。
参见图4,表示本发明基于嵌入式处理器的模拟PS/2接口实现方法的通信流程。首先判断通信状态(步骤S401),然后作出相应方式处理,其中:在HOST发送数据时,把UART_TX做为GPIO来采集CLOCK信号,同时通过UART_RX做为GPIO来同步输出DATA信号(步骤S402);在HOST接收数据时,则直接通过UART_RX来输入DATA信号,此时CLOCK信号无效(步骤S403)。
较优的,通过UART控制器完成数据采集处理,具体是从UART控制器的FIFO(FirstInFirstOut,为一种先进先出的数据缓存器)内获取数据,以便进行后续的其它处理。
如前所述,现有技术在模拟PS/2接口时,通常都采用GPIO来进行模拟采集,如果在相对简单的嵌入式系统中尚可,但如果在稍微复杂的系统中,频繁的PS/2通信则会极大的降低系统性能,并且还容易出现数据采集错误。
与之不同,本发明通过UART口模拟PS/2接口。其主要有益效果是可以简化软件设计和降低系统运行损耗,可以最大程度地保证数据采集的正确性。这是因为采集过程基本都是UART控制器来完成,软件干预较少,而且由于硬件控制器自身的精密性,不会发生数据采集错误。
以上仅是本发明的优选实施方式,其关键在于实现PS/2接口的硬件结构和实现方法。应当指出的是,上述优选实施方式不应视为对本发明的限制,本发明的保护范围应当以权利要求所限定的范围为准。对于本技术领域的普通技术人员来说,在不脱离本发明的精神和范围内,还可以做出若干改进和润饰,这些改进和润饰也应视为本发明的保护范围。

Claims (8)

1.一种基于嵌入式处理器的模拟PS/2接口实现系统,包括装配嵌入式处理器的主机、带有PS/2接口的PS/2设备,嵌入式处理器带有UART口,其特征在于,UART口和PS/2口电性连接,其中:UART口的发送脚连接PS/2接口的时钟脚;UART口的接收脚连接PS/2接口的数据脚;UART口的电源脚连接PS/2接口的电源脚;UART口的接地脚连接PS/2接口的接地脚;
主机发送数据时,通过主机嵌入式处理器中UART口发送脚采集来自PS/2设备中PS/2接口时钟脚的时钟信号;
主机接收数据时,通过UART口接收脚直接输入来自PS/2接口数据脚的数据信号。
2.如权利要求1所述的基于嵌入式处理器的模拟PS/2接口实现系统,其特征在于,PS/2设备为输入设备。
3.如权利要求2所述的基于嵌入式处理器的模拟PS/2接口实现系统,其特征在于,输入设备为键盘。
4.如权利要求2所述的基于嵌入式处理器的模拟PS/2接口实现系统,其特征在于,输入设备为鼠标。
5.如权利要求1~4任一项所述的基于嵌入式处理器的模拟PS/2接口实现系统,其特征在于,主机设置有UART控制器,用于完成数据的采集处理。
6.一种基于嵌入式处理器的模拟PS/2接口实现方法,其特征在于,应用于权利要求1~4中任一项所述的基于嵌入式处理器的模拟PS/2接口实现系统中,所述基于嵌入式处理器的模拟PS/2接口实现方法包括:
主机发送数据时,通过主机嵌入式处理器中UART口发送脚采集来自PS/2设备中PS/2接口时钟脚的时钟信号,同时通过UART口接收脚同步输出数据信号至PS/2接口数据脚;
主机接收数据时,通过UART口接收脚直接输入来自PS/2接口数据脚的数据信号,同时使来自PS/2接口时钟脚的时钟信号无效。
7.如权利要求6所述的基于嵌入式处理器的模拟PS/2接口实现方法,其特征在于,主机设置有UART控制器,通过所述UART控制器完成数据采集处理。
8.如权利要求7所述的基于嵌入式处理器的模拟PS/2接口实现方法,其特征在于,从所述UART控制器的FIFO内获取数据,以进行后续处理。
CN201110253313.4A 2011-08-30 2011-08-30 基于嵌入式处理器的模拟ps/2接口实现系统及实现方法 Active CN102955561B (zh)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201110253313.4A CN102955561B (zh) 2011-08-30 2011-08-30 基于嵌入式处理器的模拟ps/2接口实现系统及实现方法

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201110253313.4A CN102955561B (zh) 2011-08-30 2011-08-30 基于嵌入式处理器的模拟ps/2接口实现系统及实现方法

Publications (2)

Publication Number Publication Date
CN102955561A CN102955561A (zh) 2013-03-06
CN102955561B true CN102955561B (zh) 2016-08-03

Family

ID=47764444

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201110253313.4A Active CN102955561B (zh) 2011-08-30 2011-08-30 基于嵌入式处理器的模拟ps/2接口实现系统及实现方法

Country Status (1)

Country Link
CN (1) CN102955561B (zh)

Families Citing this family (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103207845B (zh) * 2012-01-16 2016-08-10 广州三星通信技术研究有限公司 将ps/2键盘连接到便携式终端的方法和便携式终端
CN112835821B (zh) * 2020-11-24 2024-04-09 深圳市国科亿道科技有限公司 单片机gpio口模拟ps2接口的方法、单片机及系统

Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1949142A (zh) * 2005-10-11 2007-04-18 北京天一集成科技有限公司 键盘
CN101937416A (zh) * 2010-09-09 2011-01-05 苏州华芯微电子股份有限公司 基于fpga实现的ps2协议逻辑分析仪

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US7240111B2 (en) * 2005-04-12 2007-07-03 Belkin Corporation Apparatus and system for managing multiple computers

Patent Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1949142A (zh) * 2005-10-11 2007-04-18 北京天一集成科技有限公司 键盘
CN101937416A (zh) * 2010-09-09 2011-01-05 苏州华芯微电子股份有限公司 基于fpga实现的ps2协议逻辑分析仪

Also Published As

Publication number Publication date
CN102955561A (zh) 2013-03-06

Similar Documents

Publication Publication Date Title
US10261930B2 (en) System, device and method for transmitting signals between different communication interfaces
CN108111382B (zh) 基于i3c总线的通信装置及其通信方法
US20170168964A1 (en) Hard drive disk indicator processing apparatus
TW200703011A (en) Bus device used in computer system
WO2013048508A1 (en) Bandwidth configurable io connector
CN102664873A (zh) 一种带bmc的国产龙芯cpu服务器的kvm-over-ip实现方法
CN104102508A (zh) 一种基于FlexRay总线的多机程序在线升级方法
CN104503594A (zh) 一种ps/2键盘鼠标远程切换系统
CN102955561B (zh) 基于嵌入式处理器的模拟ps/2接口实现系统及实现方法
TWI528161B (zh) 資料傳輸系統以及資料傳輸方法
KR20130031188A (ko) 다중 데이터 접속 포트들을 구비한 전기 장치
CN103226523B (zh) 一种外接设备与移动终端及其组成的系统
CN102890661A (zh) 一种主从机通讯协议
CN106649184A (zh) 适用于星载电子设备的异步通信串口指令快速应答方法
CN104503822A (zh) 一种ps/2键盘鼠标模拟器
KR101025540B1 (ko) 리모컨 수신부와 터치센서 제어부의 통합 장치 및 방법
CN101998691B (zh) 一种数据传输的方法、系统和装置
CN104156336A (zh) 一种usb2.0接口芯片的控制方法
US20150095540A1 (en) External device and a transmission system and the method of the heterogeneous device
US10120828B2 (en) Bridge for bus-powered peripheral device power management
JP2015005190A (ja) インタフェース装置、及び情報処理装置
US9928198B2 (en) Adapter card with a computer module form factor
CN104199630A (zh) 一种基于龙芯处理器计算机平台的mxm显卡的配置方法
CN101847133A (zh) 转接装置及多电脑切换器
US11334339B2 (en) USB device and firmware updating method thereof

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
C10 Entry into substantive examination
SE01 Entry into force of request for substantive examination
C14 Grant of patent or utility model
GR01 Patent grant
PE01 Entry into force of the registration of the contract for pledge of patent right

Denomination of invention: Implementation system and implementation method of analog PS/2 interface based on embedded processor

Effective date of registration: 20171102

Granted publication date: 20160803

Pledgee: China Co truction Bank Corp Guangzhou economic and Technological Development Zone sub branch

Pledgor: Anyka (Guangzhou) Microelectronics Technology Co., Ltd.

Registration number: 2017990001008

PE01 Entry into force of the registration of the contract for pledge of patent right
PC01 Cancellation of the registration of the contract for pledge of patent right
PC01 Cancellation of the registration of the contract for pledge of patent right

Date of cancellation: 20181227

Granted publication date: 20160803

Pledgee: China Co truction Bank Corp Guangzhou economic and Technological Development Zone sub branch

Pledgor: Anyka (Guangzhou) Microelectronics Technology Co., Ltd.

Registration number: 2017990001008

PE01 Entry into force of the registration of the contract for pledge of patent right

Denomination of invention: Implementation System and Method of Analog PS/2 Interface Based on Embedded Processor

Effective date of registration: 20190130

Granted publication date: 20160803

Pledgee: China Co truction Bank Corp Guangzhou economic and Technological Development Zone sub branch

Pledgor: Anyka (Guangzhou) Microelectronics Technology Co., Ltd.

Registration number: 2019440000051

PE01 Entry into force of the registration of the contract for pledge of patent right
PC01 Cancellation of the registration of the contract for pledge of patent right

Date of cancellation: 20200320

Granted publication date: 20160803

Pledgee: China Co truction Bank Corp Guangzhou economic and Technological Development Zone sub branch

Pledgor: ANYKA (GUANGZHOU) MICROELECTRONICS TECHNOLOGY Co.,Ltd.

Registration number: 2019440000051

PC01 Cancellation of the registration of the contract for pledge of patent right
CP01 Change in the name or title of a patent holder

Address after: 510663 3rd floor, area C1, innovation building, 182 science Avenue, Guangzhou Science City, Luogang District, Guangzhou City, Guangdong Province

Patentee after: Guangzhou Ankai Microelectronics Co.,Ltd.

Address before: 510663 3rd floor, area C1, innovation building, 182 science Avenue, Guangzhou Science City, Luogang District, Guangzhou City, Guangdong Province

Patentee before: ANYKA (GUANGZHOU) MICROELECTRONICS TECHNOLOGY Co.,Ltd.

CP01 Change in the name or title of a patent holder
CP02 Change in the address of a patent holder

Address after: 510555 No. 107 Bowen Road, Huangpu District, Guangzhou, Guangdong

Patentee after: Guangzhou Ankai Microelectronics Co.,Ltd.

Address before: 510663 3rd floor, area C1, innovation building, 182 science Avenue, Guangzhou Science City, Luogang District, Guangzhou City, Guangdong Province

Patentee before: Guangzhou Ankai Microelectronics Co.,Ltd.

CP02 Change in the address of a patent holder