CN109099959A - A kind of connection of digital sensor array and data read method - Google Patents

A kind of connection of digital sensor array and data read method Download PDF

Info

Publication number
CN109099959A
CN109099959A CN201810636399.0A CN201810636399A CN109099959A CN 109099959 A CN109099959 A CN 109099959A CN 201810636399 A CN201810636399 A CN 201810636399A CN 109099959 A CN109099959 A CN 109099959A
Authority
CN
China
Prior art keywords
array
line
data
clock
sensor
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
CN201810636399.0A
Other languages
Chinese (zh)
Other versions
CN109099959B (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.)
Institute of Electrical Engineering of CAS
Original Assignee
Institute of Electrical Engineering of CAS
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 Institute of Electrical Engineering of CAS filed Critical Institute of Electrical Engineering of CAS
Priority to CN201810636399.0A priority Critical patent/CN109099959B/en
Publication of CN109099959A publication Critical patent/CN109099959A/en
Application granted granted Critical
Publication of CN109099959B publication Critical patent/CN109099959B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • GPHYSICS
    • G01MEASURING; TESTING
    • G01DMEASURING NOT SPECIALLY ADAPTED FOR A SPECIFIC VARIABLE; ARRANGEMENTS FOR MEASURING TWO OR MORE VARIABLES NOT COVERED IN A SINGLE OTHER SUBCLASS; TARIFF METERING APPARATUS; MEASURING OR TESTING NOT OTHERWISE PROVIDED FOR
    • G01D21/00Measuring or testing not otherwise provided for
    • G01D21/02Measuring two or more variables by means not covered by a single other subclass

Landscapes

  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Testing Or Calibration Of Command Recording Devices (AREA)
  • Arrangements For Transmission Of Measured Signals (AREA)

Abstract

A kind of connection method of digital sensor array, multiple digital sensors use array distribution, and the row and column of array is clock line or data line, and the clock line SCL of each sensor is all connected to the clock line SCLi, i=1~M of array in array;The data input/output line SDA of each sensor is all connected to the data line SDAj, j=1~N of array in array;The I/O pin of microcontroller is connected to the clock line and data line of sensor array;Microcontroller drives the clock line of digital sensor array, and by the data line of array, reads in the data of all the sensors in array.

Description

A kind of connection of digital sensor array and data read method
Technical field
The present invention relates to a kind of digital sensors.
Background technique
Sensor is the main path and means that modern society people obtain information in nature and production field.In modern work During industry production especially automated production, need to be obtained the parameters information in production process with various sensors; In Internet of Things, various sensors are used to measure or perceive the various information in ambient enviroment.Sensor is generally divided into Analog sensor and digital sensor.Digital sensor is to be allowed to export by A/D conversion module by traditional analog sensor Signal is the sensor of digital quantity, the advantages of digital transducer be application circuit structure it is simple, directly with digital output just In directly inputting computer.Now more digital sensor is to be communicated in such a way that clock line adds data line with the external world, For example common digital sensor has I2C interface, SPI interface etc., however need largely to use such digital sensing some The occasion of device obtains the data of sensors with auxiliary electrode according to polling mode, it is difficult to the real-time index for meeting measuring system, if adopting The data that sensors with auxiliary electrode is obtained with parallel mode will occupy computer or the more pin resource of microcontroller.This kind of number The large scale array formula that word sensor is unfavorable for sensor uses.
Summary of the invention
The purpose of the present invention is the digital sensors for overcoming existing clock line to add data line mode output data to be difficult to use in The shortcomings that large scale array uses proposes connection method and the data read method of a kind of such digital sensor array.This hair It is bright that microcontroller can be enable to read sensing data all in array with less pin, not only accelerate digital biography The data reading speed of sensor, and pin resource is saved for microcontroller, tool is applicable in sensor large scale array mode There is important application value.
Using digital sensing utensil clock line and data input/output line of the invention, data input/output line be can be A data wire is also possible to the bus of more data lines composition.Multiple digital sensors can be set in identical clock There are identical data input/output format and data input/output timing under timing, includes but are not limited to I2C interface, The digital sensor of SPI interface.Using microcontroller of the invention include but is not limited to single-chip microcontroller, ARM, FPGA, CPLD, Computer etc., all chip, module or components that can have read-write I/O pin are included in such microcontroller.Using Digital sensor and microcontroller of the invention is not limited to individual size size, and sensor array connection also can integrate at one In chip or sensor array and microcontroller are all integrated in a chip.
The arrangement of inventive sensor array and connection method are as follows:
Multiple sensors use array distribution according to actual needs, for example multiple sensor arrangements are rectangular array, annular Array etc..The line number and columns of array can be unequal, the quantity of the sensor of every a line or each column arrangement in array It can be unequal.Sensor array shows M clock lines SCLi, i=1~M, and having N group data line SDAj, j=1~N, M and N is to appoint Meaning natural number.The data line SDAj of the jth group of array can be a data wire, be also possible to the total of more data line compositions Line, the radical of SDAj data line are identical as the radical of the input/output line of the sensor connected.All digital sensings in array The clock line SCL of device is connected with the clock line SCLi of array, the clock line SCL connection of each sensor and only exists in array It is connected at one on the clock line SCLi of array;The data input/output line SDA of all digital sensors is and array in array Data line SDAj be connected, the data input/output line SDA connection of each sensor and be only connected at one in array On the data line SDAj of array.
Microcontroller distribution M root I O port line is directly connected to the clock line SCLi, i=1~M, Huo Zhejing of sensor array It crosses decoder or driver is connected to the clock line SCLi of sensor array;Microcontroller distributes N item or the integral multiple IO of N Mouth line is directly connected to data line SDAj, the j=1~N of sensor array, or is connected to biography by encoder/decoder or driver Feel the data line SDAj of array.
All the sensors in digital sensor array of the present invention can be set to same working method.In the work Make under mode, in digital sensor array all digital sensors under identical clocked sequential data input/output format and Data input/output sequence is identical.The clock line of the array provides defined clock signal, when necessary drive array data Line provides defined data, so that it may the output data of sensor in sensor array is obtained on the data line of array.
The data read method of digital sensor array of the present invention is as follows:
(1) first by one chip read-write mode or the read-write mode of unified array, by institute in digital sensor array There is sensor to be set as same working method.Under the working method, all sensors are in unified clock in sensor array Under the action of timing, data are sequentially outputted to the data line of matrix according to unified format and output.Then microcontroller is used Output mouth line carrys out clock line SCLi, the i=1~M of the corresponding connected array of timesharing driving, generates unified clock timing, M is clock The quantity of line.When necessary microcontroller can also according to the requirement drive array of sensor handbook data line SDAj, j=1~ N;Sensor in sensor array according to unified format and exports respective data suitable under the action of the unified clock Sequence is output on the data line SDAj for the array being correspondingly connected with;Microcontroller reads array data line according to corresponding timing in time Data on SDAj can obtain the data of all the sensors in array.Specific steps are as follows:
(2) by one chip read-write mode or to unify read-write mode, set same for all the sensors in array Working method, under this working method, all sensors can be by data under the action of the unified clock timing in array The data line of array is sequentially outputted to according to unified format and output.
(3) microcontroller is advised with output mouth line P11 come drive array clock line SCL1 so that array clock line SCL1 is exported Fixed clock signal, all sensors being connected in sensor array with array clock line SCL1 are array clock line SCL1's Under effect, respective data are output on the data line SDAj of array, j=1~N.Microcontroller by with array data line The pin of SDAj connection reads in all sensing datas being connected with array clock line SCL1, j=1~N.
(4) microcontroller is advised with output mouth line P12 come drive array clock line SCL2 so that array clock line SCL2 is exported Fixed clock signal, all sensors being connected in sensor array with array clock line SCL2 are array clock line SCL2's Respective data are output on the number line SDAj of array under effect, j=1~N.Microcontroller by with array data line SDAj The pin of connection reads in all sensing datas being connected with array clock line SCL2, j=1~N;If sensor array only has One clock lines, i.e. M=1, then save this step, and M is the quantity of clock line.
(5) microcontroller is successively with output mouth line P1k come drive array clock line SCLk, k=3~M, so that array clock Line SCLk exports defined clock signal, and all sensors being connected in sensor array with array clock line SCLk are in array Under the action of clock line SCLk, respective data are output on the data line SDAj of array, j=1~N.Microcontroller passes through The pin connecting with array data line SDAj reads in all sensing datas being connected with SCLk, j=1~N.If sensor array Column only have a perhaps two clock lines, that is, M=1 or M=2, then save this step, and M is the quantity of clock line.
(6) in this way, microcontroller obtains the output data of all the sensors.
Detailed description of the invention
Fig. 1 is sensor array connection schematic diagram.
Specific embodiment
The present invention is further illustrated below in conjunction with the drawings and specific embodiments.
Below by taking digital sensor MAG3110 as an example, 12 MAG3110 array connections and data read method are provided. MAG3110 is a kind of with I2The sensor of C bus, all the sensors can be unified read-write mode with array and be set as identical work Operation mode, such as continuous measurement operating mode.Under this operating mode, all the sensors data under given retiming clock signal Output format, output timing are identical.Realize sensor read-write microcontroller, can be single-chip microcontroller, ARM, FFPGA, CPLD etc., The present embodiment illustrates by taking STM32f407 as an example.
The array of sensor is arranged and connection method:
12 sensor MAG3110 are divided into 3 rows × 4 column rectangular arrays distribution, and sensor distribution is as shown in Figure 1.Array Behavior clock line CLK0, CLK1, CLK2, the clock line of every a line all the sensors MAG3110 is and square in sensor array The clock line of the shape array row is connected, i.e., clock line SCL10, SCL11 of all the sensors MAG3110 in the first row, SCL12, SCL13 is all connected to the clock line CLK0 of the rectangular array row, the clock line SCL20 of all the sensors MAG3110 on the second row, SCL21, SCL22, SCL23 are all connected to the clock line CLK1 of the rectangular array row;All the sensors MAG3110 on the third line Clock line SCL30, SCL31, SCL32, SCL33 are all connected to the clock line CLK2 of the rectangular array row.The institute of sensor array It is classified as data line DIO0, DIO1, DIO2, DIO3, the number of all the sensors MAG3110 is defeated on each column in sensor array Enter/output line is connected with the data line of rectangular array respective column, i.e., the data of all the sensors MAG3110 are defeated on first row Enter/output line SDA10, SDA20, SDA30 be all connected to the data line DIO0 of rectangular array, all the sensors on secondary series Data line input/output line SDA11, SDA21, SDA31 of MAG3110 are all connected to the data line DIO1 of rectangular array, third Data input/output line SDA12, SDA22, SDA32 of all the sensors MAG3110 is all connected to the data of rectangular array on column Line DIO2, the 4th data input/output line SDA13, SDA23, SDA33 for arranging upper all the sensors MAG3110 are all connected to square The data line DIO3 of shape array.
Selecting I/O pin PA0, PA1, PA2 of STM32f407 is clock line, is connected respectively the clock line of array CLK0,CLK1,CLK2;Selecting I/O pin PB0, PB1, PB2, PB3 of STM32f407 is data input/output line, is respectively corresponded It is connected to data line DIO0, DIO1, DIO2, DIO3 of array.
Sensor array data reading method step:
(1) STM32f407 drives clock line CLK0, CLK1, CLK2 of sensor array respectively with PA0, PA1, PA2, with PB0, PB1, PB2, PB3 drive data line DIO0, DIO1, DIO2, DIO3 of sensor array, according to I2C bus specification and First 0xA0 is written to the internal register addresses 11H of MAG3110 in the requirement of MAG3110 databook, then into MAG3110 0x19 is written in portion register address 10H, sets all the sensors in array to continuously to measure operating mode.
(2) STM32f407 is defeated by data of PB0, PB1, PB2, PB3 with the clock line CLK0 of PA0 driving sensor array Enter/output line, according to I2The requirement of C bus specification and MAG3110 databook reads the data of the first row all the sensors.
(3) STM32f407 is defeated by data of PB0, PB1, PB2, PB3 with the clock line CLK1 of PA1 driving sensor array Enter/output line, according to I2The requirement of C bus specification and MAG3110 databook is read the number of the second row all the sensors According to.
(4) STM32f407 is defeated by data of PB0, PB1, PB2, PB3 with the clock line CLK2 of PA2 driving sensor array Enter/output line, according to I2The requirement of C bus specification and MAG3110 databook is read the number of all the sensors of the third line According to.
(5) to the output data of STM32f407 acquisition all the sensors.

Claims (4)

1. a kind of connection method of digital sensor array, the digital sensing utensil clock line and data input/output line, It is characterized by: multiple digital sensors use array distribution, the row and column of array is clock line or data line, array In the clock line SCL of each sensor be all connected to the clock line SCLi, i=1~M of array;The number of each sensor in array The data line SDAj, j=1~N of array are all connected to according to input/output line SDA;The I/O pin of microcontroller is directly connected to battle array The clock line SCLi of column, or process decoder or driver are connected to the clock line SCLi of array;The I O port line of microcontroller It is directly connected to the data line SDAj of array, or is connected to the data line SDAj of array by encoder/decoder or driver;It is micro- Controller drives the clock line of sensor array, and by the data line of array, reads in the data of all the sensors in array.
2. the connection method of digital sensor array according to claim 1, it is characterised in that: the digital sensor All the sensors in array are set as same working method;Under the working method, all digital sensors are in phase in array With clocked sequential under data input/output format and data input/output sequence it is identical;The clock line of the array provides Defined clock signal, drive array data line provides defined data when necessary, just can obtain on the data line of array The output data of sensor in sensor array.
3. the data read method of digital sensor array of any of claims 1 or 2, it is characterised in that: the number passes Sensor array passes through one chip read-write mode or unified read-write mode first, and all the sensors of digital sensor array are set It is set to same working method, effect of all sensors in unified clock timing in the working method lower sensor array Under, data are sequentially outputted to array data line according to unified format and output;Then microcontroller passes through output mouth line point When digital sensor array corresponding to driving clock line SCLi, generate unified clock timing;In digital sensor array Sensor respective data be sequentially outputted to according to unified format and output under the action of unified clock be correspondingly connected with Array data line SDAj on;Microcontroller reads the data on the data line SDAj of array according to corresponding timing in time, Obtain the data of all the sensors in array.
4. the data read method of digital sensor array according to claim 3, it is characterised in that: the microcontroller Device is with mouth line P1k is exported come drive array clock line SCLk, so that array clock line SCLk exports defined clock signal, k=1 ~M;All sensors being connected in sensor array with array clock line SCLk, will under the action of array clock line SCLk Respective data are output on the data line SDAj of array, j=1~N;Microcontroller is by connecting with array data line SDAj Pin reads in all sensing datas being connected with SCLk, j=1~N.
CN201810636399.0A 2018-06-20 2018-06-20 Connection and data reading method of digital sensor array Active CN109099959B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201810636399.0A CN109099959B (en) 2018-06-20 2018-06-20 Connection and data reading method of digital sensor array

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201810636399.0A CN109099959B (en) 2018-06-20 2018-06-20 Connection and data reading method of digital sensor array

Publications (2)

Publication Number Publication Date
CN109099959A true CN109099959A (en) 2018-12-28
CN109099959B CN109099959B (en) 2021-04-02

Family

ID=64844886

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201810636399.0A Active CN109099959B (en) 2018-06-20 2018-06-20 Connection and data reading method of digital sensor array

Country Status (1)

Country Link
CN (1) CN109099959B (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114579491A (en) * 2022-01-28 2022-06-03 新华三技术有限公司合肥分公司 Integrated circuit bus multiplexing device and network equipment

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1619517A (en) * 2003-11-22 2005-05-25 鸿富锦精密工业(深圳)有限公司 Multichannel internal integrated circuit
CN1983228A (en) * 2005-12-12 2007-06-20 群康科技(深圳)有限公司 System for transmitting control signal by internal IC bus
JP2008040575A (en) * 2006-08-02 2008-02-21 Yokogawa Electric Corp Serial data transfer device and serial data transfer method
CN101140556A (en) * 2007-09-11 2008-03-12 中兴通讯股份有限公司 Method and device for realizing accessing multiple I2C slave device by programmable device
CN101324875A (en) * 2007-06-11 2008-12-17 大唐移动通信设备有限公司 Method and apparatus for expanding I<2>C bus
CN201374060Y (en) * 2008-12-16 2009-12-30 康佳集团股份有限公司 IIC bus expanded system structure

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1619517A (en) * 2003-11-22 2005-05-25 鸿富锦精密工业(深圳)有限公司 Multichannel internal integrated circuit
CN1983228A (en) * 2005-12-12 2007-06-20 群康科技(深圳)有限公司 System for transmitting control signal by internal IC bus
JP2008040575A (en) * 2006-08-02 2008-02-21 Yokogawa Electric Corp Serial data transfer device and serial data transfer method
CN101324875A (en) * 2007-06-11 2008-12-17 大唐移动通信设备有限公司 Method and apparatus for expanding I<2>C bus
CN101140556A (en) * 2007-09-11 2008-03-12 中兴通讯股份有限公司 Method and device for realizing accessing multiple I2C slave device by programmable device
CN201374060Y (en) * 2008-12-16 2009-12-30 康佳集团股份有限公司 IIC bus expanded system structure

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114579491A (en) * 2022-01-28 2022-06-03 新华三技术有限公司合肥分公司 Integrated circuit bus multiplexing device and network equipment

Also Published As

Publication number Publication date
CN109099959B (en) 2021-04-02

Similar Documents

Publication Publication Date Title
CN103259542B (en) Low delay intermode trigger serial line interface for analog-digital converter
CN209746085U (en) SOC chip testing and verifying system
CN103559856B (en) The recognition system of the factory source of display panel and display panel and method
CN102710454A (en) Automatic test system and automatic test method
CN103049361A (en) FPGA (Field Programmable Gata Array) with embedded logical analysis function and logical analysis system
CN104516581A (en) Touch display device and method for driving the same
CN101957428A (en) Automatic test method and tool of monitoring circuit board
CN109099959A (en) A kind of connection of digital sensor array and data read method
CN102175280A (en) Digitalized vehicle instrument simulating device
CN205015889U (en) Definite system of traditional chinese medical science lingual diagnosis model based on convolution neuroid
CN100573623C (en) Computer automatic analysis experiment instrument and experimental technique
CN103389933A (en) Test card and electronic test device with same
CN106802642A (en) A kind of test system and method for testing of BCM car body controllers
CN102567157A (en) Testing device of power sequence signal on computer
CN103869275B (en) A kind of measuring accuracy calibration steps of single-phase intelligent electric energy meter
CN101539778B (en) General basic control platform of PCR appearance
CN104897770A (en) Steel wire rope nondestructive testing system
CN205353657U (en) Diagnosis of multi -functional communication interface data and signal driver card
CN101424284B (en) Gear box oil pump test control timing method and timer
CN1845211A (en) PIC single-chip microcomputer experiment system
CN103412241A (en) Cable fault positioning system based on single-chip microcomputer technology
CN102636209A (en) Expandable universal sensor interface and environment monitoring equipment using same
CN2742393Y (en) Comprehensive diagnostic tester for working condition of screw pump
CN209571216U (en) A kind of LED display mould group automatic white balance debugging system
CN107219791A (en) A kind of embedded board based on ArmCortex M4 kernels

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
GR01 Patent grant
GR01 Patent grant