Sensor device with sampling function, and sensor data processing system using same
09534923 ยท 2017-01-03
Assignee
Inventors
- Masaya Yamashita (Tokyo, JP)
- Shiro Kobayashi (Tokyo, JP)
- Osamu Koizumi (Tokyo, JP)
- Yuko Akagi (Tokyo, JP)
Cpc classification
G01C23/00
PHYSICS
G01C19/00
PHYSICS
International classification
G01C23/00
PHYSICS
G01C19/00
PHYSICS
Abstract
The sensor device includes a counter for counting the number of count commands used to perform measurements while maintaining among multiple sensor devices the ratio of measurement intervals; a ratio-holding-unit for setting the ratio to a desired ratio and holding respective values of the ratio for each of the multiple sensor devices; a sampling-timing-generating-unit for receiving a count value of the counter and the setting value of the ratio held by the ratio-holding-unit, and for generating a sampling timing signal based on the comparison result between the count value and the setting value; and a sampling-unit for sampling a detection signal detected by the detecting unit, by using the sampling timing signal generated by the sampling-timing-generating-unit.
Claims
1. A sensor device with sampling functionality comprising: a counter for counting the number of count commands for performing measurements while maintaining among multiple sensor devices a ratio of measurement intervals; a ratio-of-measurement-intervals-holding-unit for holding a setting value of desired ratio of measurement intervals; a sampling-timing-generating-unit for generating sampling timing signal from count value of the counter and the setting value of the ratio of measurement intervals which value is held by the ratio-of-measurement-intervals-holding-unit, based on the comparison result between the count value and the setting value; and a sampling-unit for starting, according to the sampling timing signal generated by the sampling-timing-generating-unit, the sampling of detected signals of various types of information detected by detecting-unit.
2. The sensor device with sampling functionality according to claim 1, wherein a delay-time-holding-unit, which holds desired measurement start delay time, is connected to the sampling-timing-generating-unit so that the start of sampling in the sampling-unit triggered by the sampling timing signal is delayed.
3. The sensor device with sampling functionality according to claim 1, wherein the sensor device is equipped with: detecting-unit-operation-start-time-holding-unit for holding operation start time information of the detecting-unit; and detecting-unit-operation-controlling-unit for receiving the count value from the counter and the operation start time information of the detecting-unit from the detecting-unit-operation-start-time-holding-unit.
4. The sensor device with sampling functionality according to claim 1, wherein the sensor device is equipped with count-command-generating-unit for generating the count command, and when using the count command generated by the count-command-generating-unit, the sensor device is capable of outputting the count command to the outside while inputting the count command to the counter.
5. The sensor device with sampling functionality according to claim 4, wherein an interface for outputting the count command generated by the count-command-generating-unit to the outside and an interface for receiving the count command from the outside are a single interface.
6. The sensor device with sampling functionality according to claim 5, wherein the interface for outputting the count command generated by the count-command-generating-unit to the outside and the interface for receiving the count command from the outside are a single interface; and the single interface is an I2C bus.
7. The sensor device with sampling functionality according to claim 5, wherein the interface for outputting the count command generated by the count-command-generating-unit to the outside and the interface for receiving the count command from the outside are a single interface; and the single interface is a SPI bus.
8. The sensor device with sampling functionality according to claim 5, wherein the sensor device is switchable between an operation mode in which the count command generated by the count-command-generating-unit is inputted into the counter and another operation mode in which the count command received from the outside is inputted into the counter.
9. A sensor data processing system wherein, the sensor device according to claim 1 and a sensor-data-processing-unit are combined, and the sensor-data-processing-unit has functionalities of setting the ratio of measurement intervals, and transmitting information on the ratio of measurement intervals and the count command to the sensor devices; and functionality of receiving data from the sensor devices.
10. A sensor data processing system wherein, the sensor device according to claim 1 and a sensor-data-processing-unit are combined, and a master device connected to the sensor-data-processing-unit has functionalities of setting the ratio of measurement intervals, and transmitting information on the ratio of measurement intervals and the count command to the sensor devices; and functionality of receiving data from the sensor devices.
11. A sensor data processing system wherein, the sensor device according to claim 1 and a sensor-data-processing-unit are combined, the sensor-data-processing-unit has functionalities of setting the ratio of measurement intervals and the like, and transmitting information on the ratio of measurement intervals to the sensor devices; and functionality of receiving data from the sensor devices, and one of the sensor devices generates and outputs the count command.
12. A sensor data processing system wherein, the sensor device according to claim 1 and a sensor-data-processing-unit are combined, the sensor data processing system comprises external periodic-signal-generating-unit for generating the count command, the count command is transmitted from the periodic-signal-generating-unit to the sensor devices, and the sensor-data-processing-unit has functionalities of setting the ratio of measurement intervals, and transmitting information on the ratio of measurement intervals to the sensor devices; and functionality of receiving data from the sensor devices.
13. A sensor data processing system wherein, the sensor device according to claim 1 and a sensor-data-processing-unit are combined, the sensor data processing system comprises an external periodic-signal-generating-unit for generating the count command, the count command is transmitted from the periodic-signal-generating-unit to the sensor devices, and is received by the sensor devices and the sensor-data-processing-unit, each sensor devices autonomously perform measurements according to the respective set ratio of measurement intervals by referring to the count command, the sensor-data-processing-unit counts the number of the received count commands and obtains data from the sensor devices when the number of the received count commands reaches a set number.
Description
BRIEF DESCRIPTION OF DRAWINGS
(1)
(2)
(3)
(4)
(5)
(6)
(7)
(8)
(9)
(10)
(11)
(12)
(13)
(14)
(15)
(16)
(17)
(18)
(19)
(20)
(21)
(22)
(23)
(24)
(25)
(26)
(27)
(28)
(29)
(30)
(31)
(32)
(33)
(34)
(35)
(36)
(37)
DESCRIPTION OF EMBODIMENTS
(38) Embodiments of the present invention are described below with reference to the drawings.
Embodiment 1
(39)
(40) The sensor device 51 in Embodiment 1 of the present invention includes: the counter 511 for counting the number of count commands which are used to perform measurements while maintaining a ratio of measurement intervals among multiple sensor devices; a ratio-of-measurement-interval-holding-unit 512 for setting the ratio of measurement intervals to a desired ratio of measurement intervals and holding respective values of the ratio of measurement intervals for each of the multiple sensor devices. The sensor device 51 also includes: the sampling-timing-generating-unit 513 for receiving a count value of the counter 511 and the setting value of the ratio of measurement intervals which is held by the ratio-of-measurement-interval-holding-unit 512, and for generating a sampling timing signal based on the comparison result between the count value and the setting value; and the sampling-unit 515 for sampling of detected signals detected by the detecting-unit 514, by using the sampling timing signal generated by the sampling-timing-generating-unit 513. Measurement data from the sensor device 51 is sent to a CPU (not illustrated) and is subjected to signal processing.
(41)
(42) Each of the sensor devices operates by using an independent internal clock (clk) of 1 KHz having an accuracy of plus or minus 10%. Moreover, the sensor device 1 holds the value of 1, the sensor device 2 holds the value of 2, and the sensor device 3 holds the value of 3, as the ratio of measurement interval (s2). Furthermore, a common count command (trg) of 100 Hz is inputted to the sensor devices. In this example, the count command is a signal of one bit. Each of the sensor devices fetches the count command by using its internal clock and generates an internal count command (trg_sync) which becomes active for one clock period. Furthermore, a value of the count command counter (trg_count and s1) is incremented by one every time the internal count command becomes active. When the value of the count command counter matches the value of the ratio of measurement interval (s2) minus 1, the value of the count command counter is reset to 0 by a count command counter reset signal (s3). When the internal count command becomes active with the count command counter being reset, an internal basic sampling signal (smpl_org) becomes active for one clock period, and this signal becomes a sampling signal (s4) which is the output of the sampling-timing-generating-unit 513.
(43) This configuration makes it possible to arbitrary set the ratio of measurement interval among multiple sensor devices, and to autonomously perform measurements while maintaining the set ratio of measurement interval among multiple sensor devices.
(44)
(45) In Embodiment 1, the ratio of measurement interval of the first sensor device is 1, the ratio of measurement interval of the second sensor device is 1, and the ratio of measurement interval of the third sensor device is 2. Here, if a measurement cycle t1 is set to T in the first sensor device, measurement cycles t2 will be set to T in the second sensor device, and measurement cycles t3 will be set to 2T in the third sensor device. In the sensor devices of the conventional techniques, the variation in clock rate causes a deviation of the measurement cycles. Thus, the measurement cycle t1 is not exactly T, the measurement cycle t2 is not exactly T, and the measurement cycle t3 is not exactly 2T, and the ratio of measurement interval eventually deviates as time elapses. Moreover, in a case where there is a deviation of activation time, the measurement timings also deviate from each other. This state is shown in a left portion of
(46) As described above, in the configuration of Embodiment 1 as shown in
Embodiment 2
(47) In the aforementioned example of Embodiment 1, the measurements are performed while maintaining the ratio of measurement intervals as well the measurement timings being matched within the range of variations of respective clocks of each sensor devices. However, as described in the problems to be solved by the present invention, a case where measurement timings are deliberately shifted from one another among sensor devices is conceivable. Hence, it is important that delays for measurement timings can be set.
(48)
(49) The sensor device 61 in Embodiment 2 of the present invention includes: the counter 611 for counting the number of count commands which are used to perform measurements while maintaining a ratio of measurement intervals among multiple sensor devices; a ratio-of-measurement-interval-holding-unit 612 for setting the ratio of measurement intervals to a desired ratio of measurement intervals and holding respective values of the ratio of measurement intervals for each of the multiple sensor devices. The sensor device 61 also includes: the sampling-timing-generating-unit 613 for receiving a count value of the counter 611 and the setting value of the ratio of measurement interval which is held by the ratio-of-measurement-interval-holding-unit 612, and for generating a sampling timing signal after the delay time held by the delay-time-holding-unit 616 elapses from a time point of matching of the count value and the setting value; and the sampling-unit 615 for sampling detected signal detected by the detecting-unit 614, by using the sampling timing signal generated by the sampling-timing-generating-unit 613.
(50) Specifically, the delay-time-holding-unit 616 for holding a desired measurement start delay time is connected to the sampling-timing-generating-unit 613 to delay the start of the sampling of the sampling-unit 615 by the sampling timing signal. Measurement data from the sensor device 61 is sent to a CPU (not illustrated) and is subjected to signal processing.
(51) In this configuration, the delay-time-holding-unit 616 holding the desired delay time and the sampling-timing-generating-unit 613 generates the timing of the sampling start after the elapse of the delay time, on the basis of the count value and the held ratio of measurement interval.
(52)
(53) Each of the sensor devices operates by using an independent internal clock (clk) of 1 KHz having an accuracy of plus or minus 10%. Moreover, the sensor device 1 holds value of 5, the sensor device 2 holds value of 5, and the sensor device 3 holds value of 5 as the ratio of measurement interval (s2). Delay time information (a1 and a2) is information for determining the final sampling timing and is specified as delay times from an internal basic sampling signal (smpl_org). Here, a delay time (a1) is a value indicating the number of count commands by which the sampling is delayed from the internal basic sampling signal. Meanwhile, a delay time (a2) is a value indicating the number of clocks by which the sampling is further delayed after the delay of a1 count commands. In this example, the sensor device 1 holds value of 0, the sensor device 2 holds value of 1, and the sensor device 3 holds value of 2 as the delay time a1 (in 0, the sensor device operates without a delay). Moreover, the sensor device 1 holds value of 0, the sensor device 2 holds value of 0, and the sensor device 3 holds value of 0 as the delay time a2. Furthermore, a common count command (trg) of 100 Hz is inputted to the respective sensor devices. In this example, the count command is a signal of one bit.
(54) Each of the sensor devices fetches the count command by using its internal clock and generates an internal count command (trg_sync) which becomes active for one clock period. Furthermore, a value of the count command counter (trg_count and s1) is incremented by one every time the internal count command becomes active. When the value of the count command counter matches the value of the ratio of measurement interval (s2) minus 1, the value of the count command counter is reset to 0 by a count command counter reset signal (s3). When the internal count command becomes active with the count command counter being reset, an internal basic sampling signal (smpl_org) becomes active for one clock period. A sampling signal (smpl_trg_dly and s4), which becomes active for one clock period after a2 times of clock ticks during the a1-th active period of internal count command from a timing at which the internal basic sampling signal becomes active, becomes the output from the sampling-timing-generating-unit 613.
(55)
Embodiment 3
(56)
(57) The sensor device 71 in Embodiment 3 of the present invention includes: the counter 711 for counting the number of count commands used to perform measurements with holding a ratio of measurement interval in multiple sensor devices; the ratio-of-measurement-interval-holding-unit 712 for setting the ratio of measurement interval to a desired ratio of measurement interval and hold a setting value of the ratio of measurement interval in such a way that the multiple sensor devices each correspond to the setting value; and the detecting-unit-operation-start-time-holding-unit 716 for holding desired operation start time information of the detecting-unit. The sensor device 71 also includes: the detecting-unit-operation-controlling-unit 717 for controlling an operation of the detecting-unit 714 on the basis of a count value from the counter 711 and operation start time information of the detecting-unit from the detecting-unit-operation-start-time-holding-unit 716; the sampling-timing-generating-unit 713 for receiving the count value of the counter 711 and the setting value of the ratio of measurement interval which is held by the ratio-of-measurement-interval-holding-unit 712 and to generate a sampling timing signal after matching of the count value and the setting value; and the sampling-unit 715 for sampling a detection signal detected by the detecting-unit 714, by using the sampling timing signal generated by the sampling-timing-generating-unit 713. Measurement data from the sensor device 71 is sent to a CPU (not illustrated) and is subjected to signal processing.
(58)
(59) Each of the sensor devices operates by using an independent internal clock (clk) of 1 KHz having an accuracy of plus or minus 10%. Moreover, the sensor device1 holds values 5, the sensor device 2 holds values of 5, and the sensor device 3 holds values of 5 as the ratio of measurement interval (s2). The detecting-unit operation start time information (a1 and a2) is information for determining a operation start time of the determination-unit and is specified as delay times from the internal basic sampling signal (smpl_org and s4). Here, a delay time (a1) is a value indicating the number of count commands by which the operation start is delayed from the internal basic sampling signal. Meanwhile, a delay time (a2) is a value indicating the number of clocks by which the operation start is further delayed after the delay of a1 count commands. In this example, the sensor device 1 hold value of 0, the sensor device 2 holds value of 1, and the sensor device 3 hold value of 2 as the delay time a1. Moreover, the sensor device 1 hold value of 0, the sensor device 2 holds value of 0, and the sensor device 3 holds value of 0 as the delay time a2. Furthermore, a common count command (trg) of 100 Hz is inputted to the respective sensor devices. In this example, the count command is a signal of one bit.
(60) Each of the sensor devices fetches the count command by using its internal clock and generates an internal count command (trg_sync) which becomes active for one clock cycle. Furthermore, a value of the count command counter (trg_count and s1) is incremented by one every time the internal count command becomes active. When the value of the count command counter matches 1 of the value of the ratio of measurement interval (s2), the value of the count command counter is reset to 0 by a count command counter reset signal (s3). When the internal count command becomes active with the count command counter being reset, an internal basic sampling signal (smpl_org) becomes active for one clock cycle. This signal becomes a sampling signal (s4) which is an output of the sampling-timing-generating-unit 713.
(61) The detecting-unit-operation-controlling-unit 717 detects a timing of a2 times of clock operation from the timing at which the a1-th internal count command from the activation timing of the sampling signal becomes active, and the operation of the detecting-unit 714 is started at this timing. Thereafter, the detecting-unit 714 is paused at the completion of the next sampling (for example, at a falling edge of the sampling signal) and is made to wait until start timing of the next operation.
(62)
(63) It is possible to start the operation of the detecting-unit earlier than the sampling timing by a set time and thereby start the sampling at the sampling timing without a delay. Moreover, the detecting-unit can be set to a pause mode in times other than the sampling timing.
Embodiment 4
(64)
(65) The sensor device 81 in Embodiment 4 of the present invention includes: the counter 811 for counting the number of count commands which are used to perform measurements while maintaining a ratio of measurement interval among multiple sensor devices; the count-command-generating-unit 816 for generating a count command; and the count command output controlling-unit 817 for determining whether to use the generated count command as a count command for synchronization among the sensor devices. The sensor device 81 also includes: the ratio-of-measurement-interval-holding-unit 812 for setting the ratio of measurement interval to a desired ratio of measurement intervals and holding a respective value of the ratio of measurement intervals for each of multiple sensor devices; the sampling-timing-generating-unit 813 for receiving a count value of the counter 811 and the setting value of the ratio of measurement intervals which is held by the ratio-of-measurement-interval-holding-unit 812 and for generating a sampling timing signal based on the comparison result between count value and the setting value; and the sampling-unit 815 for sampling of detected signals detected by the detecting-unit 814, by using the sampling timing signal generated by the sampling-timing-generating-unit 813. Measurement data from the sensor device 81 is sent to a CPU (not illustrated) and is subjected to signal processing.
(66) Specifically, the count-command-generating-unit 816 for generating the count command is provided and, in a case where the count command generated by the count-command-generating-unit 816 is used, the sensor device 81 can output the count command to the outside while inputting the count command to the counter 811. The count command output controlling-unit (SW1) 817 is provided between a count command output terminal and the count-command-generating-unit 816, and a line between a count command input terminal and the counter 811 and a line between the count command output terminal and the count-command-generating-unit 816 are connected to each other.
(67) This configuration makes it possible to arbitrarily set and to hold the ratio of measurement interval the respective sensor devices as in sensor data processing systems shown in
(68)
(69) The sensor device in the modified example of Embodiment 4 of the present invention can implement two operations to perform measurement while holding the ratio of measurement interval in the multiple sensor devices. First, in a case where the sensor device operates as the master for synchronizing the sensor devices (SW1 is set to ON), the sensor device can output the count command generated by count command generating means therein to the outside while inputting the count command to the counter. In this case, the direction of a count command input-output interface is output of the command. Next, in a case where the sensor device operates in synchronization with the other sensor devices according to a master outside the sensor device (SW1 is set to OFF), the sensor device inputs, to the counter, the count command received from the outside via the count command input-output interface. In this case, the direction of the count command input-output interface is input of the command.
(70) In other words, an interface for outputting the count command generated by the count-command-generating-unit 816 to the outside and an interface for receiving the count command from the outside are a single interface.
(71) In this configuration, the sensor device requires no separate interfaces for input and output and it is possible to implement in a simpler configuration than the same functions as those of the configuration shown in
(72)
(73) The sensor device in the other modified example of Embodiment 4 can implement three operations to perform measurement while holding the ratio of measurement interval in the multiple sensor devices. First, in a case where the sensor device operates as the master for synchronizing the sensor devices (SW1 and SW2 are both set to ON), the sensor device can output the count command generated by count-command-generating-unit 816 therein to the outside while inputting the count command to the counter. In this case, the direction of the count command input-output interface is the output of the command. Next, in a case where the sensor device operates in synchronization with the other sensor devices according to the master outside the sensor device (SW1 is set to OFF, SW2 is set to ON), the sensor device inputs, to the counter 811, the count command received from the outside via the count command input-output interface. In this case, the direction of the count command input-output interface is the input of the command. Moreover, in a case where the sensor device operates independently without being synchronized with the other sensor devices (SW1 is ON, SW2 is OFF), the sensor device inputs the count command generated by the count-command-generating-unit 816 therein to the counter 811. However the sensor device does not output this command to the outside. In this case, the count command input-output interface is disconnected from the count-command-generating-unit 816 and the counter 811 in the sensor device.
(74) This configuration makes it possible to achieve multiple master-slave configurations by switching the operation modes of the respective sensor devices, even in a state where physical connections among the multiple sensor devices are fixed.
(75) In other words, the sensor device is switchable between an operation mode in which the count command generated by the count-command-generating-unit 816 is inputted to the counter 811 and an operation mode in which the count command received from the outside is inputted to the counter 811.
(76) Moreover, the interface for outputting the count command generated by the count-command-generating-unit 816 to the outside and the interface for receiving the count command from the outside may be the single interface, and the single interface may be an I2C bus. I2C is a serial bus used in embedded systems, mobile phones, and the like and stands for Inter-Integrated Circuit, generally written I2C and called I-two-C. A data processing system using the I2C bus is shown in
(77) Alternatively, the interface for outputting the count command generated by the count-command-generating-unit 816 to the outside and the interface for receiving the count command from the outside may be the single interface, and the single interface may be an SPI bus. SPI stands for Serial Peripheral Interface and is a bus connecting devices used in a computer. The SPI bus is a type of serial bus which requires fewer connection terminals than a parallel bus and is used for devices performing data transfer at relatively low speeds. A data processing system using the SPIC bus is shown in
(78)
(79)
(80)
(81) As described above, it is possible to provide the sensor device with sampling functionality which allows the ratio of measurement interval in the multiple sensor devices to be arbitrary set and to be held and which can autonomously perform measurements while holding the set ratio of measurement interval in the respective sensor devices.
(82)
Embodiment 5
(83)
(84) Here, the MCU (Micro Controller-Unit; Micro Controller) refers to an embedded microprocessor in which a computer system is integrated into one integrated circuit. The MCU is used mainly for control of electronic equipments and the like. Unlike common microprocessors, many peripheral functions including memory such as ROM and RAM, functions related to I/O, and similar functions are mounted in the MCU itself. Accordingly, the cost for constructing a system can be suppressed compared to the case where ROM and the like are mounted as independent parts. In the present invention, the MCU functions as the sensor-data-processing-unit.
(85) Embodiment 5 includes sensor devices 101, 102, and 103 having the functions of the present invention and the MCU 110 connected to the sensor devices 101, 102 and 103. The MCU 110 has: a function of setting the ratio of measurement interval and the like and transmitting information on the setting to the sensor devices 101, 102, and 103; a function of generating a count command and transmitting the count command to the sensor devices 101, 102, and 103; and a function of receiving data from the sensor devices 101, 102, and 103.
(86)
(87) The sensor devices 101, 102, and 103 and the MCU 110 has I2C interfaces and perform communication each other by I2C. The MCU 110 sets the ratio of measurement interval and transmits the set ratio to the sensor devices 101, 102, and 103. The sensor devices 101, 102, and 103 each have a broadcast address in addition to a unique address and simultaneously receive the count command transmitted from the MCU 110 by using the broadcast address. Each of the sensor devices 101, 102, and 103 autonomously performs a measurement at the set ratio of measurement interval according to the count command and sets an interrupt flag after completing the measurement. The MCU 110 fetches data upon detecting the interrupt flag of the measurement completion.
Embodiment 6
(88)
(89) Embodiment 6 includes sensor devices 101, 102, and 103 having the functions of the present invention, a master device 111 connected to the sensor devices 101, 102 and 103, and a MCU 110 capable of transmitting and receiving data to and from the master device 111 and setting a ratio of measurement interval and the like. The master device 111 has: a function of transmitting information on the ratio of measurement interval and the like which is obtained from the MCU 110, to the sensor devices 101, 102, and 103; a function of generating a count command and transmitting the count command to the sensor devices 101, 102, and 103; a function of receiving data from the sensor devices 101, 102, and 103; and a function of transmitting and receiving data to and from the MCU 110.
Embodiment 7
(90)
(91) Embodiment 7 includes sensor devices 101, 102, and 103 having the functions of the present invention and a MCU 110 connected to the sensor devices 101, 102 and 103. The MCU 110 has: a function of setting a ratio of measurement interval and the like and transmitting the information on the setting to the sensor devices 101, 102, and 103; and a function of receiving data from the sensor devices 101, 102, and 103. However, the MCU 110 does not have a function of generating a count command. One of the sensor devices generates and outputs the count command.
(92)
(93) Specifically, in the embodiment, the sensor devices each have a common slave address for broadcast in addition to a unique slave addresses. Moreover, the MCU may also have this common slave address. First, in order to set the ratio of measurement interval in the respective sensor devices, the MCU 110 becomes an I2C master and starts data transmission in a write mode to each of the sensor devices by using the unique address of the sensor device.
(94) Next, in order to give an instruction to one of the sensor devices to generate the count command, the MCU becomes the I2C master and starts data transmission in the write mode for the corresponding sensor device by using the unique address of this sensor device. Thereafter, the sensor device instructed to generate the count command becomes the I2C master by a timing managed by itself and starts data transmission in the write mode to the common broadcast address, as the count command. The sensor devices simultaneously receive the count command. Each of the sensor devices counts the number of the count commands transmitted from the sensor device being the I2C master and autonomously performs measurements at the set ratio of measurement interval.
(95) In a case where the MCU 110 has the common broadcast address, the MCU 110 knows the number of receptions of the count commands and can thus know a timing at which data is to be collected from each of the sensor devices on the basis of the information on the number of receptions. Accordingly, the MCU 110 becomes the I2C master at an appropriate timing to correct the data and starts data transmission in a read mode to each of the sensor devices by using the address unique to the sensor device. This causes the designated sensor device to transmit measurement data to the MCU 110, and the MCU 110 can thereby collect measurement data.
(96) Moreover, each of the sensor devices can notify measurement completion to the MCU 110. Setting an interrupt flag, the sensor device becoming the I2C master and starting data transmission in a MCU write mode, and the like are conceivable as means of notification. The MCU 110 fetches the data upon detecting the notification of measurement completion. Moreover, each of the sensor devices can automatically transmit the measurement data by becoming the I2C master and giving an instruction of data transmission in the MCU write mode.
(97)
(98) In the embodiment, the sensor devices are connected in cascade to the MCU (CPU) 110 and a slave select signal line (SS) and a serial clock signal line (SCK) are shared by the respective sensor devices. In this configuration, setting registers and data registers of the respective sensor devices appear as one long shift register when viewed from the MCU 110.
(99) First, in order to set the ratio of measurement interval in the respective sensor devices, the MCU 110 becomes a SPI master. At this time, a serial clock signal terminal (SCK) of the MCU 110 is an output terminal. Moreover, slave select signal terminals (SS) and serial clock signal terminals (SCK) of the sensor devices are all input terminals. The MCU 110 activates a slave select signal line (SS) shared by the sensor devices through a CTRL terminal. The slave select signal is also inputted to the slave select signal terminal (SS) of the MCU 110 itself. However, the operation of the MCU 110 is not affected at all because the MCU 110 is operating as the SPI master at this point.
(100) In this state, the MCU 110 accesses a register chain in which the setting registers of all of the sensor devices are connected in cascade, by using a serial clock signal terminal and a serial output signal terminal, and sets the ratio measurement interval. Moreover, the MCU 110 sets an instruction for one of the sensor devices to generate the count command and sets the desired timing of transmission of the measurement data (specifies the number of counts before the transmission) and the desired number of pieces of measurement data to be transmitted.
(101) After the operations up to this point are completed, the MCU 110 cancels the master state and sets itself to a slave mode. In a state from this point forward, the serial clock signal terminal (SCK) of the MCU 110 is an input terminal. Moreover, the sensor device set to generate the count command changes its slave select signal terminal (SS) and its serial clock signal terminal (SCK) to output terminals.
(102) The sensor device set to generate the count command becomes the SPI master by a timing managed by itself and outputs the count command to the slave select signal line (SS). The count command is, for example, a falling edge of the slave select signal line (SS). This count command is simultaneously received by the sensor devices. Each of the sensor devices counts the number of the count commands and autonomously performs measurement at the set ratio of measurement interval.
(103) Moreover, upon detecting the set timing of transmission of the measurement data, the sensor device set to generate the count command transmits a clock signal corresponding to the number of pieces of measurement data to be transmitted, to the serial clock signal line (SCK), with the slave select signal line (SS) being activated. The pieces of measurement data are thereby sequentially transferred to the MCU from the register chain in which the data registers of all of the sensor devices are connected in cascade, and the MCU can thus collect the desired measurement data.
(104) In the SPI bus configuration in which the sensor devices are connected in cascade, data can be transmitted from the MCU 110 to the sensor devices at a timing at which data is transmitted from the sensor devices to the MCU 110. Accordingly, in a case where the MCU 110 desires to change the configuration of the measurement data, the MCU 110 can regain the authority of the SPI master from the sensor device by transmitting desired setting information.
Embodiment 8
(105)
(106) Embodiment 8 includes sensor devices 101, 102, and 103 having the functions of the present invention, a MCU 110 connected to the sensor devices 101, 102 and 103, and an external periodic-signal-generating-unit 112 for generating a count command. The periodic-signal-generating-unit 112 transmits the count command to the sensor devices 101, 102, and 103. The MCU 110 has: a function of setting a ratio of measurement interval and the like and transmitting the information on the setting to the sensor devices 101, 102, and 103; and a function of receiving data from the sensor devices 101, 102, and 103.
Embodiment 9
(107)
(108) Embodiment 9 includes: sensor devices 101, 102, and 103 having the functions of the present invention, a MCU 110 connected to the sensor devices 101, 102 and 103, and an external periodic-signal-generating-unit 112 configured to generate a count command. The MCU 110 sets a ratio of measurement interval and transmits information on the setting to the sensor devices 101, 102, and 103. Lines for count command reception are provided and the count command is transmitted from the external periodic-signal-generating-unit 112 to the sensor devices 101, 102, and 103. The sensor devices 101, 102, and 103 and the MCU 110 receives the count command. Each of the sensor devices 101, 102, and 103 autonomously performs measurements at the set ratio of measurement interval according to the count command. The MCU 110 counts the number of received count commands and fetches data from each of the sensor devices 101, 102, and 103 when the number reaches a set number.
(109) As described above, it is possible to provide the sensor data processing system using the sensor devices with sampling functionality which allow the ratio of measurement interval in the multiple sensor devices to be arbitrary set and to be held and which can autonomously perform measurements while holding the set ratio of measurement interval in the respective sensor devices.