CN109099959B - Connection and data reading method of digital sensor array - Google Patents

Connection and data reading method of digital sensor array Download PDF

Info

Publication number
CN109099959B
CN109099959B CN201810636399.0A CN201810636399A CN109099959B CN 109099959 B CN109099959 B CN 109099959B CN 201810636399 A CN201810636399 A CN 201810636399A CN 109099959 B CN109099959 B CN 109099959B
Authority
CN
China
Prior art keywords
array
data
line
clock
sensor array
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
CN201810636399.0A
Other languages
Chinese (zh)
Other versions
CN109099959A (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

Images

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 connecting method of a digital sensor array is characterized in that a plurality of digital sensors are distributed in an array, rows and columns of the array are clock lines or data lines, the clock line SCL of each sensor in the array is connected to an array clock line SCli, and i is 1-M; the data input/output line SDA of each sensor in the array is connected to the array data lines SDAj, j being 1 to N; an IO pin of the microcontroller is connected to a clock line and a data line of the sensor array; the microcontroller drives the clock line of the digital sensor array and reads in the data of all the sensors in the array via the data lines of the array.

Description

Connection and data reading method of digital sensor array
Technical Field
The present invention relates to a class of digital sensors.
Background
The sensor is a main way and means for people to acquire information in the fields of nature and production in modern society. In modern industrial production, especially in automatic production, various sensors are needed to acquire information of various parameters in the production process; in the internet of things, various sensors are used to measure or sense various information in the surrounding environment. Sensors are generally classified into analog sensors and digital sensors. The digital sensor is a sensor which outputs signals as digital quantity by passing a traditional analog sensor through an A/D conversion module, and has the advantages of simple application circuit structure and direct digital quantity output and convenient direct input into a computer. Many digital sensors communicate with the outside world by means of a clock line and a data line, for example, a common digital sensor has an I2The C interface, the SPI interface, and the like, however, in some occasions where such digital sensors are needed to be used in a large amount, if the data of such sensors are acquired in a polling manner, it is difficult to meet the real-time index of the measurement system, and if the data of such sensors are acquired in a parallel manner, a computer or a large amount of pin resources are occupied by micro-control. Such digital sensors do not facilitate large-scale array use of the sensors.
Disclosure of Invention
The invention aims to overcome the defect that the existing digital sensor outputting data in a clock line and data line mode is difficult to use in a large-scale array, and provides a connection method and a data reading method of the digital sensor array. The invention can lead the microcontroller to read all the sensor data in the array by fewer pins, thereby not only accelerating the data reading speed of the digital sensor, but also saving the pin resources for the microcontroller, and having important application value for the large-scale sensor array mode.
The digital sensor provided by the invention has a clock line and a data input/output line, wherein the data input/output line can be a data line or a bus consisting of a plurality of data lines. Multiple digital sensors may be configured to have the same data input/output format and data input/output timing at the same clock timing, including but not limited to having I2C interface, SPI interface. The microcontroller applied to the invention includes but is not limited to a single chip microcomputer, an ARM, an FPGA, a CPLD, a computer, and the like, and all chips, modules, or components capable of having read/write IO pins are included in such a microcontroller. The digital sensor and microcontroller to which the present invention is applied are not limited to individual sizes, the sensor array connections may be integrated in one chip, or both the sensor array and microcontroller may be integrated in one chip.
The arrangement and connection method of the sensor array of the invention is as follows:
the plurality of sensors are distributed in an array according to actual needs, such as a rectangular array, a circular array, and the like. The number of rows and columns of the array may be unequal, as may the number of sensors arranged in each row or each column of the array. The sensor array has M clock lines SCLi, i being 1 to M, and N sets of data lines SDAj, j being 1 to N, where M and N are arbitrary natural numbers. The data line SDAj of the jth group of the array may be a single data line or a bus line including a plurality of data lines, and the number of the SDAj data lines is the same as the number of input/output lines of the connected sensors. The clock lines SCL of all the digital sensors in the array are connected with the clock line SCl i of the array, and the clock line SCL of each sensor in the array is connected with the clock line SCl i of the array only at one position; the data input/output lines SDA of all the digital sensors in the array are connected to the data lines SDAj of the array, and the data input/output lines SDA of each sensor in the array are connected to the data lines SDAj of the array at only one location.
The microcontroller distributes M IO port lines to be directly connected to clock lines SCli of the sensor array, wherein i is 1-M, or the M IO port lines are connected to the clock lines SCli of the sensor array through a decoder or a driver; the microcontroller allocates N or integral multiple of N IO port lines to be directly connected to the data lines SDAj of the sensing array, wherein j is 1-N, or is connected to the data lines SDAj of the sensing array through a coder/decoder or a driver.
All sensors in the digital sensor array of the present invention may be configured to operate in the same manner. In this mode of operation, the data input/output format and the data input/output sequence are the same for all digital sensors in the digital sensor array at the same clock timing. The output data of the sensors in the sensor array can be obtained on the data lines of the array by driving the array data lines to give specified data when necessary.
The data reading method of the digital sensor array comprises the following steps:
(1) firstly, setting all sensors in the digital sensor array to be in the same working mode through a single chip reading and writing mode or a unified array reading and writing mode. In this operating mode, all sensors in the sensor array output data to the data lines of the matrix in a uniform format and output sequence under the action of a uniform clock timing. And then the microcontroller drives the clock lines SCli of the correspondingly connected arrays in a time-sharing manner by using the output lines, wherein i is 1-M, and a unified clock time sequence is generated, wherein M is the number of the clock lines. If necessary, the microcontroller may also drive the data lines SDAj, j of the array 1 to N as required by the sensor manual; the sensors in the sensor array output respective data to the data lines SDAj of the correspondingly connected array according to a uniform format and an output sequence under the action of the uniform clock; the microcontroller reads the data on the array data line SDAj in time according to the corresponding timing sequence, so as to obtain the data of all the sensors in the array. The method comprises the following specific steps:
(2) all the sensors in the array are set to be in the same working mode through a single chip reading and writing mode or a unified reading and writing mode, and under the working mode, all the sensors in the array can output data to the data lines of the array according to a unified format and an output sequence under the action of the unified clock time sequence.
(3) The microcontroller drives the array clock line SCL1 via the output line P11 so that the array clock line SCL1 outputs a predetermined timing signal, and all the sensors in the sensor array connected to the array clock line SCL1 output their respective data to the data lines SDAj of the array, j being 1 to N, under the action of the array clock line SCL 1. The microcontroller reads in all sensor data connected to the array clock line SCL1 through pins connected to the array data line SDAj, j being 1-N.
(4) The microcontroller drives the array clock line SCL2 via the output line P12 so that the array clock line SCL2 outputs a predetermined timing signal, and all the sensors in the sensor array connected to the array clock line SCL2 output their respective data onto the array data line SDAj, j being 1 to N, via the array clock line SCL 2. The microcontroller reads in all sensor data connected with an array clock line SCL2 through pins connected with an array data line SDAj, wherein j is 1-N; if the sensor array has only one clock line, i.e. M is 1, this step is omitted, and M is the number of clock lines.
(5) The microcontroller sequentially drives the array clock line SCLk with the output port line P1k, where k is 3 to M, so that the array clock line SCLk outputs a predetermined timing signal, and all the sensors in the sensor array connected to the array clock line SCLk output their respective data to the data line SDAj of the array under the action of the array clock line SCLk, and j is 1 to N. The microcontroller reads in all the sensor data connected to SCLk through the pins connected to the array data line SDAj, j being 1 to N. If the sensor array has only one or two clock lines, i.e. M1 or M2, this step is omitted, M being the number of clock lines.
(6) In this manner, the microcontroller obtains the output data of all sensors.
Drawings
FIG. 1 is a schematic diagram of sensor array connections.
Detailed Description
The invention is further described below with reference to the accompanying drawings and the detailed description.
In the following, taking digital sensor MAG3110 as an example, 12 MAG3110 array connections and data reading methods are givenThe method is carried out. MAG3110 is a type having I2And all the sensors of the C bus can be set to be in the same working mode in an array uniform read-write mode, such as a continuous measurement working mode. In the working mode, the data output format and the output timing are the same under the given timing clock signal of all the sensors. The microcontroller for implementing reading and writing of the sensor can be a single chip microcomputer, an ARM, an FFPGA, a CPLD, etc., and this embodiment takes STM32f407 as an example for explanation.
Array arrangement and connection method of sensors:
the 12 sensors MAG3110 are distributed in a rectangular array of 3 rows by 4 columns, with the sensor distribution shown in FIG. 1. The clock lines CLK0, CLK1, CLK2 of the array are the rows of the array, the clock lines of all sensors MAG3110 in each row of the sensor array are connected to the clock line of the row of the rectangular array, i.e., the clock lines SCL10, SCL11, SCL12, SCL13 of all sensors MAG3110 in the first row are connected to the clock line CLK0 of the row of the rectangular array, and the clock lines SCL20, SCL21, SCL22, SCL23 of all sensors MAG3110 in the second row are connected to the clock line CLK1 of the row of the rectangular array; the clock lines SCL30, SCL31, SCL32, SCL33 of all sensors MAG3110 on the third row are connected to the clock line CLK2 of the row of the rectangular array. All columns of the sensor array are data lines DIO0, DIO1, DIO2, DIO3, digital input/output lines of all sensors MAG3110 on each column in the sensor array are connected with data lines of corresponding columns of the rectangular array, that is, data input/output lines SDA10, SDA20, SDA30 of all sensors MAG3110 on the first column are connected to data line DIO0 of the rectangular array, data input/output lines SDA11, SDA21, SDA31 of all sensors MAG3110 on the second column are connected to data line DIO1 of the rectangular array, data input/output lines SDA12, SDA22, SDA32 of all sensors MAG3110 on the third column are connected to data line DIO2 of the rectangular array, and data input/output lines SDA13, SDA23, SDA33 of all sensors MAG3110 on the fourth column are connected to data line DIO 311 3 of the rectangular array.
IO pins PA0, PA1 and PA2 of the STM32f407 are used as clock lines and are respectively and correspondingly connected to clock lines CLK0, CLK1 and CLK2 of the array; IO pins PB0, PB1, PB2 and PB3 of STM32f407 are selected as data input/output lines and are correspondingly connected to data lines DIO0, DIO1, DIO2 and DIO3 of the array respectively.
The sensor array data reading method comprises the following steps:
(1) the STM32f407 drives the clock lines CLK0, CLK1, CLK2 of the sensor array with PA0, PA1, PA2, respectively, drives the data lines DIO0, DIO1, DIO2, DIO3 of the sensor array with PB0, PB1, PB2, PB3, respectively, according to I2According to the C bus specification and the requirements of the MAG3110 data manual, 0xA0 is written into an internal register address 11H of MAG3110, and then 0x19 is written into an internal register address 10H of MAG3110, so that all sensors in the array are set to be in a continuous measurement working mode.
(2) The STM32f407 drives a clock line CLK0 of the sensor array with PA0, and data input/output lines with PB0, PB1, PB2, and PB3, as per I2The C bus specification and MAG3110 data manual requirements read the data for all sensors in the first row.
(3) The STM32f407 drives a clock line CLK1 of the sensor array with PA1, and data input/output lines with PB0, PB1, PB2, and PB3, as per I2The C bus specification and MAG3110 data manual requirements read the data for all sensors in the second row.
(4) The STM32f407 drives a clock line CLK2 of the sensor array with PA2, and data input/output lines with PB0, PB1, PB2, and PB3, as per I2The C bus specification and MAG3110 data manual requirements read data for all sensors in the third row.
(5) The STM32f407 thus obtains the output data of all the sensors.

Claims (4)

1. A method of connecting and reading data from a digital sensor array, comprising:
the digital sensor is provided with a clock line and a data input/output line, and a plurality of digital sensors are distributed in an array;
when a row of the sensor array is an array clock line, and a column of the sensor array is an array data line, the clock lines SCL of all sensors in each row of the sensor array are connected to the ith array clock line SCLI of the sensor array, i is 1-M, M is the number of the array clock lines in the sensor array, and M is a natural number more than or equal to 3; the data input/output lines SDA of all sensors in each column in the sensor array are connected to the jth array data line SDAj of the array, j is 1-N, the jth array data line SDAj of the array is a bus formed by one or more data lines, N is the number of groups of array data lines in the sensor array, and N is a natural number;
when the columns of the sensor array are array clock lines and the rows of the sensor array are array data lines, the clock lines SCL of all the sensors in each column of the sensor array are connected to the ith array clock line SCLI of the sensor array, i is 1-M, M is the number of the array clock lines in the sensor array, and M is a natural number which is more than or equal to 3; the data input/output lines SDA of all the sensors in each row in the sensor array are connected to the jth array data line SDAj of the array, j is 1-N, the jth array data line SDAj of the array is a bus formed by one or more data lines, N is the number of groups of array data lines in the sensor array, and N is a natural number;
the IO port line of the microcontroller is directly connected to the array clock line SCli or is connected to the array clock line SCli through a decoder or a driver; an IO port line of the microcontroller is directly connected to the array data line SDAj or is connected to the array data line SDAj through a coder/decoder or a driver; the microcontroller drives an array clock line of the sensor array and reads data of all sensors in the array through an array data line of the sensor array.
2. The method of connecting and data reading out of a digital sensor array according to claim 1, wherein: all sensors in the digital sensor array are set to be in the same working mode; in the working mode, the data input/output format and the data input/output sequence of all the digital sensors in the array are the same under the same clock time sequence; the array clock line provides a specified timing signal, and the array data line is driven to provide specified data, so that the output data of the sensors in the sensor array can be obtained on the array data line.
3. A method of interfacing and data reading out a digital sensor array according to claim 1 or 2, wherein: the digital sensor array firstly sets all sensors of the digital sensor array to be in the same working mode through a single chip read-write mode or a unified read-write mode, and under the working mode, all the sensors in the sensor array output data to an array data line according to a unified format and an output sequence under the action of a unified clock time sequence; then the microcontroller drives the correspondingly connected digital sensor array clock line SCLI in a time-sharing manner through the output port line to generate a unified clock time sequence; the sensors in the digital sensor array output respective data to the array data lines SDAj which are correspondingly connected according to a uniform format and an output sequence under the action of a uniform clock; and the microcontroller reads the data on the array data line SDAj in time according to the corresponding time sequence to obtain the data of all the sensors in the array.
4. A method of connection and data readout of a digital sensor array according to claim 1 or 2, characterized by: the microcontroller drives an array clock line SCLK by an output line P1k, so that the array clock line SCLK outputs a specified timing signal, wherein k is 1-M, M is the number of array clock lines in the sensor array, and M is a natural number greater than or equal to 3; all sensors connected with an array clock line SCLK in the sensor array output respective data to an array data line SDAj under the action of the array clock line SCLK, j is 1-N, N is the group number of the sensor array data lines, and N is a natural number; the microcontroller reads in all the sensor data connected to SCLk through the pins connected to the array data line SDAj, j being 1 to 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 CN109099959A (en) 2018-12-28
CN109099959B true 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)

Families Citing this family (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

Also Published As

Publication number Publication date
CN109099959A (en) 2018-12-28

Similar Documents

Publication Publication Date Title
CN113190394B (en) SOC chip-oriented multi-clock-domain concurrent test system and test method thereof
CN1434456B (en) Nonvolatile memory, and method used for reading data therefrom and writing data value thereto
CN100471067C (en) Method and device for functionally testing an analog-to-digital converter, and a corresponding analog-to-digital converter
US20190114100A1 (en) System and method for detecting hard disk state
CN102710454A (en) Automatic test system and automatic test method
CN109099959B (en) Connection and data reading method of digital sensor array
CN115470750B (en) Chip performance verification system based on trace file
US20170228338A1 (en) Semiconductor device and its control method
CN113722171B (en) Arbitrary serial time sequence generation method based on graphical control
CN103176759A (en) BIOS POST code display system and BIOS POST code display method
RU194203U1 (en) FPGA-based NAND memory chip testing device
CN103869275B (en) A kind of measuring accuracy calibration steps of single-phase intelligent electric energy meter
CN216287519U (en) Drive chip test circuit and system
US20130300457A1 (en) Non-binary decoder architecture and control signal logic for reduced circuit complexity
CN1845211A (en) PIC single-chip microcomputer experiment system
CN104038380A (en) Server motherboard detection system and method
CN111953333A (en) Array type MEMS sensor SPI parallel data acquisition circuit and acquisition method
JP2583055B2 (en) IC test system
CN218631105U (en) Experiment training board for measurement and control experiment teaching
CN221148817U (en) Avionics product comprehensive discrete quantity measurement system
CN218099251U (en) Programmable small-sized AMOLED module
CN220983437U (en) Device is surveyed simultaneously to reliability of camera motor driver chip
CN115361509B (en) Method for simulating dynamic vision sensor array by using FPGA
CN1892614A (en) Computer internal-memory detection method
CN110837449B (en) UVM-based onewire communication special verification platform and method

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