CN102323914A - Controller interface capable of automatically detecting WGIN input and control method - Google Patents

Controller interface capable of automatically detecting WGIN input and control method Download PDF

Info

Publication number
CN102323914A
CN102323914A CN201110113279A CN201110113279A CN102323914A CN 102323914 A CN102323914 A CN 102323914A CN 201110113279 A CN201110113279 A CN 201110113279A CN 201110113279 A CN201110113279 A CN 201110113279A CN 102323914 A CN102323914 A CN 102323914A
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.)
Granted
Application number
CN201110113279A
Other languages
Chinese (zh)
Other versions
CN102323914B (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

Landscapes

  • Bus Control (AREA)

Abstract

The invention relates to a controller interface capable of automatically detecting WGIN input and a control method. 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 unit interface and control method of automatic detection Wei root input
Technical field
The present invention relates to access control system, especially a kind of control unit interface and control method 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 the card reader that relates to 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 forms such as 34-bit, 37-bit.And standard 26-bit form is a widely used industrial standard, and open to the user of all HID (Human Interface Device human interface device).Nearly all access control system is all accepted the 26-Bit form of standard.
The output of Wei single data is made up of two lines, is respectively DATA0 and DATA1; Two lines respectively will ' 0 ' or ' 1 ' output.When exporting ' 0 ': appearance of negative pulse on the DATA0 line; When exporting ' 1 ': appearance of negative pulse 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, and is as shown in Figure 2.
Existing Wei root signal reception mode has two kinds: inquiry mode and external interrupt mode.All exist drawback separately.1, the reception of Wei root requires than higher the 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; DATA0 has become 1 when executing this task Deng master routine; Just caused losing of a 0bit so like this, 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 is sent.Though 2, the phenomenon of data can not appear losing in the mode of employing external interrupt, interruption times is too frequent, and 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 influences the continuity of program process.
Summary of the invention
The object of the invention will solve the deficiency that above-mentioned technology exists just, and a kind of control unit interface and control method of automatic detection Wei root input are provided.
The present invention solves the technical scheme that its technical matters adopts: the control unit interface of this automatic detection Wei root input; The Wei root module is articulated on the bus bridge; Be connected with the kernel cpu signal through bus bridge; Kernel CPU transmits a clock module through bus bridge and gives the Wei root module, and occuring frequently through WGIN pre-divider branch to supply the reference clock of Wei root module work; Be used to receive two external GPIO mouths of external signal; Be WGIN_DATA0, WGIN_DATA1, carry out data sampling, collect the data consistent with preset data length through sampling clock; It is the WGIN data length; It is stored among register WGINH_RESULT and the WGINL_RESULT, produces an interruption this moment, this interrupts whether passing to kernel CPU by interrupting enabling control.
Control method of the present invention, it is following that the client receives the Wiegand signal step through control unit interface:
Step 1: Wei root (WGIN) initialization:
1. dispose the work clock of WGIN, write register WGIN_CLKDIV;
2. Data Receiving 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, if interruption does not enable then writes 0;
Step 2: Wei root (WGIN) receives break in service:
1., produce among the WGIN and have no progeny, remove the WGIN interrupt identification, prepare next WGIN and interrupt, 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.Right hardware only produces once after having accepted all data and interrupts, thereby can not interrupt frequently influencing the course according to user's configuration, has solved the drawback that adopts interrupt mode.
Description of drawings
Fig. 1 is the data transmission synoptic diagram of gate inhibition and read head;
Fig. 2 is the WGIN sequential chart;
Fig. 3 receives the semiotic function block diagram for Wei root among the present invention;
Fig. 4 is the synoptic diagram that articulates of WGIN module among the present invention;
Fig. 5 is WGIN initialization flowchart among the present invention;
Fig. 6 receives the interrupt service subroutine synoptic diagram for WGIN among the present invention.
Embodiment
Below in conjunction with accompanying drawing and embodiment the present invention is described further:
Please join shown in Figure 4ly, the Wei root module is articulated on the bus bridge, thereby carries out the signal transmission with kernel CPU.Kernel CPU transmits a clock module and gives the Wei root module through 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 (WGIN data length), it is stored among register WGINH_RESULT (high 32 bit registers of WGIN result) and the WGINL_RESULT (WGIN result hangs down 32 bit registers) with preset data length; Produce an interruption this moment, this interrupts whether passing to kernel CPU by interrupting enabling control.
The user can realize the reception of Wiegand signal through some simple registers of configuration.Register description is following:
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 confirmed SF, and table 2 is seen in its definition.
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 disposing the control signal of WGIN, describes and sees table 3.
Table 3WGIN_RSTDT
Domain name The position R/W Reset values Describe
-- 31:9 -- -- Keep
Start 8 r/w 0x00 Write 1 and start the reception data,
Len 7:1 r/w 0x00 Receive the data total length
IntEn 0 r/w 0x00 Interrupt enable bit is write 1 and is enabled to interrupt
WGIN_INTFLAG sees table 4, is used for reading the interrupt identification of WGIN, and removes WGIN interrupt identification, this register 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 5WGIN_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)
WGINH_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 6WGIN_RESULT
Name Bits R/W Reset Description
-- 31:10 -- -- Reserved
ResultL 9:0 r 0x00 WGIN?conversion?result
Like Fig. 5, shown in Figure 6, it is following that the client receives the Wiegand signal step through this interface:
Step 1: Wei root (WGIN) initialization:
1. dispose the work clock of WGIN, write register WGIN_CLKDIV
2. Data Receiving 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, if interruption does not enable then writes 0
Step 2: Wei root (WGIN) receives break in service
1., produce among the WGIN and have no progeny, remove the WGIN interrupt identification, prepare next WGIN and interrupt, 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 following:
1. the input of Wei root can be passed through register configuration, to save the MEMORY space, reduces system resource;
2. hardware mode guarantees to receive the accuracy of 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 inquiry form afterwards or the like is provided; Common gate control system has: password gate control system, 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 the management control system.
Read head:
Read head is exactly a card reader, and (read goes out device, scanner, reader, communicator, read write line again) is the module for reading and writing in the control system.The read head Chip Packaging is got up, mainly communicate through 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 a micro-control unit; Claim one chip microcomputer (Single Chip Microcomputer) or single-chip microcomputer again; Be meant appearance and development thereof along with large scale integrated circuit; CPU, RAM, ROM, timer conter and the multiple I/O interface of computing machine are integrated on a slice chip, form the computing machine of chip-scale, for doing various combination control in different application scenarios.
The GPIO mouth:
This paper refers to the pin of MCU.
The external interrupt mode:
External interrupt mode among this paper is meant that the GPIO mouth of the MCU in the door controller receives the terminal that level signal produced of sending from read head, and the MCU of controller reads the level of this interruption then.
The external inquiry mode:
External inquiry mode among this paper is meant that the continuous poll of MCU in the door controller self is connected to the GPIO mouth signal of read head, and is as shown in Figure 1.
Except that the foregoing description, 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. one kind is detected the control unit interface that the Wei root is imported automatically; It is characterized in that: the Wei root module is articulated on the bus bridge; Be connected with the kernel cpu signal through bus bridge; Kernel CPU transmits a clock module through bus bridge and gives the Wei root module, and occuring frequently through WGIN pre-divider branch to supply the reference clock of Wei root module work; Be used to receive two external GPIO mouths of external signal; Be WGIN_DATA0, WGIN_DATA1, carry out data sampling, collect the data consistent with preset data length through sampling clock; It is the WGIN data length; It is stored among register WGINH_RESULT and the WGINL_RESULT, produces an interruption this moment, this interrupts whether passing to kernel CPU by interrupting enabling control.
2. control method that adopts the control unit interface of automatic detection Wei root input as claimed in claim 1, it is characterized in that: it is following that the client receives the Wiegand signal step through control unit interface:
Step 1: Wei root (WGIN) initialization:
1. dispose the work clock of WGIN, write register WGIN_CLKDIV;
2. Data Receiving 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, if interruption does not enable then writes 0;
Step 2: Wei root (WGIN) receives break in service:
1., produce among the WGIN and have no progeny, remove the WGIN interrupt identification, prepare next WGIN and interrupt, 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 true CN102323914A (en) 2012-01-18
CN102323914B 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)

Cited By (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
CN102842021A (en) * 2012-08-30 2012-12-26 杭州晟元芯片技术有限公司 Controller for reading RFID (Radio Frequency Identification Device) card number and realizing method
CN106570984A (en) * 2016-10-19 2017-04-19 厦门中控生物识别信息技术有限公司 Card number verification method, device and system capable of supporting various wiegand formats
CN114338567A (en) * 2021-12-27 2022-04-12 锐迪科创微电子(北京)有限公司 SDIO interface data transmission method and device and SDIO interface equipment
CN115061960A (en) * 2022-06-10 2022-09-16 睿云联(厦门)网络通讯技术有限公司 Adaptive processing method and system for wiegend signal

Citations (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20100034375A1 (en) * 2008-08-11 2010-02-11 Assa Abloy Ab Secure wiegand communications

Patent Citations (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20100034375A1 (en) * 2008-08-11 2010-02-11 Assa Abloy Ab Secure wiegand communications

Non-Patent Citations (2)

* Cited by examiner, † Cited by third party
Title
索静;田生喜;刘杰: "韦根信号接收处理的实现", 《福建电脑》 *
许德恒: "《基于单片机的多路韦根信号的采集与处理》", 《计算机测量与控制》 *

Cited By (9)

* 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
CN102842021A (en) * 2012-08-30 2012-12-26 杭州晟元芯片技术有限公司 Controller for reading RFID (Radio Frequency Identification Device) card number and realizing method
CN102842021B (en) * 2012-08-30 2016-03-09 杭州晟元数据安全技术股份有限公司 A kind of rfid card Read Controller and implementation method
CN106570984A (en) * 2016-10-19 2017-04-19 厦门中控生物识别信息技术有限公司 Card number verification method, device and system capable of supporting various wiegand formats
CN106570984B (en) * 2016-10-19 2019-08-02 厦门中控智慧信息技术有限公司 Support card number verification method, the apparatus and system of a variety of Wiegand formats
CN114338567A (en) * 2021-12-27 2022-04-12 锐迪科创微电子(北京)有限公司 SDIO interface data transmission method and device and SDIO interface equipment
CN114338567B (en) * 2021-12-27 2023-09-05 锐迪科创微电子(北京)有限公司 SDIO interface data transmission method and device and SDIO interface equipment
CN115061960A (en) * 2022-06-10 2022-09-16 睿云联(厦门)网络通讯技术有限公司 Adaptive processing method and system for wiegend signal
CN115061960B (en) * 2022-06-10 2023-05-05 睿云联(厦门)网络通讯技术有限公司 Wiegand signal self-adaptive processing method and system

Also Published As

Publication number Publication date
CN102323914B (en) 2013-11-06

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
CN109828941A (en) AXI2WB bus bridge implementation method, device, equipment and storage medium
CN103714029A (en) Novel two-line synchronous communication protocol and application
CN104714907B (en) A kind of pci bus is converted to ISA and APB bus design methods
CN108768981A (en) A kind of IP kernel for realizing the communication of Powerlink industry real-time ethernets
CN107771331A (en) Free-standing UARK BRK detections
CN107153412B (en) A kind of CAN controller circuit with transmission FIFO
CN114297124A (en) Communication system of SRIO high-speed bus based on FPGA
CN201383075Y (en) PC104-plus controller based on PowerPC processor
CN103107862B (en) Logical device and MDIO data transmission method for uplink thereof
CN114327975A (en) System on chip
CN203596016U (en) Universal port for communication of sensor and micro controller
CN102591817A (en) Multi-bus bridge controller and implementing method thereof
CN104239255A (en) Universal data converter and method for Wiegand bus
CN116955242A (en) Single-bus communication method, storage medium and intelligent terminal
CN117033277A (en) Single-wire communication control device and data processing method
CN113890783B (en) Data transmitting and receiving system and method, electronic equipment and storage medium
CN203930809U (en) The management system of the different GPU of a kind of compatibility
CN104765710B (en) A kind of method of work of the card reader comprising dual processor
CN205263795U (en) Embedded recorder of treater machine of delaying
CN203376748U (en) Single-bus receiving logical structure
CN104765703B (en) Method for collecting data messages on FPGA platform
CN103647728A (en) STM32 single chip microcomputer and Linux system high-speed series port anti-interference communication method
CN107133148A (en) A kind of SoC bus monitorings device and its method of work

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 of 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.