CN102323914B - Control method of controller interface capable of automatically detecting WGIN input - Google Patents

Control method of controller interface capable of automatically detecting WGIN input Download PDF

Info

Publication number
CN102323914B
CN102323914B CN 201110113279 CN201110113279A CN102323914B CN 102323914 B CN102323914 B CN 102323914B CN 201110113279 CN201110113279 CN 201110113279 CN 201110113279 A CN201110113279 A CN 201110113279A CN 102323914 B CN102323914 B CN 102323914B
Authority
CN
China
Prior art keywords
wgin
register
interrupt
result
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
CN 201110113279
Other languages
Chinese (zh)
Other versions
CN102323914A (en
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.)
HANGZHOU SYNODATA SECURITY TECHNOLOGY CO., LTD.
Original Assignee
HANGZHOU SHENGYUAN CHIP TECHNIQUE 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 HANGZHOU SHENGYUAN CHIP TECHNIQUE CO Ltd filed Critical HANGZHOU SHENGYUAN CHIP TECHNIQUE CO Ltd
Priority to CN 201110113279 priority Critical patent/CN102323914B/en
Publication of CN102323914A publication Critical patent/CN102323914A/en
Application granted granted Critical
Publication of CN102323914B publication Critical patent/CN102323914B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Abstract

The invention relates to a control method of a controller interface capable of automatically detecting WGIN input. A WGIN module is attached to a bus bridge and is in signal connection with a kernel CPU (Central Processing Unit) through the bus bridge, the kernel CPU transfers a clock module to the WGIN module through the bus bridge, and a reference clock which can be supplied to the WGIN for work is formed through a WGIN prescaler in a frequency division way; two external GPIO (General Purpose Input/Output) ports are used for carrying out data sampling by a sampling clock, acquiring data with the length consistent with preset data length and storing the data in a register WGINH_RESULT and a register WGINL_RESULT, an interrupt is generated at the time, and whether the interrupt is delivered to the kernel CPU is judged under the control of interrupt enable. The controller interface and the control method disclosed by the invention have the beneficial effects that: a WGIN level signal is automatically received by the hardware without the need of polling the level states of the GPIO ports by a main program, therefore the phenomenon of data loss can be avoided, and the defects in an inquiring manner are overcome; and according to the configuration of users, the hardware can be subjected to once interrupt after receiving all data, therefore the progress cannot be influenced by frequency interrupt, and the defects of an interrupt manner are overcome.

Description

A kind of control method of control unit interface of automatic detection Wei root input
Technical field
The present invention relates to access control system, especially a kind of control method of control unit interface of automatic detection Wei root input.
Background technology
The Wiegand agreement is unified in the world standard, is a kind of communications protocol of being formulated by Motorola Inc..It is applicable to relate to the card reader of access control system and the numerous characteristics of card.It has a lot of forms, and the 26-bit of standard should be the most frequently used form.In addition, also have the forms such as 34-bit, 37-bit.And standard 26-bit form is a widely used industrial standard, and to all HID(Human Interface Device human interface devices) the user open.Nearly all access control system is the 26-Bit form of Acceptable criterion all.
The output of Wei single data is comprised of two lines, is respectively DATA0 and DATA1; Two lines respectively will ' 0 ' or ' 1 ' output.When exporting ' 0 ': negative pulse occurs on the DATA0 line; When exporting ' 1 ': negative pulse occurs on the DATA1 line; A burst length TL is between 20us to 100us, and the bound-time TW of pulse is between 200us to 20ms, as shown in Figure 2.
Existing Wei root signal reception mode has two kinds: inquiry mode and external interrupt mode.All exist separately drawback.1, the reception of Wei root is higher to the requirement of real-time of time, if the phenomenon of frame losing can occur with the method reception of inquiry: supposing to inquire DATA0 is that 0 o'clock master routine is pointing to other tasks, when executing this task Deng master routine, DATA0 has become 1, just caused so like this loss of a 0bit, the card number of reading like this parity checking certainly can't pass, and therefore shows CPU and does not receive the card number that the ID module sends.Although 2, adopt the mode of external interrupt the phenomenon of data can not occur losing, interruption times is too frequent, for example Wei root 26 will interrupt 26 times, and Wei root 34 will interrupt 34 times, and this can cause user's process often to be interrupted, and affects the continuity of program process.
Summary of the invention
Purpose of the present invention will solve the deficiency that above-mentioned technology exists just, and a kind of control method of control unit interface of automatic detection Wei root input is provided.
The present invention solves the technical scheme that its technical matters adopts: the control method of the control unit interface of this automatic detection Wei root input, the Wei root module is articulated on bus bridge, be connected with the kernel cpu signal by bus bridge, kernel CPU transmits a clock module to the Wei root module by bus bridge, divides to occur frequently by the WGIN pre-divider to supply the reference clock of Wei root module work; Be used for receiving two external GPIO mouths of external signal, be WGIN_DATA0, WGIN_DATA1, carry out data sampling through sampling clock, collect the data consistent with preset data length, it is the WGIN data length, it is stored in register WGINH_RESULT and WGINL_RESULT, produces an interruption this moment, this interrupts by interrupting enabling to control whether pass to kernel CPU.
Control method of the present invention, it is as follows that the client receives the Wiegand signal step by control unit interface:
Step 1: Wei root (WGIN) initialization:
1. configure the work clock of WGIN, write register WGIN_CLKDIV;
2. data receiver length is set, writes register WGIN_CTRL[7:1];
3. remove WGIN interrupt inquiry sign, write register WGIN_INTFLAG=1;
4. if configuration WGIN interrupts enabling, write register WGIN_CTRL[0]=1, do not enable write 0 if interrupt;
Step 2: Wei root (WGIN) receive interruption service:
1., produce in WGIN and have no progeny, remove the WGIN interrupt identification, prepares next WGIN interruption, write register WGIN-INTFLAG=1;
2., read WGIN result register WGINH_RESULT, WGINL_RESULT; Depositing in this register from read head and passing the complete Wiegand signal of coming.
The effect that the present invention is useful is: the characteristic that the present invention is directed to Wei root acknowledge(ment) signal has well solved above two drawbacks: hardware automatic reception Wei root level signal of the present invention, no longer need master routine to remove the level state of poll GPIO mouth, thereby the phenomenon of data can not occur losing, solve the drawback of inquiry mode.So hardware according to user's configuration, only produces once after receiving all data and interrupts, thereby can not interrupt frequently influencing the course, and has solved the drawback that adopts interrupt mode.
Description of drawings
Fig. 1 is the data transmission schematic diagram of gate inhibition and read head;
Fig. 2 is the WGIN sequential chart;
Fig. 3 is that in the present invention, the Wei root receives the semiotic function block diagram;
Fig. 4 be in the present invention the WGIN module articulate schematic diagram;
Fig. 5 is WGIN initialization flowchart in the present invention;
Fig. 6 is WGIN receive interruption service subprogram schematic diagram in the present invention.
Embodiment
The invention will be further described below in conjunction with drawings and Examples:
Shown in please refer to the drawing 4, the Wei root module is articulated on bus bridge, thereby carries out the signal transmission with kernel CPU.Kernel CPU transmits a clock module to the Wei root module by bus bridge, divides to occur frequently through Wei root frequency divider (WGIN pre-divider) to supply the reference clock of Wei root module work.Two external GPIO mouth (WGIN_DATA0, WGIN_DATA1) receive external signal, carry out data sampling through sampling clock, collect the data consistent with preset data length (WGIN data length), it is stored in high 32 bit registers of register WGINH_RESULT(WGIN result) and low 32 bit registers of WGINL_RESULT(WGIN result) in, produce an interruption this moment, this interrupts by interrupting enabling to control whether pass to kernel CPU.
The user can realize by configuring some simple registers the reception of Wiegand signal.Register description is as follows:
Table 1 has been listed these register names, offset address, access mode and initial value etc.
Table 1WGIN register
Register name Offset address R/W Reset values Describe
WGIN_CLKDIV 0x00 r/w 0x0a Clock sampling frequency division register
WGIN_CTRL 0X04 r/w 0x00 Control register
WGIN_INTFLAG 0x08 r/w 0x00 Interrupt identification/zero clearing register
WGINH_RESULT 0x0c r/w 0x00 The high bit register of transformation result
WGINL_RESULT 0x10 r/w 0x00 Transformation result is hanged down bit register
WGIN clock sampling frequency division register (WGIN_CLKDIV):
WGIN clock sampling frequency division register (WGIN_CLKDIV) is determined sample frequency, and its definition sees Table 2.
Table 2WGIN_CLKDIV
Domain name The position R/W Reset values Describe
-- 31:16 -- -- Keep
ClkDiv 15:0 r/w 0x0a WGIN clock division number, divider ratio are (WGINClkDiv+1) * 2
WGIN control register (WGIN_CTRL):
WGIN_CTRL is used for configuring the control signal of WGIN, describes and sees Table 3.
Table 3WGIN_CTRL
Domain name The position R/W Reset values Describe
-- 31:9 -- -- Keep
Start 8 r/w 0x00 Write 1 and start receive data,
Len 7:1 r/w 0x00 The receive data total length
IntEn 0 r/w 0x00 Interrupt enable bit is write 1 and is enabled to interrupt
WGIN interrupt identification/zero clearing register (WGIN_INTFLAG)
WGIN_INTFLAG sees Table 4, is used for reading the interrupt identification of WGIN, and removes the WGIN interrupt identification, and this register is write 1 zero clearing.
Table 4WGIN_INTFLAG
Domain name The position R/W Reset values Describe
-- 31:1 -- -- Keep
IntFlag 0 r/w 0x00 Wiegand interrupt identification/zero clearing register
WGIN transformation result register high 32 (WGINH_RESULT)
WGINH_RESULT sees Table 5, is WGIN transformation result register.In case the user detects or inquires interruption, the user just can read the transformation result (high 32) that this register obtains Wiegand.
Table 5WGINH_RESULT
Name Bits R/W Reset Description
-- 31:10 -- -- Reserved
ResultH 9:0 r 0x00 WGIN?conversion?result
WGIN transformation result register hangs down 32 (WGINL_RESULT)
WGINL_RESULT sees Table 6, if data length surpasses 32, remaining result exists in this register, is WGIN transformation result register.In case the user detects or inquire interruption, the user just can read the transformation result (low 32) that this register obtains Wiegand.
Table 6WGINL_RESULT
Name Bits R/W Reset Description
-- 31:10 -- -- Reserved
ResultL 9:0 r 0x00 WGIN?conversion?result
As Fig. 5, shown in Figure 6, it is as follows that the client receives the Wiegand signal step by this interface:
Step 1: Wei root (WGIN) initialization:
1. configure the work clock of WGIN, write register WGIN_CLKDIV
2. data receiver length is set, writes register WGIN_CTRL[7:1]
3. remove WGIN interrupt inquiry sign, write register WGIN_INTFLAG=1
4. if configuration WGIN interrupts enabling, write register WGIN_CTRL[0]=1, do not enable write 0 if interrupt
Step 2: Wei root (WGIN) receive interruption service
1., produce in WGIN and have no progeny, remove the WGIN interrupt identification, prepares next WGIN interruption, write register WGIN-INTFLAG=1;
2., read WGIN result register WGINH_RESULT, WGINL_RESULT; Depositing in this register from read head and passing the complete Wiegand signal of coming.
Characteristics of the present invention are as follows:
1. the input of Wei root can be passed through register configuration, to save the MEMORY space, reduces system resource;
2. hardware mode is guaranteed the accuracy of receive data;
3. greatly reduce interruption frequency, liberated MCU (Micro Control Unit micro-control unit resource) resource;
4.IP logic is simple, area is less, and cost is lower;
5. can pass through IP, compatible existing existing multiple Wei root input mode.
Terminological interpretation:
Gate control system:
Weigh up again into management control system (ACCESS CONTROL SYSTEM).It is a kind of intellectualized management system of managerial personnel's turnover.Summarize and be exactly: whom is managed when can pass in and out those doors, and provide inquiry form afterwards etc., common gate control system has: the password access system, the non-contact card gate control system, the general name of fingerprint iris palm type bio-identification gate control system etc., gate control system developed very fast in recent years, was widely used in management control system.
Read head:
Read head is exactly card reader, and (read goes out device, scanner, reader, communicator, read write line again) is the module for reading and writing in control system.The read head chip package is got up, mainly communicate by the modes such as Wei Gen or serial ports, IIC and controller, this has just formed simple control system.At present the kind of read head is a lot, mainly comprises three kinds of keyboard-type, induction type and bio-identification.
Door controller:
Door controller is the unidirectional turnover of door or the two-way turnover of door, according to high-performance gate inhibition's controller of technical grade technical requirement design.
MCU:
MCU (Micro Control Unit) Chinese is micro-control unit, claim again one chip microcomputer (Single Chip Microcomputer) or single-chip microcomputer, refer to appearance and development thereof along with large scale integrated circuit, with CPU, RAM, ROM, timer conter and the multiple I/O Interface integration of computing machine on a slice chip, form the computing machine of chip-scale, do various combination for different application scenarios and control.
The GPIO mouth:
This paper refers to the pin of MCU.
The external interrupt mode:
External interrupt mode herein refers to that the GPIO mouth of the MCU in door controller receives the terminal that the level signal sent from read head produces, and then the MCU of controller reads the level of this interruption.
The external inquiry mode:
External inquiry mode herein refers to that the continuous poll of MCU in door controller self is connected to the GPIO mouth signal of read head, as shown in Figure 1.
In addition to the implementation, the present invention can also have other embodiments.All employings are equal to the technical scheme of replacement or equivalent transformation formation, all drop on the protection domain of requirement of the present invention.

Claims (2)

1. control method that automatically detects the control unit interface of Wei root input, it is characterized in that: the Wei root module is articulated on bus bridge, be connected with the kernel cpu signal by bus bridge, kernel CPU transmits a clock module to the Wei root module by bus bridge, divides to occur frequently by the WGIN pre-divider to supply the reference clock of Wei root module work; Be used for receiving two external GPIO mouths of external signal, be WGIN_DATA0, WGIN_DATA1, carry out data sampling through sampling clock, collect the data consistent with preset data length, it is the WGIN data length, it is stored in register WGINH_RESULT and WGINL_RESULT, produces an interruption this moment, this interrupts by interrupting enabling to control whether pass to kernel CPU.
2. the control method of the control unit interface of automatic detection Wei root input according to claim 1, it is characterized in that: it is as follows that the client receives the Wiegand signal step by control unit interface:
Step 1: Wei root (WGIN) initialization:
1. configure the work clock of WGIN, write register WGIN_CLKDIV;
2. data receiver length is set, writes register WGIN_CTRL[7:1];
3. remove WGIN interrupt inquiry sign, write register WGIN_INTFLAG=1;
4. if configuration WGIN interrupts enabling, write register WGIN_CTRL[0]=1, do not enable write 0 if interrupt;
Step 2: Wei root (WGIN) receive interruption service:
1., produce in WGIN and have no progeny, remove the WGIN interrupt identification, prepares next WGIN interruption, write register WGIN_INTFLAG=1;
2., read WGIN result register WGINH_RESULT, WGINL_RESULT; Depositing in this register from read head and passing the complete Wiegand signal of coming.
CN 201110113279 2011-04-27 2011-04-27 Control method of controller interface capable of automatically detecting WGIN input Active CN102323914B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN 201110113279 CN102323914B (en) 2011-04-27 2011-04-27 Control method of controller interface capable of automatically detecting WGIN input

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN 201110113279 CN102323914B (en) 2011-04-27 2011-04-27 Control method of controller interface capable of automatically detecting WGIN input

Publications (2)

Publication Number Publication Date
CN102323914A CN102323914A (en) 2012-01-18
CN102323914B true CN102323914B (en) 2013-11-06

Family

ID=45451658

Family Applications (1)

Application Number Title Priority Date Filing Date
CN 201110113279 Active CN102323914B (en) 2011-04-27 2011-04-27 Control method of controller interface capable of automatically detecting WGIN input

Country Status (1)

Country Link
CN (1) CN102323914B (en)

Families Citing this family (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102693568A (en) * 2012-05-21 2012-09-26 中船重工(武汉)凌久高科有限公司 Method of multipath Wiegand data acquisition in access controller
CN102842021B (en) * 2012-08-30 2016-03-09 杭州晟元数据安全技术股份有限公司 A kind of rfid card Read Controller and implementation method
CN106570984B (en) * 2016-10-19 2019-08-02 厦门中控智慧信息技术有限公司 Support card number verification method, the apparatus and system of a variety of Wiegand formats
CN114338567B (en) * 2021-12-27 2023-09-05 锐迪科创微电子(北京)有限公司 SDIO interface data transmission method and device and SDIO interface equipment
CN115061960B (en) * 2022-06-10 2023-05-05 睿云联(厦门)网络通讯技术有限公司 Wiegand signal self-adaptive processing method and system

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US8358783B2 (en) * 2008-08-11 2013-01-22 Assa Abloy Ab Secure wiegand communications

Also Published As

Publication number Publication date
CN102323914A (en) 2012-01-18

Similar Documents

Publication Publication Date Title
CN102323914B (en) Control method of controller interface capable of automatically detecting WGIN input
CN202870808U (en) FPGA realization device of SPI serial port module
CN102495920B (en) Integrated logic analysis module based on PCIe (peripheral component interconnection express) for FPGA (field programmable gate array)
US20150220140A1 (en) Device, method and system for operation of a low power phy with a pcie protocol stack
CN103714029A (en) Novel two-line synchronous communication protocol and application
CN104506379A (en) Method and system for capturing network data
CN108768981A (en) A kind of IP kernel for realizing the communication of Powerlink industry real-time ethernets
CN108650136A (en) A kind of design method of master/slave station card that realizing the communication of Powerlink industry real-time ethernets
CN110348033A (en) Reduce the deflection between the positive conductor and negative conductor that carry Difference signal pair
CN104714907B (en) A kind of pci bus is converted to ISA and APB bus design methods
CN107153412B (en) A kind of CAN controller circuit with transmission FIFO
CN107771331A (en) Free-standing UARK BRK detections
CN201383075Y (en) PC104-plus controller based on PowerPC processor
CN103107862B (en) Logical device and MDIO data transmission method for uplink thereof
CN101763324B (en) Method for realizing equipment simulating and device thereof
CN106533621A (en) Communication method for monitoring permanent magnet synchronous motor in real time based on simplified MODBUS protocol
CN116955242A (en) Single-bus communication method, storage medium and intelligent terminal
CN102591817A (en) Multi-bus bridge controller and implementing method thereof
CN206003081U (en) A kind of synchronous serial interface association of industrial computer processes managing device and industrial computer
CN104765710B (en) A kind of method of work of the card reader comprising dual processor
CN114327975A (en) System on chip
CN202472758U (en) Iris recognition attendance system based on DSP (Digital Signal Processor) and ARM processor
CN102421004B (en) Debugging method and device for television software system
CN205263795U (en) Embedded recorder of treater machine of delaying
CN201804329U (en) USB interface hardware device based on ARM (advanced risc machines) microprocessor

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
C10 Entry into substantive examination
SE01 Entry into force of request for substantive examination
C53 Correction of patent for invention or patent application
CB02 Change of applicant information

Address after: The city of Hangzhou in West Zhejiang province 311121 No. 998 Building 9 East Sea Park

Applicant after: Hangzhou Shengyuan Chip Technique Co., Ltd.

Address before: 310012, room 17, building 176, 203 Tianmu Mountain Road, Hangzhou, Zhejiang, Xihu District

Applicant before: Hangzhou Shengyuan Chip Technique Co., Ltd.

C14 Grant of patent or utility model
GR01 Patent grant
C56 Change in the name or address of the patentee
CP01 Change in the name or title of a patent holder

Address after: The city of Hangzhou in West Zhejiang province 311121 No. 998 Building 9 East Sea Park

Patentee after: HANGZHOU SYNODATA SECURITY TECHNOLOGY CO., LTD.

Address before: The city of Hangzhou in West Zhejiang province 311121 No. 998 Building 9 East Sea Park

Patentee before: Hangzhou Shengyuan Chip Technique Co., Ltd.