CN109217875B - Manchester coding and decoding method - Google Patents

Manchester coding and decoding method Download PDF

Info

Publication number
CN109217875B
CN109217875B CN201811245840.9A CN201811245840A CN109217875B CN 109217875 B CN109217875 B CN 109217875B CN 201811245840 A CN201811245840 A CN 201811245840A CN 109217875 B CN109217875 B CN 109217875B
Authority
CN
China
Prior art keywords
data
frame
jump
reading
time
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
CN201811245840.9A
Other languages
Chinese (zh)
Other versions
CN109217875A (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.)
Nanjing Qinheng Microelectronics Co ltd
Original Assignee
Nanjing Qinheng Microelectronics 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 Nanjing Qinheng Microelectronics Co ltd filed Critical Nanjing Qinheng Microelectronics Co ltd
Priority to CN201811245840.9A priority Critical patent/CN109217875B/en
Publication of CN109217875A publication Critical patent/CN109217875A/en
Application granted granted Critical
Publication of CN109217875B publication Critical patent/CN109217875B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • HELECTRICITY
    • H03ELECTRONIC CIRCUITRY
    • H03MCODING; DECODING; CODE CONVERSION IN GENERAL
    • H03M5/00Conversion of the form of the representation of individual digits
    • H03M5/02Conversion to or from representation by pulses
    • H03M5/04Conversion to or from representation by pulses the pulses having two levels
    • H03M5/06Code representation, e.g. transition, for a given bit cell depending only on the information in that bit cell
    • H03M5/12Biphase level code, e.g. split phase code, Manchester code; Biphase space or mark code, e.g. double frequency code
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06KGRAPHICAL DATA READING; PRESENTATION OF DATA; RECORD CARRIERS; HANDLING RECORD CARRIERS
    • G06K17/00Methods or arrangements for effecting co-operative working between equipments covered by two or more of main groups G06K1/00 - G06K15/00, e.g. automatic card files incorporating conveying and reading operations
    • G06K17/0022Methods or arrangements for effecting co-operative working between equipments covered by two or more of main groups G06K1/00 - G06K15/00, e.g. automatic card files incorporating conveying and reading operations arrangements or provisious for transferring data to distant stations, e.g. from a sensing device
    • G06K17/0029Methods or arrangements for effecting co-operative working between equipments covered by two or more of main groups G06K1/00 - G06K15/00, e.g. automatic card files incorporating conveying and reading operations arrangements or provisious for transferring data to distant stations, e.g. from a sensing device the arrangement being specially adapted for wireless interrogation of grouped or bundled articles tagged with wireless record carriers
    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02DCLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
    • Y02D10/00Energy efficient computing, e.g. low power processors, power management or thermal management

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • General Engineering & Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Dc Digital Transmission (AREA)

Abstract

The invention discloses a Manchester coding and decoding method, S1, the initial frame is read, the initial frame is continuous N1, because the stop bit is 0, the initial frame following immediately is 1, the first bit of the initial frame is 1 jump, namely in N T0 cycles, jump is necessary every 1/2T 0, 2N-1 jump edges exist, whether 2N-1 jump exists is detected in N T0 time, if yes, the initial frame is judged to be correct, at this time, the data is read and recorded; s2, reading the data frame, immediately entering a data frame reading stage after the reading of the initial frame is finished, delaying the time by more than 1/2 x T0 to less than T0, waiting for the jumping edge, wherein the jumping level data is the bit data of the current data frame; and S3, checking whether the data reading is correct. The invention only needs 1 timer, only needs to record jump time, can greatly reduce software overhead, save RAM and ROM.

Description

Manchester coding and decoding method
Technical Field
The invention relates to a Manchester encoding and decoding method, belonging to the technical field of integrated circuits.
Background
RFID is widely adopted in the electronic field, and the decoding of 125KHz RFID code can be realized by a special chip or single chip microcomputer software. The hardware complexity is increased and the production cost is increased by using a special chip, the common singlechip software for decoding Manchester codes needs to start the edge capture of a timer and store the duration time of high and low levels, and the inverted level is judged to be high or low or idle jump according to the duration time of the high and low levels.
Disclosure of Invention
In order to solve the problems, the invention provides a Manchester coding and decoding method, which only needs 1 timer and only needs to record the jump time, thereby greatly reducing the software overhead and saving RAM and ROM.
The technical scheme for solving the problems is as follows: a Manchester encoding and decoding method comprises the following steps:
s1, reading a start frame, wherein the start frame is continuous N1, because the stop bit is 0, the start frame immediately following the stop bit is inevitably 1, the first bit of the start frame is inevitably 1 jump, namely in N T0 periods, jump is inevitably carried out every 1/2T 0, 2N-1 jump edges are provided, whether 2N-1 jump exists is detected in N T0 time, if yes, the start frame is judged to be correct, and data is read and recorded at the moment;
s2, reading the data frame, immediately entering a data frame reading stage after the reading of the initial frame is finished, delaying the time by more than 1/2 x T0 to less than T0, waiting for the jumping edge, wherein the jumping level data is the bit data of the current data frame;
and S3, checking whether the data reading is correct.
Further, the specific step in S1 is to set the effective jump time of the start frame to be 20 × T1-30 × T1, if jump occurs in this interval, add 1 to the effective count of the start frame, otherwise, clear the effective count of the start frame; and if the effective counting value of the initial frame is more than or equal to 2N-2, entering a data frame reading stage.
Further, the specific steps in S2 are that, after the start frame is read, the data frame is directly read, the time is delayed by 4/5 × T0, that is, by 40 × T1, the edge jump is waited, the level data after the jump is recorded, and the data counter is incremented by 1; if the data counter is more than or equal to 55 bits, the reading of the data frame is finished.
Further, row-column parity or redundancy check is employed in S3.
Further, the specific step of performing parity check on the data frame is that the fifth number of each row and the tenth number of each column are respectively subjected to parity check, and if the row and column checks are passed, the RFID tag is indicated to receive correctly.
The invention has the advantages that: by judging the initial frame and reading data, the method saves the edge capturing and timing, only needs 1 timer, only needs to record the jump time, can greatly reduce the software overhead, and saves RAM and ROM.
The present invention is described in further detail below with reference to the attached drawing figures.
Drawings
FIG. 1 is a schematic diagram of determining a start frame;
FIG. 2 is a schematic diagram of data frame determination;
FIG. 3 is a flowchart of start frame determination code;
fig. 4 is a flow chart of a data frame code.
Detailed Description
For the purpose of enhancing the understanding of the present invention, the present invention will be further described in detail with reference to the following examples and the accompanying drawings, which are only used for explaining the present invention and are not to be construed as limiting the scope of the present invention.
Referring to fig. 1-4, the present invention provides a manchester encoding and decoding method, which comprises
The carrier frequency of the 125KHz RFID signal is 125KHz, the frequency of the modulated signal is 2KHz, and Manchester coding is adopted, and the encoding mode of Manchester coding is as follows: the level is inverted from high to low to represent 1, and from low to high to represent 0.
And judging a start frame by detecting the time count of edge conversion, recording the end position of the start frame, delaying 3/4 periods to wait for edge jump after the end position of the frame is determined, and recording a level signal after jump, wherein the signal after jump is the required RFID decoding data. The method only needs 1 timer, only needs to record the jump time, can greatly reduce the software overhead, and saves RAM and ROM.
The specific implementation method comprises the following steps:
let T0 be the period of the demodulated signal, T1 be the sampling period, and T1 be much smaller than T0, where 50 × T1 — T0 are set. The number of the start frames 1 is N.
1. Reading an initial frame:
the start frame is N1 s in succession, because the stop bit is 0, the start frame immediately following the stop bit is necessarily 1, and the first bit of the start frame is necessarily 1 transition, i.e., there are 2 × N-1 transition edges in N T0 cycles. And setting the effective jump time of the initial frame to be 20-30T 1-1, if jump is generated in the interval, adding 1 to the effective count of the initial frame, and otherwise, resetting the effective count of the initial frame. If the effective counting value of the initial frame is more than or equal to 2 × N-2, entering a data frame reading stage;
2. data frame reading:
after the initial frame is read, the data frame reading stage is directly started, the time is delayed 4/5 × T0, namely 40 × T1, the edge jump is waited, the level data after the jump is recorded, and the data counter is added with 1. If the data counter is more than or equal to 55 bits, the reading of the data frame is finished.
3. Parity check
To prevent data reception errors, parity checking is performed on the data frame. The fifth and tenth numbers of each row and column are parity check respectively. If the row and column check is passed, the RFID label is received correctly.
The codes corresponding to the steps are as follows:
1.1, start frame judgment code:
Figure BDA0001840500830000041
Figure BDA0001840500830000051
1.2 data frame judgment code
Figure BDA0001840500830000052
Figure BDA0001840500830000061
Figure BDA0001840500830000071
Figure BDA0001840500830000081
The above description is only for the purpose of illustrating the preferred embodiments of the present invention and is not to be construed as limiting the invention, and any modifications, equivalents, improvements and the like that fall within the spirit and principle of the present invention are intended to be included therein.

Claims (4)

1. A manchester encoding and decoding method, comprising the steps of:
s1, setting the period of the demodulation signal as T0, the sampling period as T1, and T0=50 × T1; reading a start frame, wherein the start frame is N1 continuous frames, because the stop bit is 0, the start frame immediately after the stop bit is 1, the first bit of the start frame is 1 jump, namely, in N T0 cycles, jump is necessary every 1/2 × T0, 2 × N-1 jump edges are provided, whether 2 × N-1 jumps exist is detected in N × T0 time, if yes, the start frame is judged to be correct, and then data is read and recorded;
the method for judging whether jumping exists comprises the following steps: setting the effective jumping time of the initial frame between 20 × T1 and 30 × T1, if jumping occurs in the interval, adding 1 to the effective count of the initial frame, otherwise, clearing the effective count of the initial frame;
s2, reading the data frame, immediately entering a data frame reading stage after the reading of the initial frame is finished, delaying the time by more than 1/2 x T0 to less than T0, waiting for the jumping edge, wherein the jumping level data is the bit data of the current data frame;
and S3, checking whether the data reading is correct.
2. The manchester encoding and decoding method according to claim 1, wherein the specific steps in S2 are that, after the start frame is read, the data frame is directly read, the data frame is delayed by 4/5 × T0, namely 40 × T1, the edge jump is waited, the level data after the jump is recorded, and the data counter is incremented by 1; and if the data counter is more than or equal to 55 bits, the data frame is completely read.
3. The manchester encoding and decoding method of claim 1, wherein row-column parity or redundancy check is used in S3.
4. The manchester encoding and decoding method according to claim 3, wherein: the specific steps of carrying out parity check on the data frame are respectively parity check on the fifth number of each row and the tenth number of each column, and if the row and column check are passed, the RFID label is correctly received.
CN201811245840.9A 2018-10-24 2018-10-24 Manchester coding and decoding method Active CN109217875B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201811245840.9A CN109217875B (en) 2018-10-24 2018-10-24 Manchester coding and decoding method

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201811245840.9A CN109217875B (en) 2018-10-24 2018-10-24 Manchester coding and decoding method

Publications (2)

Publication Number Publication Date
CN109217875A CN109217875A (en) 2019-01-15
CN109217875B true CN109217875B (en) 2022-08-26

Family

ID=64996166

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201811245840.9A Active CN109217875B (en) 2018-10-24 2018-10-24 Manchester coding and decoding method

Country Status (1)

Country Link
CN (1) CN109217875B (en)

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US4603322A (en) * 1982-09-27 1986-07-29 Cubic Corporation High-speed sequential serial Manchester decoder
JP2008205965A (en) * 2007-02-21 2008-09-04 Denso Wave Inc Decoding method of manchester code
CN101616109A (en) * 2008-06-27 2009-12-30 中兴通讯股份有限公司 A kind of data transmission method
CN105187070A (en) * 2015-09-22 2015-12-23 惠州华阳通用电子有限公司 Manchester encoding signal decoding method and device

Family Cites Families (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN100376084C (en) * 2006-05-19 2008-03-19 宁波中科集成电路设计中心有限公司 Manchester code decoding method and application apparatus therefor
CN101729192B (en) * 2008-10-30 2013-08-07 杭州士兰微电子股份有限公司 Encoding and decoding method for wireless radio frequency remote control
CN105281776B (en) * 2014-07-08 2019-03-05 南车株洲电力机车研究所有限公司 It is a kind of can error correction manchester decoder devices and methods therefor
CN108491346A (en) * 2018-03-23 2018-09-04 江苏沁恒股份有限公司 A kind of BMC coding/decoding methods

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US4603322A (en) * 1982-09-27 1986-07-29 Cubic Corporation High-speed sequential serial Manchester decoder
JP2008205965A (en) * 2007-02-21 2008-09-04 Denso Wave Inc Decoding method of manchester code
CN101616109A (en) * 2008-06-27 2009-12-30 中兴通讯股份有限公司 A kind of data transmission method
CN105187070A (en) * 2015-09-22 2015-12-23 惠州华阳通用电子有限公司 Manchester encoding signal decoding method and device

Non-Patent Citations (2)

* Cited by examiner, † Cited by third party
Title
Improving a genetic algorithm segmentation by means of a fast edge detection technique;A.D. Sappa;《Proceedings 2001 International Conference on Image Processing》;20020807;754-757 *
基于FPGA的1553B总线信号收发和验证;李进方;《国外电子测量技术》;20170831;59-65 *

Also Published As

Publication number Publication date
CN109217875A (en) 2019-01-15

Similar Documents

Publication Publication Date Title
KR101775981B1 (en) Communication circuit and sampling adjusting method
US8295407B2 (en) Decoding method and apparatus for infrared remote control commands
CN101571906A (en) Decoder and decoding method of RFID receiver
US9286155B1 (en) Systems and methods for generating soft information in a flash device
CN1694241A (en) Method and circuit arrangement for resetting an integrated circuit
JP2006262454A (en) Clock reproducing method and manchester decoding method
CN103825675A (en) Coding method and apparatus in secondary ultrasonic communication
EP3334051A2 (en) Method and system for bi-phase mark coding (bmc) decoding
CN109217875B (en) Manchester coding and decoding method
JP4548394B2 (en) Data transmission equipment
CN106921463A (en) A kind of anti-interference coding/decoding method and system
CN115086454B (en) Method, system and storage medium for self-adaptive galvanometer control signal interface
CN112235221B (en) BPSK signal decoding method and device
US20100045492A1 (en) Decoding Apparatus and Method
CN114205054A (en) Signal processing method and device, electronic device and storage medium
CN102932103A (en) Data transmission rate self-adaptive receiving method based on digital substation
JP4266991B2 (en) Magnetic card reader
CN113472374A (en) Device wake-up method and wake-up receiver
CN107818279B (en) Decoding method and device for RFID reader-writer
CN104427343A (en) Circuit and method for encoding DCA (dynamic channel allocation) bit signal in FPD-LINK LVDS (flat panel display-LINK low voltage differential signaling) video transmission
US8024645B2 (en) Method for error detection in a decoded digital signal stream
CN112050930A (en) Audio signal detection method and detection device
CN116318072A (en) Digital signal delay method based on waveform coding
CN106803903A (en) The decoding circuit of video control signal in a kind of FPD LINK transmission of video
US9479148B2 (en) Serial data signal edge detection

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
TA01 Transfer of patent application right
TA01 Transfer of patent application right

Effective date of registration: 20220801

Address after: No.18, ningshuang Road, Nanjing, Jiangsu, 210000

Applicant after: Nanjing qinheng Microelectronics Co.,Ltd.

Address before: No. 18 Ningshuang Road, Yuhuatai District, Nanjing City, Jiangsu Province, 210012

Applicant before: JIANGSU QINHENG Co.,Ltd.

GR01 Patent grant
GR01 Patent grant