Accessory and electronic device and control method thereof, communication system and storage medium
By introducing processors and memory into electronic device accessories, a data checksum correction mechanism is realized when the checksum is inconsistent, the problem of data correctness judgment in insufficient pins or miniaturization devices is solved, the control of slave devices is simplified and the reliability of data transmission is improved.
Patent Information
- Application Number
- CN202210429971.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Priority Date
- 2021-04-23
- Filing Date
- 2022-04-22
- Publication Date
- 2025-05-09
- Estimated Expiration
- 2042-04-22
AI Technical Summary
In electronic devices, especially when the number of microcomputer pins is insufficient or the device size is limited, the existing checksum mechanism cannot effectively judge the correctness of data, resulting in the complexity of the slave device structure and control, and the accuracy of the received data cannot be accurately judged.
An accessory is provided, equipped with a processor and memory. The checksum is calculated by the calculation unit, and the judgment unit judges the consistency of the checksum, and takes different measures when inconsistent, such as calculating an additional checksum or changing the output level of the communication terminal to ensure the accuracy of data transmission.
The structure and control process of the slave device are simplified, the reliability and accuracy of data transmission are improved, and complex additional communication components and retransmission processes are avoided.
Smart Images

Figure CN115242962B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to an accessory communicably connected to an electronic device, a control method and a storage medium thereof, an electronic device, a control method and a storage medium thereof, and a communication system including the electronic device and the accessory. Background Art
[0002] As a method of performing serial communication between electronic devices, one-way communication (e.g., I2C (registered trademark) communication) and two-way communication (e.g., SPI (registered trademark) communication) are conventionally used. Two electronic devices that perform serial communication with each other are classified into an electronic device that communicates by delivering a clock used for communication (hereinafter referred to as a "host device") and an accessory that communicates by receiving a clock from the host device (hereinafter referred to as a "slave device").
[0003] In each of the master device and the slave device, a method called a checksum can be used as a method for determining whether received data is correct. If the checksum in the slave device is inconsistent, the same communication can be performed again by sending a notification (slave request) other than serial communication from the slave device.
[0004] As a technique using a checksum, Japanese Patent Laid-Open No. 8-204709 discloses a method of making the time interval for sending data from a slave device to a host device different between the sent data and the checksum. In addition, Japanese Patent Laid-Open No. 2017-93712 discloses a method of comparing a received checksum with a calculated checksum, and discarding the received data when their respective values are different. In addition, Japanese Patent Laid-Open No. 5-158807 discloses a method of changing the address to which the checksum is to be written according to the number of times the checksum is written whenever the checksum is updated.
[0005] However, in the case where the number of pins of the microcomputer installed in the electronic device is insufficient, or in the case where the size of the electronic device is to be reduced, the slave request cannot be prepared sometimes. In such a device, in the case of an error that the received checksum value is inconsistent with the calculated checksum value in the slave device, other communication components are required to request the host device to resend the data. Therefore, the structure and control of the slave device become complicated. In addition, in the case where the slave device cannot use the checksum function, the host device and the slave device cannot judge whether the received data is correct. Summary of the invention
[0006] In a first aspect of the embodiment, an accessory is provided for sending data to and receiving data from an electronic device via serial communication, the accessory comprising: at least one processor; and a memory coupled to the at least one processor, the memory having instructions which, when executed by the processor, operate as the following units: a calculation unit configured to calculate a checksum; a judgment unit configured to judge whether a checksum received from the electronic device is consistent with a first checksum calculated by the calculation unit based on data received from the electronic device; a control unit configured to, if the checksum received from the electronic device is consistent with the first checksum, calculate a second checksum by the calculation unit, and if the checksum received from the electronic device is inconsistent with the first checksum, calculate a third checksum by the calculation unit; and a sending unit configured to send the second checksum or the third checksum according to the judgment result of the judgment unit.
[0007] In a second aspect of the embodiment, an accessory is provided for sending data to and receiving data from an electronic device via serial communication, the accessory comprising: at least one processor; and a memory coupled to the at least one processor, the memory having instructions which, when executed by the processor, operate as the following units: a calculation unit configured to calculate a checksum; a judgment unit configured to judge whether the checksum received from the electronic device is consistent with a first checksum calculated by the calculation unit based on the data received from the electronic device; a control unit configured to, if the checksum received from the electronic device is consistent with the first checksum, calculate a second checksum by the calculation unit, and, if the checksum received from the electronic device is inconsistent with the first checksum, notify the electronic device of a checksum error by changing an output level at a communication terminal used for the serial communication; and a sending unit configured to send the second checksum to the electronic device if the checksum received from the electronic device is consistent with the first checksum.
[0008] In a third aspect of the embodiment, an accessory is provided for sending data to and receiving data from an electronic device via serial communication, the accessory comprising: at least one processor; and a memory coupled to the at least one processor, the memory having instructions which, when executed by the processor, operate as the following units: a calculation unit configured to calculate a checksum; a judgment unit configured to judge whether the checksum received from the electronic device is consistent with a first checksum calculated by the calculation unit based on the data received from the electronic device; a control unit configured to, if the checksum received from the electronic device is consistent with the first checksum, calculate a second checksum by the calculation unit, and, if the checksum received from the electronic device is inconsistent with the first checksum, notify the electronic device of a checksum error by resuming communication with the electronic device; and a sending unit configured to send the second checksum to the electronic device if the checksum received from the electronic device is consistent with the first checksum.
[0009] In a fourth aspect of the embodiment, an accessory is provided for sending data to and receiving data from an electronic device via serial communication, the accessory comprising: at least one processor; and a memory coupled to the at least one processor, the memory having instructions which, when executed by the processor, operate as the following units: a calculation unit configured to calculate a checksum; a judgment unit configured to judge whether the checksum received from the electronic device is consistent with a first checksum calculated by the calculation unit based on the data received from the electronic device; a control unit configured to, if the checksum received from the electronic device is consistent with the first checksum, calculate a second checksum by the calculation unit, and if the checksum received from the electronic device is inconsistent with the first checksum, notify the electronic device of a checksum error by resetting the accessory; and a sending unit configured to, if the checksum received from the electronic device is consistent with the first checksum, send the second checksum to the electronic device.
[0010] In a fifth aspect of the embodiment, an accessory is provided for sending data to and receiving data from an electronic device via serial communication, the accessory comprising: a storage unit configured to store accessory information, the storage unit comprising: a first area configured to store a first checksum which is a checksum of the entire accessory information; and a second area configured to store a second checksum which is a checksum of a portion of the accessory information, wherein the first area is set to the end of an area in the storage unit for storing the accessory information, wherein the second area is set to a predetermined area in the storage unit other than the end of the area for storing the accessory information, and wherein the second checksum is a fixed value.
[0011] In a sixth aspect of the embodiment, an electronic device is provided for sending data to and receiving data from an accessory via serial communication, the electronic device comprising: at least one processor; and a memory coupled to the at least one processor, the memory having instructions which, when executed by the processor, operate as: a calculation unit configured to calculate a checksum of the data sent to the accessory; a sending unit configured to send the data and the checksum to the accessory; and a control unit configured to, during a communication of a predetermined number of bytes, send the data to the accessory again if the checksum received from the accessory after sending the checksum to the accessory indicates a checksum error.
[0012] In a seventh aspect of the embodiment, a communication system is provided, comprising: the above-mentioned accessory; and an electronic device, the electronic device comprising: at least one processor; and a memory coupled to the at least one processor, the memory having instructions, which when executed by the processor operate as the following units: a calculation unit, which is configured to calculate a checksum of data sent to the accessory; a sending unit, which is configured to send the data and the checksum to the accessory; and a control unit, which is configured to resend the data to be sent to the accessory when the third checksum is received from the accessory.
[0013] In an eighth aspect of the embodiment, a communication system is provided, comprising: the above-mentioned accessory; and an electronic device, the electronic device comprising: at least one processor; and a memory coupled to the at least one processor, the memory having instructions, which when executed by the processor operate as the following units: a calculation unit, which is configured to calculate a checksum of data sent to the accessory; a sending unit, which is configured to send the data and the checksum to the accessory; and a control unit, which is configured to resend the data to be sent to the accessory when the checksum error is notified from the accessory.
[0014] In a ninth aspect of the embodiment, a communication system is provided, comprising: the above-mentioned accessory; and an electronic device, the electronic device comprising: at least one processor; and a memory coupled to the at least one processor, the memory having instructions, which when executed by the processor operate as the following units: a calculation unit, which is configured to calculate a checksum of data sent to the accessory; a sending unit, which is configured to send the data and the checksum to the accessory; and a control unit, which is configured to resend the data to be sent to the accessory when the checksum error is notified from the accessory.
[0015] In a tenth aspect of the embodiment, a communication system is provided, comprising: the above-mentioned accessory; and an electronic device, the electronic device comprising: at least one processor; and a memory coupled to the at least one processor, the memory having instructions, which when executed by the processor operate as the following units: a calculation unit, which is configured to calculate a checksum of data sent to the accessory; a sending unit, which is configured to send the data and the checksum to the accessory; and a control unit, which is configured to resend the data sent to the accessory when the checksum error is notified from the accessory.
[0016] In an eleventh aspect of the embodiment, a communication system is provided, comprising: the above-mentioned accessory; and an electronic device, the electronic device comprising: at least one processor; and a memory coupled to the at least one processor, the memory having instructions, which when executed by the processor operate as the following units: a judgment unit, which is configured to obtain the first checksum during initial communication with the accessory, and to judge whether the accessory is compatible with the electronic device based on the received first checksum; and a control unit, which is configured to perform error handling if the accessory is incompatible with the electronic device.
[0017] In the twelfth aspect of the embodiment, a communication system is provided, comprising: the above-mentioned accessory; and an electronic device, the electronic device comprising: at least one processor; and a memory coupled to the at least one processor, the memory having instructions, which when executed by the processor operate as the following units: a judgment unit, which is configured to obtain the second checksum when an event occurs in the electronic device after communication is established with the accessory, and to judge whether the accessory is compatible with the electronic device based on the received second checksum; and a control unit, which is configured to perform error handling when the accessory is incompatible with the electronic device.
[0018] In a thirteenth aspect of the embodiment, a control method for an accessory is provided, wherein the accessory is used to send data to and receive data from an electronic device via serial communication, the control method comprising: calculating a first checksum based on data received from the electronic device; determining whether the checksum received from the electronic device is consistent with the first checksum; calculating a second checksum when the checksum received from the electronic device is consistent with the first checksum, and calculating a third checksum when the checksum received from the electronic device is inconsistent with the first checksum; and sending the second checksum or the third checksum based on the determination result.
[0019] In the fourteenth aspect of the embodiment, a control method for an accessory is provided, wherein the accessory is used to send data to and receive data from an electronic device via serial communication, the control method comprising: calculating a first checksum based on data received from the electronic device; determining whether the checksum received from the electronic device is consistent with the first checksum; calculating a second checksum when the checksum received from the electronic device is consistent with the first checksum, and sending the second checksum to the electronic device; and notifying the electronic device of a checksum error by changing the output level at the communication terminal used for the serial communication when the checksum received from the electronic device is inconsistent with the first checksum.
[0020] In a fifteenth aspect of the embodiment, a control method for an accessory is provided, wherein the accessory is used to send data to and receive data from an electronic device via serial communication, the control method comprising: calculating a first checksum based on data received from the electronic device; determining whether the checksum received from the electronic device is consistent with the first checksum; calculating a second checksum when the checksum received from the electronic device is consistent with the first checksum, and sending the second checksum to the electronic device; and notifying the electronic device of a checksum error by resuming communication with the electronic device when the checksum received from the electronic device is inconsistent with the first checksum.
[0021] In the sixteenth aspect of the embodiment, a control method for an accessory is provided, wherein the accessory is used to send data to and receive data from an electronic device via serial communication, the control method comprising: calculating a first checksum based on data received from the electronic device; determining whether the checksum received from the electronic device is consistent with the first checksum; calculating a second checksum when the checksum received from the electronic device is consistent with the first checksum, and sending the second checksum to the electronic device; and notifying the electronic device of a checksum error by resetting the accessory when the checksum received from the electronic device is inconsistent with the first checksum.
[0022] In the seventeenth aspect of the embodiment, a control method for an electronic device is provided, wherein the electronic device is used to send data to and receive data from an accessory via serial communication, the control method comprising: calculating a checksum of the data sent to the accessory; sending the data and the checksum to the accessory; and sending the data to the accessory again during a communication of a predetermined number of bytes if the checksum received from the accessory after sending the checksum to the accessory indicates a checksum error.
[0023] In an eighteenth aspect of the embodiment, a non-temporary computer-readable storage medium is provided for storing a program, wherein the program is used to enable a computer to execute a control method of an accessory, wherein the accessory is used to send data to and receive data from an electronic device via serial communication, the control method comprising: calculating a first checksum based on data received from the electronic device; determining whether the checksum received from the electronic device is consistent with the first checksum; calculating a second checksum if the checksum received from the electronic device is consistent with the first checksum, and calculating a third checksum if the checksum received from the electronic device is inconsistent with the first checksum; and sending the second checksum or the third checksum based on the determination result.
[0024] In the nineteenth aspect of the embodiment, a non-temporary computer-readable storage medium is provided for storing a program, wherein the program is used to enable a computer to execute a control method of an accessory, wherein the accessory is used to send data to and receive data from an electronic device via serial communication, the control method comprising: calculating a first checksum based on data received from the electronic device; determining whether the checksum received from the electronic device is consistent with the first checksum; calculating a second checksum when the checksum received from the electronic device is consistent with the first checksum, and sending the second checksum to the electronic device; and notifying the electronic device of a checksum error by changing the output level at the communication terminal used for the serial communication when the checksum received from the electronic device is inconsistent with the first checksum.
[0025] In the twentieth aspect of the embodiment, a non-temporary computer-readable storage medium is provided for storing a program, wherein the program is used to enable a computer to execute a control method of an accessory, wherein the accessory is used to send data to and receive data from an electronic device via serial communication, the control method comprising: calculating a first checksum based on data received from the electronic device; determining whether the checksum received from the electronic device is consistent with the first checksum; calculating a second checksum when the checksum received from the electronic device is consistent with the first checksum, and sending the second checksum to the electronic device; and notifying the electronic device of a checksum error by resuming communication with the electronic device when the checksum received from the electronic device is inconsistent with the first checksum.
[0026] In the twenty-first aspect of the embodiment, a non-temporary computer-readable storage medium is provided for storing a program, wherein the program is used to enable a computer to execute a control method of an accessory, wherein the accessory is used to send data to and receive data from an electronic device via serial communication, the control method comprising: calculating a first checksum based on data received from the electronic device; determining whether the checksum received from the electronic device is consistent with the first checksum; calculating a second checksum when the checksum received from the electronic device is consistent with the first checksum, and sending the second checksum to the electronic device; and notifying the electronic device of a checksum error by resetting the accessory when the checksum received from the electronic device is inconsistent with the first checksum.
[0027] In the twenty-second aspect of the embodiment, a non-temporary computer-readable storage medium is provided for storing a program, wherein the program is used to cause a computer to execute a control method for an electronic device, wherein the electronic device is used to send data to and receive data from an accessory via serial communication, the control method comprising: calculating a checksum of the data sent to the accessory; sending the data and the checksum to the accessory; and sending the data to the accessory again during a communication of a predetermined number of bytes, if the checksum received from the accessory after sending the checksum to the accessory indicates a checksum error.
[0028] Further features of the present invention will become apparent from the following description of exemplary embodiments (with reference to the attached drawings). BRIEF DESCRIPTION OF THE DRAWINGS
[0029] Figure 1 is a block diagram showing the respective electrical structures of the camera and accessories.
[0030] Figure 2A and Figure 2B is a diagram schematically showing waveforms of two types of SPI protocols of the SPI communication method.
[0031] Figure 3A and Figure 3B is a flow chart of operations performed by a camera controller and an accessory controller according to a first communication protocol.
[0032] Figure 4A and Figure 4B is a flow chart of operations performed by the camera controller and the accessory controller according to the second communication protocol.
[0033] Figure 5 is a diagram showing an example of an operation execution command issued from a camera to an accessory.
[0034] Figure 6 is a diagram showing an example of accessory information stored in an accessory.
[0035] Figure 7 is a sequence diagram showing processing performed by the accessory and the camera.
[0036] Figure 8 is a diagram showing an example of information indicating the type of accessory.
[0037] Fig. 9 This is a diagram for explaining the reason why a communication request signal is notified from the accessory to the camera.
[0038] Fig. 10A and Fig. 10B is a diagram showing an example of time intervals of communication bytes in SPI communication.
[0039] Fig.11 is a flowchart of a process performed by the camera after an accessory is installed.
[0040] Fig.12 is a flow chart of a process performed by a camera to activate a function of an accessory.
[0041] Fig.13 This is a flowchart of the processing performed by the accessory mounted on the camera.
[0042] Fig.14 is a diagram showing another example of an operation execution command issued from a camera to an accessory.
[0043] Fig.15 is a sequence diagram showing another example of a method for notifying a camera of an error from an accessory when a checksum error occurs.
[0044] Fig.16 is a sequence diagram showing a method for notifying the camera of an error from the accessory when a checksum error occurs according to the first embodiment.
[0045] Fig.17 is a diagram showing another example of accessory information stored in an accessory.
[0046] Fig.18 is a diagram showing an example of the content of I2C communication between a camera and an accessory.
[0047] Fig.19 is a block diagram showing the electrical structure of another accessory.
[0048] Fig. 20 It is shown Fig.19 A diagram of the accessory information stored in the accessory shown.
[0049] Fig.21A and Fig.21B is a diagram showing an example of the content of I2C communication between a camera and an accessory.
[0050] Fig.22A and Fig. 22B is a diagram showing an example of a waveform of I2C communication.
[0051] Fig.23 1 is a diagram showing processing performed by the camera controller when the camera controller sends NC byte data to the accessory controller.
[0052] Fig.24 is a diagram showing processing performed by the camera controller when the camera controller receives ND byte data from the accessory controller.
[0053] Fig.25is a diagram showing processing performed by the accessory controller when the camera controller and the accessory controller transmit and receive NE byte data. DETAILED DESCRIPTION
[0054] The present invention will be described in detail below with reference to the accompanying drawings showing embodiments of the present invention. Here, a camera apparatus is described as an electronic device according to the present invention. There is no particular limitation on accessories that can be communicatively connected to the camera apparatus as long as the accessories can communicate with the camera apparatus. As accessories, a lighting device (flash device, etc.), a display device (electronic viewfinder, etc.), an audio device (microphone device, etc.), etc. can be mentioned.
[0055] The camera apparatus and the accessory form a camera system (communication system) in which the camera apparatus serves as a master device and the accessory serves as a slave device.
[0056] Figure 1 1 is a block diagram showing the electrical configurations of an image pickup apparatus (hereinafter referred to as a “camera”) denoted by reference numeral 100 and accessories denoted by reference numeral 200. The camera 100 includes a camera controller A 101, a camera controller B 102, a battery 111, a system power supply unit 112, an image sensor 122, an image processor 123, a memory controller 124, a volatile memory 125, a recording memory 126, and a display section 127. Furthermore, the camera 100 includes a backlight section 128, an accessory power supply unit A 131, an accessory power supply unit B 132, a protection section 133, and a camera connection section 141.
[0057] The battery 111 supplies power to the components of the camera 100. The battery 111 is removably mounted on the camera 100. The camera controller A 101 and the camera controller B 102 are circuits (control units) each formed of a microcomputer including a CPU or the like. The camera controller A 101 monitors switches and the like of components as an operation section operated by a user, and operates even when the camera 100 is in a standby state, and performs power supply control and the like even in response to an operation by a user. The camera controller B 102 is responsible for control of the image sensor 122 and the display section 127 and the like. Note that the standby state refers to a state in which the power of the camera 100 is turned on but the power consumption of the camera 100 is suppressed (low power consumption mode). After the camera 100 is powered on, when a predetermined period of time has passed without any external operation on the camera 100, the camera 100 shifts to the standby state. Note that in the present embodiment, a configuration in which the camera controller A 101 and the camera controller B 102 are formed of respective separate processors is described, but both may be provided in a single processor.
[0058] The system power supply unit 112 includes a DC-DC converter circuit, a low dropout (LDO) circuit, a charge pump circuit, and the like, and generates power to be supplied to the components of the camera 100. The voltage of 1.8 V generated by the system power supply unit 112 is always supplied to the camera controller A 101 as a camera microcomputer power supply VMCU_C. In addition, several types of voltages generated by the system power supply unit 112 are supplied to the camera controller B 102 at desired timings as a microcomputer power supply VMCU2_C. By controlling the system power supply unit 112, the camera controller A 101 performs on / off control of power supply to the components of the camera 100.
[0059] The optical lens 121 (so-called interchangeable lens) is removably attached to the camera 100. Note that the optical lens 121 may be provided integrally with the camera 100 (not removably attached to the camera 100). Light (incident light) from a subject incident through the optical lens 121 forms an image on an imaging surface (imaging surface) of an image sensor 122 formed by a CMOS sensor or a CCD sensor or the like. Note that the optical lens 121 and the camera 100 may be formed integrally with each other. The image sensor 122 encodes the subject image (optical image) formed on the imaging surface into a digital imaging signal. The image processor 123 generates image data by performing noise reduction processing and white balance processing on the imaging signal, and converts the generated image data into an image file of a JPEG format or the like so as to store the image data in the recording memory 126. In addition, the image processor 123 generates VRAM image data for display on the display section 127 from the generated image data.
[0060] The memory controller 124 controls the transmission and reception of image data and other data generated by the image processor 123 and the like. The volatile memory 125 is a memory capable of high-speed reading and writing, such as DDR3 SDRAM, and is used for a workspace used for image processing performed by the image processor 123. The recording memory 126 is a recording medium such as an SD card and a CFExpress card that is removably attached to the camera 100 via a connection section not shown. The display section 127 is a display arranged on the back side of the camera 100, and is composed of an LCD panel or an organic EL display and the like. The backlight section 128 adjusts the brightness of the display section 127 by changing the backlight amount of the display section 127.
[0061] The accessory power supply unit A 131 and the accessory power supply unit B 132 convert the voltage supplied from the system power supply unit 112 into a predetermined voltage, and in the present embodiment, 3.3 V is generated as the accessory power supply VACC, but may be configured to convert the supplied voltage into a voltage other than this voltage. The accessory power supply unit A 131 is a small power supply unit including an LDO circuit and having a small self-consumption power. The accessory power supply unit B 132 is a power supply unit including a DC-DC converter and capable of supplying a larger current than the accessory power supply unit A 131. Note that the self-consumption power of the accessory power supply unit B 132 is greater than the self-consumption power of the accessory power supply unit A 131. Therefore, in the case where the load current is small, the accessory power supply unit A 131 is more efficient than the accessory power supply unit B 132. The camera controller A 101 controls the switching of the accessory power supply unit A 131 and the accessory power supply unit B 132 on / off according to the operation state of the accessory 200.
[0062] The protection section 133 is constituted by a current fuse element, a PolySwitch (registered trademark) device, or an electronic fuse circuit formed by combining a resistor, an amplifier, and a switch element, or the like. In a case where the value of the power supply current supplied from the accessory power supply unit A 131 and the accessory power supply unit B 132 exceeds a predetermined value and is therefore excessive (abnormal), the protection section 133 outputs an overcurrent detection signal DET_OVC. In the present embodiment, the protection section 133 is an electronic fuse circuit, and notifies the camera controller A 101 of the overcurrent detection signal DET_OVC when a current greater than 1A flows. The overcurrent detection signal DET_OVC is a signal indicating an overcurrent when the signal becomes high. Note that the predetermined value (current value) is not limited to 1A.
[0063] The camera 100 and the accessory 200 are electrically connected to each other through one-to-one contact between a plurality of contacts (terminals) TC01 to TC21 of the camera connecting portion 141 of the camera 100 and a plurality of contacts (terminals) TA01 to TA21 of the accessory connecting portion 211 of the accessory 200 .
[0064] The camera connection portion 141 is a connector for electrically connecting to the accessory 200 via 21 contacts TC01 to TC21 arranged in a row. The contacts TC01 to TC21 are arranged in this order from one end to the other end.
[0065] The contact TC01 as the third ground contact of the camera connection portion 141 is connected to the ground terminal (GND), and functions not only as a contact of a reference potential but also as a contact for controlling wiring impedance of the differential signal D1N and the differential signal D1P. The contact TC02 and the contact TC03 are connected to the camera controller B 102, and the differential signal D1N is connected to the contact TC02, and the differential signal D1P is connected to the contact TC03. The differential signal D1N and the differential signal D1P are differential data communication signals that form a pair for data communication. Note that the contact TC02, the contact TC03, the contacts TC07 to TC17, TC19, and TC20 are communication contacts.
[0066] Contact TC04 as a first ground contact is connected to the ground terminal, and serves as a contact for a reference potential of the camera 100 and the accessory 200. Accessory power VACC generated by the accessory power supply units A 131 and B 132 is connected to contact TC05 as a power supply contact via the protection section 133. Contact TC04 is arranged at a position outside of contact TC05 in the contact arrangement direction.
[0067] The accessory installation detection signal / ACC_DET is connected to the contact TC06 as the installation detection contact. The accessory installation detection signal / ACC_DET is pulled up to the camera microcomputer power supply VMCU_C via the resistance element Rp134 (for example, 10 kΩ). The camera controller A 101 can detect whether the accessory 200 is installed by reading the level of the accessory installation detection signal / ACC_DET. In the case where the level (potential) of the accessory installation detection signal / ACC_DET is at a high level (a predetermined potential or higher), it is detected that the accessory is not installed, and in the case where the level (potential) is at a low potential (GND potential), it is detected that the accessory 200 is installed.
[0068] A change in the signal level of the accessory mounting detection signal / ACC_DET from a high level to a low level that occurs when the camera 100 is powered on serves as a trigger for performing various communications between the camera 100 and the accessory 200 via the contact point.
[0069] The camera controller A 101 supplies power to the accessory 200 via the contact TC05 serving as a power contact, upon detection of the attachment of the accessory 200.
[0070] The SCLK signal, MOSI signal, MISO signal, and CS signal connected to the contact TC07, the contact TC08, the contact TC09, and the contact TC10 are signals used for SPI communication which is a kind of serial communication performed by the camera controller B 102 as a communication host. In the present embodiment, it is assumed that the SPI communication is performed with a communication clock frequency of 1 MHz, a data length of 8 bits (1 byte), a bit order of MSB first, and a full-duplex communication method.
[0071] In the present embodiment, it is assumed that the camera 100 and the accessory 200 are compatible with two types of SPI communication methods. The first communication protocol is a method in which the camera 100 does not check whether the accessory 200 is in a state capable of communication before outputting an SCLK signal, and this method is hereinafter referred to as "SPI protocol A".
[0072] Figure 2A Schematically shows the waveform of the communication of SPI protocol A. Figure 2A In the timing A1, the CS signal is low active (activated when at a low level). At timing A1, the camera controller B 102 changes the CS signal to a low level, thereby requesting the accessory controller 201 to perform SPI communication. At timing A2 when a predetermined period of time T_CS has passed after the timing A1, the camera controller B 102 starts to output the SCLK signal and the MOSI signal. Similarly, when the accessory controller 201 of the accessory 200 (the details of which will be described below) detects a falling edge of the SCLK signal, the accessory controller 201 starts to output the MISO signal.
[0073] The camera controller B 102 stops outputting the SCLK signal at timing A3 when the output of the SCLK signal for 1 byte of data is completed. Then, the camera controller B 102 suppresses outputting the SCLK signal until a predetermined period of time T_INTERVAL has elapsed from timing A3, and restarts outputting the SCLK signal at timing A4 when the predetermined period of time T_INTERVAL has elapsed to communicate the next byte.
[0074] Figure 3A 1 is a flowchart for explaining the operation performed by the camera controller B 102 according to the SPI protocol A. Figure 3A In the embodiment, each processing operation (step) indicated by an S number is realized by the CPU of the camera controller B 102 loading a predetermined program stored in a ROM (not shown) of the camera controller B 102 into a RAM (not shown) thereof.
[0075] In step S101, the camera controller B 102 stores a value indicating the number of bytes used for communication as a variable NA. For example, in the case of 3-byte communication, the variable NA is set to a value of 3. In step S102, the camera controller B 102 requests SPI communication by changing the CS signal to a low level. In step S103, the camera controller B 102 determines whether a predetermined time period T_CS has passed after the CS signal has changed to a low level. The camera controller B 102 waits (No in step S103) until the predetermined time period T_CS has passed, and in the case where the camera controller B 102 determines that the predetermined time period T_CS has passed (Yes in step S103), the process proceeds to step S104.
[0076] In step S104, in order to communicate 1-byte data, the camera controller B 102 performs output control of the MOSI signal data and input control of the MISO signal data, and simultaneously performs output control of the SCLK signal. In step S105, the camera controller B 102 decrements the value of the variable NA. In step S106, the camera controller B 102 determines whether the variable NA is equal to 0 (zero). In the case where the camera controller B 102 determines that the variable NA is equal to 0 (zero) ("Yes" in step S106), the processing proceeds to step S107, and in the case where the camera controller B 102 determines that the variable NA is not equal to 0 ("No" in step S106), the processing proceeds to step S108.
[0077] In step S108, the camera controller B 102 determines whether a predetermined time period T_INTERVAL has elapsed after the communication of 1-byte data in step S104 is completed. The camera controller B 102 waits (No in step S108) until the predetermined time period T_INTERVAL has elapsed, and in a case where the camera controller B 102 determines that the predetermined time period T_INTERVAL has elapsed (Yes in step S108), the process returns to step S104. In step S107, the camera controller B 102 changes the CS signal to a high level, thereby terminating the SPI communication.
[0078] Figure 3B 2 is a flowchart for explaining the operation performed by the accessory controller 201 according to the SPI protocol A. Figure 3B , each processing operation (step) indicated by an S number is implemented by the CPU (not shown) of the accessory controller 201 loading a predetermined program stored in the ROM (not shown) of the accessory controller 201 into its RAM (not shown).
[0079] In step S201, the accessory controller 201 determines whether the CS signal changes to a low level. In the case where the accessory controller 201 determines that the CS signal does not change to a low level ("No" in step S201), the accessory controller 201 repeats the determination of step S201, and in the case where the accessory controller 201 determines that the CS signal changes to a low level ("Yes" in step S201), the processing proceeds to step S202. In step S202, the accessory controller 201 performs input control of MOSI signal data and output control of MISO signal data according to the input of the SCLK signal, thereby communicating 1 byte of data. In step S203, the accessory controller 201 determines whether the CS signal changes to a high level. In the case where the accessory controller 201 determines that the CS signal does not change to a high level ("No" in step S203), the processing returns to step S202 so that the accessory controller 201 communicates the next byte of data. On the other hand, when the accessory controller 201 determines that the CS signal has changed to the high level (YES in step S203), the accessory controller 201 terminates the present process, thereby terminating the SPI communication.
[0080] The second communication protocol of the two types of communication protocols of the SPI communication method is a method of checking whether the accessory 200 is in a state capable of communication before the camera 100 outputs the SCLK signal, and is hereinafter referred to as “SPI protocol B”.
[0081] Figure 2B is a diagram schematically showing a waveform of communication of the SPI protocol B. At timing B1, the camera controller B 102 changes the CS signal to a low level, thereby requesting the accessory controller 201 to perform SPI communication. In accordance with the request, the camera controller 102 checks the potential of the MISO signal, and if the MISO signal is at a high level, determines that the accessory controller 201 is in a state in which communication is possible, and if the MISO signal is at a low level, determines that the accessory controller 201 is in a state in which communication is not possible. On the other hand, when the accessory controller 201 detects the falling edge of the CS signal, if the accessory controller 201 is in a state in which SPI communication is possible, the accessory controller 201 controls the MISO signal to a high level (timing B2), and if the accessory controller 201 is in a state in which SPI communication is not possible, the accessory controller 201 controls the MISO signal to a low level.
[0082] When it is confirmed at the timing B3 that the MISO signal is at a high level, the camera controller B 102 starts outputting the SCLK signal and the MOSI signal. Similarly, when the falling edge of the SCLK signal is detected, the accessory controller 201 starts outputting the MISO signal. When the output of the SCLK signal of 1 byte of data is completed at the timing B4, the camera controller B 102 stops outputting the SCLK signal. After the accessory controller 201 performs transmission and reception of 1 byte of data, if the accessory controller 201 is in a state capable of SPI communication, the accessory controller 201 controls the MISO signal to a high level, and if the accessory controller 201 is in a state incapable of SPI communication, the accessory controller 201 controls the MISO signal to a low level (timings B5 and B6). The camera controller B 102 checks the potential of the MISO signal at the timing B7, and if the MISO signal is at a high level, the camera controller B 102 determines that the accessory controller 201 is in a state capable of communication, and if the MISO signal is at a low level, the camera controller B 102 determines that the accessory controller 201 is in a state incapable of communication.
[0083] Figure 4A 1 is a flowchart for explaining the operation performed by the camera controller B 102 according to the SPI protocol B. Figure 4A , each processing operation (step) indicated by an S number is realized by the CPU of the camera controller B 102 loading a predetermined program stored in the ROM of the camera controller B 102 into its RAM.
[0084] In step S111, the camera controller B 102 stores a value indicating the number of bytes used for transmission as a variable NB. For example, when 3-byte communication is performed, the variable NB is set to a value of 3. In step S112, the camera controller B 102 requests SPI communication by changing the CS signal to a low level. In step S113, the camera controller B 102 determines whether the MISO signal is at a high level. The camera controller B 102 waits ("No" in step S113) until the MISO signal becomes high, and in the case where the camera controller B 102 determines that the MISO signal is at a high level ("Yes" in step S113), the process proceeds to step S114.
[0085] In step S114, in order to communicate 1-byte data, the camera controller B 102 performs SCLK signal output control, and performs MOSI signal data output control and MISO signal data input control. In step S115, the camera controller B 102 decrements the value of the variable NB by 1 and stores the decremented value as the new value of NB.
[0086] In step S116, the camera controller B 102 determines whether the communication of all data is completed (whether the variable NA is equal to 0). Here, when the variable NB is equal to 0, it is determined that the communication of all data is completed. If the camera controller B 102 determines that the communication of all data is completed ("Yes" in step S116), the process proceeds to step S117, and if the camera controller B 102 determines that the communication of all data is not completed ("No" in step S116), the process proceeds to step S118.
[0087] In step S117, the camera controller B 102 changes the CS signal to a high level, thereby terminating a series of operations of the SPI communication. On the other hand, in step S118, the camera controller B 102 determines whether the MISO signal changes to a high level. The camera controller B 102 waits (No in step S118) until the MISO signal becomes high, and in the case where the camera controller B 102 determines that the MISO signal is at a high level (Yes in step S118), the process returns to step S114.
[0088] Figure 4B 2 is a flowchart for explaining the operation performed by the accessory controller 201 according to the SPI control B. Figure 4B , each processing operation (step) indicated by an S number is realized by the CPU of the accessory controller 201 loading a predetermined program stored in the ROM of the accessory controller 201 into its RAM.
[0089] In step S211, the accessory controller 201 determines whether the CS signal changes to a low level. In the case where the accessory controller 201 determines that the CS signal does not change to a low level ("No" in step S211), the accessory controller 201 repeats the determination of step S211, and in the case where the accessory controller 201 determines that the CS signal changes to a low level ("Yes" in step S211), the processing proceeds to step S212. In step S212, the accessory controller 201 determines whether the accessory controller 201 is in a state capable of SPI communication. In the case where the accessory controller 201 determines that the accessory controller 201 is in a state capable of SPI communication ("Yes" in step S212), the processing proceeds to step S213, and in the case where the accessory controller 201 determines that the accessory controller 201 is not in a state capable of SPI communication ("No" in step S212), the processing proceeds to step S214.
[0090] In step S213, the accessory controller 201 controls the MISO signal to a high level, and the process proceeds to step S215. In step S214, the accessory controller 201 controls the MISO signal to a low level, and the process returns to step S212.
[0091] In step 215, the accessory controller 201 performs a communication of 1-byte data by controlling the input of the MOSI signal data and the output of the MISO signal data according to the input of the SCLK signal. In step S216, the accessory controller 201 determines whether the CS signal changes to a high level. In the case where the accessory controller 201 determines that the CS signal does not change to a high level ("No" in step S216), the process returns to step S212 to perform the next 1-byte communication. On the other hand, in the case where the accessory controller 201 determines that the CS signal changes to a high level ("Yes" in step S216), the accessory controller 201 terminates the present process, thereby terminating the SPI communication.
[0092] Figure 5 1 is a diagram showing an example of details of communication for notifying the accessory 200 of an operation execution instruction (command) from the camera 100 through SPI communication. In the communication of the first byte, the camera controller B 102 transmits "CMD" as information indicating a command number as MOSI signal data. In response to this, the accessory controller 201 transmits a value "0xA5" as MISO signal data. In addition, when the accessory controller 201 cannot perform the communication processing of the first byte, the accessory controller 201 transmits a value other than "0xA5" as MISO signal data.
[0093] In the communication of the 2nd byte, the camera controller B 102 transmits the argument "MOSI_DATA1" associated with the command number CMD. Similarly, in the communication of the 3rd byte to the (N-2)th byte, the camera controller B 102 transmits the arguments "MOSI_DATA2" to "MOSI_DATA[N-3]" associated with the respective command numbers CMD. In response thereto, in the communication of the 2nd byte, the accessory controller 201 transmits the command number CMD received in the communication of the 1st byte as the MISO signal data. This enables the camera controller B 102 to determine that the accessory controller 201 has correctly received the MOSI signal data. In the communication of the 3rd byte, the accessory controller 201 transmits "MISO_DATA1" as the return value associated with the command number CMD. Similarly, in the communication of the 4th byte to the (N-2)th byte, the accessory controller 201 transmits "MISO_DATA2" to "MISO_DATA[N-4]" as the return values associated with the command number CMD. Note that, assuming that the arguments and the return value are predetermined for each command number, one or both of the arguments and the return value may be omitted.
[0094] In the communication of the (N-1)th byte, the camera controller B 102 transmits "CheckSum_C" as checksum data as MOSI signal data. CheckSum_C is calculated from the data transmitted from the camera controller B 102 to the accessory controller 201 by the following equation (1). On the other hand, the accessory controller 201 transmits "0x00" indicating an address as MISO signal data.
[0095] In the communication of the Nth byte, the camera controller B 102 transmits "0x00" as the MOSI signal data. On the other hand, the accessory controller 201 transmits "CheckSum_A" which is the checksum data as the MISO signal data.
[0096] CheckSum_A is calculated as the second CheckSum_A by the formula (2) described below, or is calculated as the third CheckSum_A by the formula (3) described below. More specifically, the accessory controller 201 calculates the first CheckSum_C_A by the formula (1) based on the actually received data. Then, the accessory controller 201 determines whether the received CheckSum_C and the first CheckSum_C_A are consistent. In the case where the accessory controller 201 determines that CheckSum_C and CheckSum_C_A are consistent, the accessory controller 201 calculates the second CheckSum_A by the formula (2) described below, and sends the second CheckSum_A to the camera controller B 102. In the case where the accessory controller 201 determines that CheckSum_C and CheckSum_C_A are inconsistent, the accessory controller 201 calculates the third CheckSum_A by the formula (3) described below, and sends the third CheckSum_A to the camera controller B 102. Note that CheckSum_A is set to the 1's complement of the second CheckSum_A.
[0097] CheckSum_C=EXOR(AND(SUM(CMD,MOSI_DATA1,…,MOSI_DATA[N-3]),0xFF),0xFF)…(1)
[0098] CheckSum_A =EXOR(AND(SUM(0xA5,CMD,MISO_DATA1,…,MISO_DATA[N-4]),0xFF),0xFF)…(2)
[0099] CheckSum_A=AND(SUM(0xA5,CMD,MISO_DATA1,…,MISO_DATA[N-4]),0xFF)…(3)
[0100] Reference again Figure 1 , the electrical structure of the camera 100 is further described. A communication request signal / WAKE for requesting the camera controller A 101 to communicate from the accessory 200 is connected to the contact TC11. The communication request signal / WAKE is pulled up to the camera microcomputer power supply VMCU_C via a resistor. The camera controller A 101 receives the communication request from the accessory 200 by detecting the falling edge of the communication request signal / WAKE.
[0101] The SDA signal connected to the contact TC12 and the SCL signal connected to the contact TC13 are signals used by the camera controller A 101 as a communication host to perform I2C communication which is a type of serial communication. The communication using the SDA signal and the SCL signal is open drain communication pulled up to the camera microcomputer power source VMCU_C, and in this embodiment, the communication frequency is assumed to be 100 kbps.
[0102] In the I2C communication, both data transmission from the camera 100 and data transmission from the accessory 200 are performed by the SDA signal. The I2C communication has a lower communication speed than the SPI communication. In addition, since the SPI communication has a higher communication speed than the I2C communication, the SPI communication is suitable for communication of information with a large amount of data. Therefore, in the communication between the camera 100 and the accessory 200 in the present embodiment, the SPI communication is used to communicate information with a large amount of data, and the I2C communication is used to communicate information with a small amount of data. For example, first, the I2C communication is used to communicate data, and in the case where it is determined based on the communication of the data that the SPI communication can be performed, or in the case where the SPI communication is required, it can be controlled to perform the SPI communication afterwards.
[0103] Fig.22A and Fig. 22B is a diagram showing an example of a waveform of I2C communication. Fig.22A 1 shows an example of a waveform of communication in the case where the camera 100 transmits N bytes of data (DATA[1] to DATA[N]) to the accessory 200, and Fig. 22B An example of a waveform of communication in a case where the camera 100 receives N bytes of data (DATA[1] to DATA[N]) from the accessory 200 is shown.
[0104] exist Fig.22A and Fig. 22B , each uplink waveform is a waveform of an SCL signal, and each downlink waveform is a waveform of an SDA signal. Below the waveform of the SDA signal, the meaning of each associated part of the SDA signal and which of the camera controller A 101 and the accessory controller 201 controls the output level of the SDA signal are described. In addition, the communication data is composed of data in units of 1 byte and 1 bit of information indicating a response, so in order to make the description easier to understand, each part of the data corresponds to the byte number from the start of communication above the illustration of the waveform. Figure 23 to Figure 25 To explain the details of the content of the communication, reference is omitted Fig.22A and Fig. 22B Description of it.
[0105] refer to Fig.22AIn the communication of the 1st and 2nd bytes, the camera controller A 101 notifies the accessory controller 201 of the storage address information of the data to be received. In the communication of the 3rd to (N+2)th bytes, the camera controller A 101 sends N-byte data (DATA[ADDRESS] to DATA[ADDRESS+N-1]) to the accessory controller 201.
[0106] refer to Fig. 22B In the communication of the 1st and 2nd bytes, the camera controller A 101 notifies the accessory controller 201 of the storage address information of the data to be received. In the communication of the 4th to (N+3)th bytes, the camera controller A 101 receives N+1 byte data (DATA[ADDRESS] to DATA[ADDRESS+N-1]) from the accessory controller 201.
[0107] Now, refer to Figure 23 to Figure 25 To illustrate the processing. Fig.23 2 is a diagram showing processing performed by the camera controller A 101 when the camera controller A 101 sends NC byte data to the accessory controller 201. Fig.23 , each processing operation (step) denoted by an S number is realized by the CPU of the camera controller A 101 loading a program stored in a ROM (not shown) of the camera controller A 101 into its RAM (not shown) and executing the program.
[0108] In step S3001, the camera controller A 101 stores a value indicating the number of bytes used for transmission as a variable NC. For example, in the case where 3 bytes of data are to be transmitted, the variable NC is set to a value of 3. In step S3002, while the SCL signal is at a high level, the camera controller A 101 changes the SDA signal to a low level (start condition). This notifies the accessory controller 201 of the start of communication.
[0109] In step S3003, the camera controller A 101 sets slave address information indicating the slave address of the accessory controller 201 in the most significant 7 bits of the transmission data. In the present embodiment, the slave address of the accessory controller 201 is 1010000 in the case of a binary number.
[0110] In step S3004, the camera controller A 101 sets information indicating write (WRITE) communication in the least significant 1 bit of the transmission data. The least significant 1 bit set to a value of 0 means write communication.
[0111] In step S3005 , the camera controller A 101 transmits the data set as transmission data in steps S3003 and S3004 (10100000 in the case of binary numbers, ie, 0xA0 in the case of hexadecimal numbers) to the accessory controller 201 .
[0112] After transmitting 1 byte of data, in step S3006, the camera controller A 101 outputs an SCL signal of one clock and checks the signal level of the SDA signal. When the signal level of the SDA signal is low, the camera controller A 101 determines that the accessory controller 201 has performed a data reception notification (ACK) ("Yes" in step S3006), and the processing proceeds to step S3007. On the other hand, when the signal level of the SDA signal is high, the camera controller A 101 determines that the accessory controller 201 has not normally received the transmission data ("No" in step S3006), and the processing proceeds to step S3014.
[0113] In step S3007, the camera controller A 101 sets, as transmission data, storage address information (start address information) of data to be transmitted to the accessory controller 201. In the present embodiment, it is assumed that the size of data of the start address information is 1 byte and its value is 0x00.
[0114] In step S3008, the camera controller A 101 transmits the set 1-byte start address information (value 0x00) to the accessory controller 201. After transmitting the 1-byte data of the start address information, in step S3009, the camera controller A 101 outputs the SCL signal of one clock and checks the signal level of the SDA signal. When the signal level of the SDA signal is low, the camera controller A 101 determines that the accessory controller 201 has performed a data reception notification (ACK) ("Yes" in step S3009), and the processing proceeds to step S3010. On the other hand, when the signal level of the SDA signal is high, the camera controller A 101 determines that the accessory controller 201 has not normally received the transmission data ("No" in step S3009), and the processing proceeds to step S3014.
[0115] In step S3010, the camera controller A 101 sets the variable MC to a value of 1. The variable MC is used to count the number of transmission data items. In step S3011, the camera controller A 101 transmits 1-byte data to the accessory controller 201 by outputting the SCL signal of 1-byte data and changing the SDA signal to a desired level while the signal level of the SCL signal is low. Here, since the start address information is 0x00 and the variable MC is 1, 1-byte data associated with the address 0x00 is transmitted.
[0116] After transmitting 1 byte of data, in step S3012, the camera controller A 101 outputs an SCL signal of one clock and checks the signal level of the SDA signal. When the signal level of the SDA signal is low, the camera controller A 101 determines that the accessory controller 201 has performed a data reception notification (ACK) ("Yes" in step S3012), and the processing proceeds to step S3013. On the other hand, when the signal level of the SDA signal is high, the camera controller A 101 determines that the accessory controller 201 has not normally received the transmission data ("No" in step S3012), and the processing proceeds to step S3014.
[0117] In step S3013, the camera controller A 101 checks whether the value of the variable MC is equal to the value of the variable NC. When the value of the variable MC is equal to the value of the variable NC ("Yes" in step S3013), the camera controller A 101 determines that the transmission of all data is completed, and the processing proceeds to step S3014. On the other hand, when the value of the variable MC is not equal to the value of the variable NC ("No" in step S3013), the camera controller A 101 determines that there is still data to be transmitted, and the processing proceeds to step S3015.
[0118] In step S3015, the camera controller A 101 adds 1 to the variable MC, and the process returns to step S3011. Each time the process thus returns to step S3011, the camera controller A 101 sequentially increments the address of the data to be transmitted, and transmits 1-byte data associated with the address.
[0119] By repeatedly sending 1-byte data in this way until it is determined in step S3013 that the variable MC is equal to the variable NC, the camera controller A 101 sends NC-byte data to the accessory controller 201. In the present embodiment, when the variable NC is set to 3, 3-byte data can be sent.
[0120] In step S3014, the camera controller A 101 changes the SDA signal to a high level (stop condition) during the period when the SCL signal is at a high level. This notifies the accessory controller 201 of the termination of communication.
[0121] Fig.24 is a process performed by the camera controller A 101 when the camera controller A 101 receives ND byte data from the accessory controller 201. Fig.24, each processing operation (step) indicated by an S number is realized by the CPU of the camera controller A 101 loading a predetermined program stored in the ROM of the camera controller A 101 into its RAM and executing the program.
[0122] In step S3101, the camera controller A 101 sets the variable ND to a value indicating the number of bytes of data to be received. For example, in the case where 3 bytes of data are to be received, the variable ND is set to a value of 3. In this embodiment, it is assumed that the variable ND is set to a value of 3. In steps S3102 to S3106, the camera controller A 101 executes the same operations as in step S3103. Fig.23 The same processing operations as those performed in steps S3002 to S3006.
[0123] In step S3107, the camera controller A 101 sets the storage address information (start address information) of the data to be received from the accessory controller 201 as the transmission data. In the present embodiment, the size of the start address information is 1 byte, and its value is equal to 0x00. In step S3108, the camera controller A 101 sends the set start address information (value 0x00) of 1-byte data to the accessory controller 201.
[0124] In step S3109, the camera controller A 101 outputs an SCL signal of one clock, and checks the signal level of the SDA signal. In the case where the signal level of the SDA signal is low, the camera controller A 101 determines that the accessory controller 201 has made a data reception notification (ACK) ("Yes" in step S3109), and the processing proceeds to step S3110. On the other hand, in the case where the signal level of the SDA signal is high, the camera controller A 101 determines that the accessory controller 201 has not received the data normally ("No" in step S3109), and the processing proceeds to step S3122.
[0125] In step S3110, similarly to step S3102, the camera controller A 101 changes the SDA signal to a low level while the SCL signal is at a high level, thereby notifying the start condition to the accessory controller 201. In step S3111, the camera controller A 101 sets the slave address information indicating the slave address of the accessory controller 201 in the most significant 7 bits of the transmission data. In the present embodiment, it is assumed that the slave address of the accessory controller 201 is 1010000 in the case of a binary number.
[0126] In step S3112, the camera controller A 101 sets information indicating read (READ) communication in the least significant 1 bit of the transmission data. The least significant 1 bit set to a value of 1 means read communication.
[0127] In step S3113 , the camera controller A 101 transmits the data set as transmission data in steps S3111 and S3112 (10100001 in the case of binary numbers, ie, 0xA1 in the case of hexadecimal numbers) to the accessory controller 201 .
[0128] After sending 1 byte of data, in step S3114, the camera controller A 101 outputs an SCL signal of one clock and checks the signal level of the SDA signal. When the signal level of the SDA signal is low, the camera controller A 101 determines that the accessory controller 201 has made a data reception notification (ACK) ("Yes" in step S3114), and the processing proceeds to step S3115. On the other hand, when the signal level of the SDA signal is high, the camera controller A 101 determines that the accessory controller 201 has not normally received the transmission data ("No" in step S3114), and the processing proceeds to step S3122.
[0129] In step S3115, the camera controller A 101 sets the variable MD to 1. The variable MD is used to count the number of received data items. In step S3116, the camera controller A 101 outputs the SCL signal of 1-byte data, and reads the signal level of the SDA signal at each timing at which the SCL signal changes from a low level to a high level. This makes it possible to receive 1-byte data from the accessory controller 201. The received 1-byte data may be stored in the nonvolatile memory 125 as data associated with the address 0x00 or used for predetermined processing.
[0130] In step S3117, the camera controller A 101 determines whether the 1-byte data can be received normally. If the camera controller A 101 determines that the byte data can be received normally ("Yes" in step S3117), the process proceeds to step S3118. On the other hand, if the camera controller A 101 determines that the 1-byte data cannot be received normally ("No" in step S3117), the process proceeds to step S3119.
[0131] In step S3118, the camera controller A 101 checks whether the value of the variable MD is equal to the value of the variable ND. When the value of the variable MD is equal to the value of the variable ND ("Yes" in step S3118), the camera controller A 101 determines that the transmission of all data is completed, and the processing proceeds to step S3119. On the other hand, when the value of the variable MD is not equal to the value of the variable ND ("No" in step S3118), the camera controller A 101 determines that there is still data to be transmitted, and the processing proceeds to step S3120.
[0132] In step S3120, the camera controller A 101 outputs the SCL signal of 1-byte data, and then controls the SDA signal to a low level, thereby performing a data reception notification (ACK) to the accessory controller 201 to notify that data communication will be continued. In step S3121, the camera controller A 101 adds 1 to the variable MD, and the process returns to step S3116. After thus returning to step S3116, the camera controller A 101 sequentially increments the address of the data to be received, and receives 1-byte data associated with each incremented address.
[0133] By repeatedly receiving 1-byte data in this manner until it is determined in step S3118 that the value of variable MD is equal to the value of variable ND, the camera controller A 101 receives ND-byte data from the accessory controller 201. When variable ND is set to 3 as in this embodiment, 3-byte data can be received.
[0134] In step S3119, the camera controller A 101 outputs the SCL signal of 1-byte data and controls the SDA signal to a high level, thereby notifying the accessory controller 201 of the completion of data communication (NACK). In step S3122, the camera controller A 101 changes the SDA signal to a high level (stop condition) while the SCL signal is at a high level. This notifies the accessory controller 201 of the termination of communication.
[0135] Fig.25 1 is a flowchart of a process performed by the accessory controller 201 when NE byte data is transmitted and received between the camera controller A 101 and the accessory controller 201. Note that this process includes a process performed by the accessory controller 201 for receiving NE byte data from the camera controller A 101 and a process performed by the accessory controller 201 for transmitting NE byte data to the camera controller A 101. Fig.23 , each processing operation (step) indicated by an S number is realized by the CPU of the accessory controller 201 loading a predetermined program stored in the ROM of the accessory controller 201 into its RAM.
[0136] In step S3201, the accessory controller 201 waits (No in S3201) until the SDA signal goes low (a start condition is detected) while the SCL signal is at a high level. If the accessory controller 201 detects the start condition (Yes in S3201), the process proceeds to step S3202.
[0137] In step S3202, the accessory controller 201 sets the variable ME to 0. The variable ME is used to count the number of transmission data items or the number of reception data items. In step S3203, the accessory controller 201 receives 1-byte data transmitted from the camera controller A101.
[0138] In step S3204, the accessory controller 201 determines whether the most significant 7 bits of the received 1-byte data are consistent with the slave address (0x50 in this embodiment) of the accessory controller 201. If the accessory controller 201 determines that the data is consistent with the slave address ("Yes" in step S3204), the process proceeds to step S3205, and if the accessory controller 201 determines that the data is inconsistent with the slave address ("No" in step S3204), the process proceeds to step S3221.
[0139] In step S3205, the accessory controller 201 performs a data reception notification (ACK) to the camera controller A 101 by controlling the SDA signal to be low level in response to the next output of the SCL signal of one clock. In step S3206, the accessory controller 201 determines the type of data of the next 1-byte communication to be performed based on the data of the least significant 1 bit of the 1-byte data received in step S3203. In a case where the data of the least significant 1 bit is 0, the accessory controller 201 determines that the data of the next 1-byte communication to be performed is the start address information to be written from the camera controller A 101 to the accessory controller 201 ("Yes" in step S3206), and the processing proceeds to step S3207. On the other hand, in a case where the data of the least significant 1 bit is 1, the accessory controller 201 determines that the data of the next 1-byte communication to be performed is the transmission data from the accessory controller 201 to the camera controller A 101 ("No" in step S3206), and the processing proceeds to step S3209.
[0140] In step S3207, the accessory controller 201 receives the 1-byte data transmitted from the camera controller A 101. The received 1-byte data is information about a data address storing data to be transmitted and received by the following communication. Fig.21A , Fig.21B , Fig.22A and Fig. 22B As described above, it is assumed that the start address information is 0x00.
[0141] In step S3209, the accessory controller 201 sets the start address information to the address information stored in advance in the accessory controller 201 or the address information notified in advance from the camera controller A 101.
[0142] In step S3208, the accessory controller 201 determines whether the 1-byte data is correctly received. If the accessory controller 201 determines that the 1-byte data is correctly received ("Yes" in step S3208), the process proceeds to step S3210, and if the accessory controller 201 determines that the 1-byte data is not correctly received ("No" in step S3208), the process proceeds to step S3221.
[0143] In step S3210, the accessory controller 201 performs data reception notification (ACK) to the camera controller A 101 by controlling the SDA signal to be low level in response to the next output of the SCL signal for one clock after receiving 1-byte data.
[0144] In step S3211, the accessory controller 201 determines whether the SDA signal becomes low (whether the start condition is detected) while the SCL signal is at a high level. In the case where the accessory controller 201 detects the start condition, the 1-byte data to be communicated next is data to be sent from the camera controller A 101 to the accessory controller 201, and the data indicates the slave address and the type of communication. On the other hand, in the case where the accessory controller 201 does not detect the start condition, the 1-byte data to be communicated next is data information to be received by the accessory controller 201 from the camera controller A 101. In the case where the accessory controller 201 determines that it has detected the start condition ("Yes" in step S3211), the processing proceeds to step S3212, and in the case where the accessory controller 201 determines that it has not detected the start condition ("No" in step S3211), the processing proceeds to step S3216.
[0145] In step S3212, the accessory controller 201 receives the 1-byte data transmitted from the camera controller A 101. In step S3213, the accessory controller 201 determines whether the most significant 7 bits of the 1-byte data received in step S3212 are consistent with the slave address of the accessory controller 201 (0x50 in the present embodiment). When the accessory controller 201 determines that the most significant 7 bits of the data are consistent with the slave address of the accessory controller 201 ("Yes" in step S3213), the processing proceeds to step S3214. When the accessory controller 201 determines that the most significant 7 bits of the data are inconsistent with the slave address of the accessory controller 201 ("No" in step S3213), the processing proceeds to step S3221.
[0146] In step S3214, the accessory controller 201 determines the type of data of the next 1-byte communication to be performed based on the data of the least significant 1 bit of the 1-byte data received in step S3212. In a case where the data of the least significant 1 bit is 1, the accessory controller 201 determines that the data of the next 1-byte communication to be performed is transmission data to be read from the accessory controller 201 to the camera controller A 101 ("YES" in step S3214), and the processing proceeds to step S3215. On the other hand, in a case where the accessory controller 201 determines that the data of the least significant 1 bit is 0 ("NO" in step S3214), the processing proceeds to step S3221.
[0147] In step S3215, the accessory controller 201 performs data reception notification (ACK) to the camera controller A 101 by controlling the SDA signal to be low level in response to the next output of the SCL signal for one clock after receiving 1-byte data.
[0148] In step S3221, the accessory controller 201 notifies the camera controller A 101 of data communication completion (NACK) by controlling the SDA signal to a high level, and the process proceeds to step S3225. In step S3222, the accessory controller 201 transmits 1-byte data associated with the start address information received from the camera controller A 101 in step S3207 or the start address information set in step S3209 to the camera controller A 101.
[0149] In step S3223, the accessory controller 201 adds 1 to the variable ME. In the next step S3224, the accessory controller 201 checks the signal level of the SDA signal after sending 1 byte of data. In the case where the signal level of the SDA signal is high, the accessory controller 201 determines that this means that the camera controller A 101 has completed the notification of the reception of all data (NACK) ("Yes" in step S3224), and the processing proceeds to step S3225. On the other hand, in the case where the signal level of the SDA signal is low, the accessory controller 201 determines that the camera controller A 101 continues to request the transmission of data from the accessory controller 201 ("No" in step S3224), and the processing returns to step S3222.
[0150] After the process thus returns to step S3222, the accessory controller 201 sequentially increments the address of the data to be transmitted, and transmits 1-byte data associated with the incremented address. Thus, the 1-byte data is repeatedly transmitted until NACK is notified from the camera controller A 101 in step S3224, and the accessory controller 201 transmits NE-byte data to the camera controller A 101.
[0151] In step S3225, the accessory controller 201 determines whether the SDA signal changes to a high level (stop condition) while the SCL signal is at a high level. The accessory controller 201 repeats this determination ("No" in step S3225) until a stop condition is detected, and terminates the present process when it is determined that a stop condition is detected ("Yes" in step S3225).
[0152] Now, in step S3216 to which the process proceeds in the event that the answer to the question of step S3211 is negative ("No"), the accessory controller 201 receives 1-byte data. This 1-byte data is stored in a nonvolatile memory not shown or the like as data associated with the start address information received from the camera controller A 101 and is used for predetermined processing.
[0153] In step S3217, the accessory controller 201 adds 1 to the variable ME. In the next step S3218, the accessory controller 201 determines whether the 1-byte data can be received normally. In the case where the accessory controller 201 determines that the 1-byte data can be received normally ("Yes" in step S3218), the process proceeds to step S3219, and in the case where the controller 201 determines that the 1-byte data cannot be received normally ("No" in step S3218), the process proceeds to step S3221.
[0154] In step S3219, the accessory controller 201 controls the SDA signal to a low level in response to the next output of the SCL signal for one clock after receiving 1 byte of data, and performs a data reception notification (ACK) to the camera controller A 101. In step S3220, the accessory controller 201 determines whether the SDA signal changes to a high level (stop condition) while the SCL signal is at a high level. In the case where the accessory controller 201 determines that the stop condition is detected ("Yes" in step S3220), the present processing is terminated. On the other hand, in the case where the stop condition is not detected ("No" in step S3220), the accessory controller 201 determines that data transmission from the camera controller A 101 to the accessory controller 201 is to be continued, and thus the processing returns to step S3216.
[0155] After the process thus returns to step S3216, the accessory controller 201 sequentially increments the address of the data to be received, and receives 1-byte data associated with the incremented address. The accessory controller 201 repeatedly receives 1-byte data until the stop condition is notified in step S3220, whereby the accessory controller 201 receives NE bytes of data from the camera controller A 101.
[0156] The FNC1 signal, FNC2 signal, FNC3 signal, and FNC4 signal connected to the contact TC14, the contact TC15, the contact TC16, and the contact TC17, respectively, are signals (function signals) whose functions can be changed according to the type of accessory 200. For example, in the case where the accessory 200 is a microphone device, the function signal communicated via TC15 is an audio data signal. In the case where the accessory 200 is a lighting device (flashlight device), the function signal communicated via TC14 is a signal notifying light emission timing.
[0157] Note that, depending on the type of accessory mounted on the camera 100, one of the signals for implementing various functions may be communicated via the same contact. For example, in the case where the accessory 200 is different from the lighting device, a synchronization signal for controlling timing other than the light emission timing may be communicated via TC14. Contacts TC14 to TC17 are referred to as function signal contacts. Communication using at least one of the function signal contacts is referred to as function signal communication.
[0158] Function signal communication can be performed in parallel with I2C communication or SPI communication at a timing independent of I2C communication or SPI communication.
[0159] The types of accessories mentioned here are microphone devices and lighting devices, etc. As in the case of lighting devices with different performances, accessories that achieve functions for the same purpose are classified as accessories of the same type. As in the case of microphone devices and lighting devices, accessories that achieve respective functions for different purposes are classified as accessories of different types.
[0160] Function signal communication is performed based on information acquired through I2C communication or SPI communication.
[0161] The contact TC18 as the second ground contact is connected to the ground terminal, and similar to the contact TC04 as the first ground contact, the contact TC18 is used as a reference potential for the camera 100 and the accessory 200. The contact TC19 as the differential signal contact and the contact TC20 as the differential signal contact are connected to the camera controller B 102. The differential signal D2N is connected to the contact TC19 and the differential signal D2P is connected to the contact TC20. For example, USB communication can be performed via TC19 and TC20. The differential signal D2N and the differential signal D2P are differential data communication signals that perform data communication as a pair.
[0162] The contact TC21 as the fourth ground contact is connected to the ground terminal, and serves not only as a contact for a reference potential but also as a contact for controlling wiring impedances of the differential signal D2N and the differential signal D2P.
[0163] The contacts TC01, TC04, TC06, TC18, and TC21 are connected to, for example, a ground portion of a flexible circuit board (not shown) of the camera 100. The ground portion of the flexible circuit board is fixed to a metal member whose potential is at the ground level of the camera 100 by a screw or the like. The metal member whose potential is at the ground level is a coupling member provided in an accessory shoe (not shown) of the camera 100 for coupling with the accessory 200, or a substrate (not shown) inside the camera 100.
[0164] In the present embodiment, the installation detection contact TC06 to which the accessory installation detection signal / ACC_DET is connected is arranged adjacent to the contact TC07 (first clock contact) for transmitting the SCLK signal (first clock signal) as a clock signal. Generally, the noise (clock noise) caused by the potential change of the clock signal is transmitted to the contact adjacent to the contact of the clock signal, which may cause a malfunction. In particular, in the case of the configuration of the present embodiment where there are a large number of contacts and the distance between the contacts is short, the noise has a greater impact. In view of this, the installation detection contact TC06 is arranged adjacent to the contact TC07 used for the SCLK signal, thereby reducing the impact of the clock noise.
[0165] The accessory installation detection signal / ACC_DET is pulled up before the accessory is installed, but is set to the ground level after the accessory is installed. On the other hand, the contact TC07 that transmits the SCLK signal as a clock signal does not transmit the clock signal before the accessory is installed, so the potential does not change, but only after the accessory is installed, the contact TC07 transmits the clock signal, which causes the change in potential. When the contact used for the SCLK signal transmits the clock signal, the installation detection contact TC06 is at the ground potential. Therefore, even when the installation detection contact TC06 receives clock noise, the potential of the control circuit of the camera 100 and the accessory 200 is difficult to change, so malfunctions can be prevented. In addition, the clock noise can be suppressed from being transmitted to a position farther than the installation detection contact TC06. As a result, there is no need to arrange a ground terminal, so that the influence of the clock noise can be suppressed without increasing the number of contacts.
[0166] The SCL signal (second clock signal) as a clock signal is also sent to the contact (second clock contact) TC13 as the SCL signal contact. However, the SCLK signal sent to the SCLK signal contact TC07 has a higher frequency than the SCL signal, and the clock noise generated from the SCLK signal contact TC07 is more than the clock noise generated from the SCL signal contact TC13. For this reason, arranging the installation detection contact TC06 adjacent to the SCLK signal contact TC07 is more effective in preventing malfunctions caused by clock noise than arranging the installation detection contact TC06 adjacent to the SCL signal contact TC13.
[0167] In addition, the difference between the SCL signal and the SCLK signal is not just the frequency. The SCL signal sent via the SCL signal contact TC13 is a clock signal based on the I2C communication standard, and the change in the voltage of the signal line is driven by the open drain connection. On the other hand, the SCLK signal sent via the SCLK signal contact TC07 is a clock signal based on the SPI communication standard, and the change in the voltage of the signal line is driven by the CMOS output. For this reason, the voltage change edge of the SCL signal contact TC13 is often smoother than that of the SCLK signal contact TC07, which makes it difficult to generate clock noise. Therefore, it is more effective to arrange the installation detection contact TC06 adjacent to the SCLK signal contact TC07 than to arrange the installation detection contact TC06 adjacent to the SCL signal contact TC13 in preventing malfunctions caused by clock noise.
[0168] In addition, there is a case where the differential signals D1N and D1P are also sent as a pair to the differential signal contacts TC19 and TC20 to thereby send a clock signal. At this time, there is a case where the clock signal (third clock signal) transmitted by the differential signal contacts TC19 and TC20 has a higher frequency than the clock signal (third clock signal) transmitted by the SCLK signal contact TC07 and the SCL signal contact TC13. However, since the differential signals D1N and D1P are paired signals, a smaller amount of clock noise is emitted compared to the SCLK signal contact TC07 and the SCL signal contact TC13 that transmit a single-ended signal. For this reason, arranging the installation detection contact TC06 adjacent to the SCLK signal contact TC07 is more effective in preventing malfunctions caused by clock noise than arranging the installation detection contact TC06 adjacent to the first differential signal contact TC19 and the second differential signal contact TC20.
[0169] Note that the contact (first data contact) TC08 arranged on the side opposite to the installation detection contact TC06 of the SCLK signal contact TC07 transmits a MOSI signal (first data signal). Since the MOSI signal is a data signal, the MOSI signal seems to be susceptible to clock noise. However, since the MOSI signal is a data signal based on the same SPI communication standard as the SPI communication standard on which the clock signal transmitted via the SCLK signal contact TC07 is based, the timing of the change in potential is synchronized with the clock signal, and thus the MOSI signal is hardly affected by clock noise. Therefore, the contact TC08 does not need to be fixed to the ground potential, but can be used as a MOSI signal contact.
[0170] Next, we will explain Figure 12 shows an electrical structure of an accessory 200 that appears in FIG. The accessory 200 includes an accessory controller 201, an accessory power supply unit 202, a power switch 203, a charging section 204, a battery 205, a function section 206, a differential communication section 207, an external communication interface section 208, an external connection terminal 209, and a connection detection section 210. In addition, the accessory 200 includes an accessory connection section 211 and an operation switch 212.
[0171] The accessory controller 201 is a circuit (control unit) that controls the overall operation of the accessory 200, and is implemented by a microcomputer including the above-mentioned CPU, etc. The battery 205 supplies power to the components of the accessory 200. Note that power is also supplied from the camera 100 to the accessory 200 via the camera connection portion 141 and the accessory connection portion 211.
[0172] The accessory power supply unit 202 includes a DC-DC converter circuit, an LDO circuit, a charge pump circuit, and the like, and generates power to be supplied to the components of the accessory 200. A voltage of 1.8 V is always supplied to the accessory controller 201 as the accessory microcomputer power supply VMCU_A generated by the accessory power supply unit 202. Note that the voltage generated by the accessory power supply unit 202 may be configured to be different from 1.8 V. The accessory controller 201 controls the accessory power supply unit 202 to thereby perform on / off control of power supply to the components of the accessory 200.
[0173] The charging section 204 charges the battery 205 using the power supplied from the camera 100. When it is determined that sufficient power for charging the battery 205 is supplied from the camera 100, the accessory controller 201 controls the charging section to charge the battery 205. Note that in the present embodiment, an example of the structure of the accessory 200 to which the battery 205 can be mounted is described, but the accessory 200 may be configured to operate using only the power supplied from the camera 100 without mounting the battery 205, and in this case, the charging section 204 may be omitted.
[0174] The differential communication section 207 is a circuit for differential communication with the camera 100, and can transmit and receive data to and from the camera 100. The external communication interface section 208 is an interface circuit for data communication with an external device (not shown), and is an Ethernet communication interface, a wireless LAN communication interface, or a public network communication interface, etc. The accessory controller 201 controls the differential communication section 207 and the external communication interface section 208, whereby data received from the camera 100 can be transmitted to the external device, and conversely, data received from the external device can be transmitted to the camera 100.
[0175] Function section 206 has different functions depending on the type of accessory 200. For example, when accessory 200 is a flash device, function section 206 includes a lighting circuit and a charging circuit. When accessory 200 is a microphone device, function section 206 includes an audio codec circuit and a microphone circuit.
[0176] The external connection terminal 209 is used to connect to an external device, and in this embodiment, is a USB type-C connector. The connection detection unit 210 is used to detect that an external device is connected to the external connection terminal 209. The accessory controller 201 receives an output signal from the connection detection unit 210, thereby detecting that the external device is connected to the external connection terminal 209.
[0177] The power switch 203 is used to turn on / off the main power of the accessory 200. The accessory controller 201 can detect whether the power switch 203 is in the on position or in the off position by reading the signal level of the terminal connected to the power switch 203. The operation switch 212 is used to operate the accessory 200, and is composed of a button, a cross key, a slide switch, a dial switch, etc. The accessory controller 201 detects the operation performed on any of the operation switches 212, and performs predetermined processing according to the detection result.
[0178] The accessory connection portion 211 is a connector for electrically connecting to the camera 100 via 21 contacts TA01 to TA21 arranged in a row. The contacts TA01 to TA21 are arranged in this order from one end to the other end.
[0179] The contact TA01 as the third ground contact of the accessory connection portion 211 is connected to the ground terminal and is used not only as a contact of a reference potential but also as a contact for controlling the wiring impedance of the differential signal D1N and the differential signal D1P. The contact TA02 and the contact TA03 are connected to the differential communication portion 207. The differential signal D1N is connected to the contact TA02 and the differential signal D1P is connected to the contact TA03. The differential signal D1N and the differential signal D1P are differential data communication signals that perform data communication as a pair. The contacts TA02 and TA03, the contacts TA07 to TA17, TA19, and TA20 are communication contacts.
[0180] The contact TA04 as a first ground contact is connected to the ground terminal, and is used as a contact for a reference potential of the camera 100 and the accessory 200. The contact TA05 as a power supply contact is connected to the accessory power supply section 202 and the charging section 204, and is connected to the accessory power supply VACC supplied from the camera 100. The contact TA04 is arranged at a position outside the contact TA05 in the contact arrangement direction.
[0181] When the accessory 200 is connected to the camera 100, the contact TA06 as the mounting detection contact is directly connected to the ground terminal to set the accessory mounting detection signal / ACC_DET to the ground level (ground potential) as the low level. This enables the camera 100 to detect that the accessory 200 is mounted on itself. The SCLK signal connected to the contact TA07, the MOSI signal connected to the contact TA08, the MISO signal connected to the contact TA09, and the CS signal connected to the contact TA10 are signals for the accessory controller 201 to perform SPI communication as a communication slave.
[0182] The contact TA11 is connected to a communication request signal / WAKE for requesting the camera 100 to communicate. When the accessory controller 201 determines that communication with the camera 100 (camera controller A 101) is necessary, the accessory controller 201 outputs the communication request signal / WAKE at a low level to request the camera 100 to communicate.
[0183] According to detection of the mounting state of the accessory 200, power is supplied from the camera controller A 101 to the accessory 200 via the contact TC05. Then, the accessory controller 201 notifies the camera controller A 101 of power supply by changing the signal level (potential) of the communication request signal / WAKE from high level to low level.
[0184] The accessory controller 201 can notify that a cause has occurred that makes it necessary for the accessory 200 to communicate with the camera 100 by changing the signal level (potential) of the communication request signal \WAKE from a high level to a low level without requesting communication by the camera 100. With this configuration, the camera controller A101 can omit an operation for periodically checking by polling whether a cause has occurred that makes it necessary for the accessory 200 to communicate with the camera 100. Furthermore, in the event that a cause has occurred that makes it necessary for communication, the accessory 200 can notify the camera 100 of that fact in real time.
[0185] The SDA signal connected to the contact TA12 and the SCL signal connected to the contact TA13 are signals for the accessory controller 201 to perform I2C communication as a communication slave.
[0186] The FNC1 signal, FNC2 signal, FNC3 signal, and FNC4 signal connected to the contact TA14, the contact TA15, the contact TA16, and the contact TA17, respectively, are signals (function signals) whose functions can be changed according to the type of accessory 200. For example, in the case where the accessory 200 is a microphone device, a corresponding function signal among these function signals is an audio data signal, and in the case where the accessory 200 is a lighting device (flashlight device), a corresponding function signal among these function signals is a signal notifying light emission timing.
[0187] The contact TA18 as the second ground contact is connected to the ground terminal, and similarly to the contact TA04 as the first ground contact, the potential of the contact TA18 is used as a reference potential of the camera 100 and the accessory 200. The contact TA19 and the contact TA20 are connected to the external connection terminal 209. The differential signal D2N is connected to the contact TA19 and the differential signal D2P is connected to the contact TA20. The differential signals D2N and D2P are data communication signals for data communication as a pair. The contact TA21 as the fourth ground contact is connected to the ground terminal.
[0188] The contacts TA01, TA04, TA06, TA18, and TA21 are connected to, for example, a ground portion of a flexible circuit board (not shown) of the accessory 200. The ground portion of the flexible circuit board is fixed to a metal member whose potential is at the ground level of the accessory 200 by a screw (not shown) or the like. The metal member whose potential is at the ground level is a socket mounting leg for engagement with the accessory socket of the camera 100, or a substrate (not shown) inside the accessory 200.
[0189] Next, refer to Figure 7 An overview of processing performed when the accessory 200 is mounted on the camera 100 will be described. Figure 7 is a sequence diagram showing an example of a processing operation performed when the accessory 200 is mounted on the camera 100 .
[0190] When the accessory 200 is mounted on the camera 100, the accessory mounting detection signal / ACC_DET becomes the ground level, whereby the camera controller A 101 determines that the accessory 200 is mounted on the camera 100. When determining that the accessory 200 is mounted, the camera controller A 101 sets the power control signal CNT_VACC1 to the high level to turn on the output of the accessory power supply unit A 131. The accessory power supply unit A 131 outputs the accessory power VACC to the accessory 200 in accordance with the power control signal CNT_VACC1 changing to the high level.
[0191] In the accessory 200, upon receiving the accessory power VACC, the accessory power unit 202 generates the power VMCU_A for causing the accessory controller 201 to operate, and the accessory controller 201 is activated by receiving the power VMCU_A. After activation, the accessory controller 201 initializes the components of the accessory 200. Thereafter, when the accessory 200 becomes able to communicate with the camera 100, the accessory controller 201 sets the communication request signal / WAKE (contact TA11) to a low level.
[0192] In the camera 100, when the camera controller A 101 detects the low level of the communication request signal / WAKE (TC11), the camera controller A 101 determines that communication with the accessory 200 is established. Then, the camera controller A 101 requests the accessory 200 (accessory controller 201) to transmit accessory information through I2C communication.
[0193] Figure 6 1 is a diagram showing an example of accessory information stored in a nonvolatile memory (not shown) of the accessory controller 201. The accessory information is used to allow the camera 100 to recognize the type of the accessory 200 and the specifications related to the communication and operation (function) of the accessory 200. The accessory information is mapped to a memory space with addresses 0x00 to 0x0F (hereinafter referred to as, for example, "address 0x0F"). The camera controller B 102 is capable of reading the accessory information from the accessory 200 through I2C communication instead of the accessory controller 201. It is assumed that in the I2C communication of the present embodiment, a checksum of the read data is added as the last data of the I2C communication. The details of the accessory information will be described below.
[0194] In the accessory 200, in response to a request for accessory information from the camera 100, the accessory controller 201 transmits the accessory information stored in itself to the camera controller A 101. After transmitting the accessory information to the camera controller A 101, the accessory controller 201 sets the communication request signal / WAKE to a high level. In the camera 100, the camera controller A 101 determines whether the accessory 200 can be controlled based on the received accessory information. In addition, the camera controller A 101 turns on the accessory power supply unit B 132.
[0195] After completing various settings of the camera 100, the camera controller A 101 notifies the camera controller B 102 of the accessory information. The camera controller B 102 performs notification of a control command and control of a function signal to the accessory 200 based on the accessory information. The accessory controller 201 performs control in response to the function signal and the control command from the camera 100 through SPI communication.
[0196] Next, the accessory information stored in the accessory 200 (see Figure 6 ). Data D7 to D0 at address 0x00 represent information indicating the type of the accessory (hereinafter referred to as "accessory type information"). Figure 8 An example of accessory type information is shown. For example, number 0x81 indicates that the accessory is a flash device, and number 0x82 indicates that the accessory is an interface conversion adapter device. In addition, number 0x83 indicates that the accessory is a microphone device, and number 0x84 indicates that the accessory is a multi-accessory connection adapter device for mounting multiple accessory devices on the camera 100.
[0197] Here, the adapter device is an intermediate accessory installed between the camera 100 and an accessory such as a flash device or a microphone device. The interface conversion adapter device is an adapter device for converting interfaces to make the camera 100 and the accessory compatible with each other when the interface of the camera 100 and the interface of the accessory are different. The multi-accessory connection adapter is an adapter device capable of mounting a plurality of accessories.
[0198] Data D7 to D0 at address 0x01 represent information indicating the model (identification number) of accessory 200. By this information and the accessory type information, accessory 200 can be uniquely identified. Data D7 to D0 at address 0x02 represent information indicating the version of the firmware of accessory 200. Note that "ACC" in the rows of addresses 0x01 and 0x02 is used here as an abbreviation for "accessory".
[0199] The data D7 and D6 at the address 0x03 represent information indicating whether supply of the accessory power source VACC is requested when the camera 100 is in the power-off state. As the value of this information, a value of 0 is used when power supply is not required, a value of 1 is used when power supply by the accessory power source unit A 131 is to be requested, and a value of 2 is used when power supply by the accessory power source unit B 132 is to be requested.
[0200] Data D5 to D4 at address 0x03 indicate whether or not to request supply of the accessory power VACC to the accessory 200 when the camera 100 is set to the power saving mode by the automatic power off function or the like. As the value of this information, a value of 0 is used when power supply is not required, a value of 1 is used when power supply by the accessory power supply unit A 131 is to be requested, and a value of 2 is used when power supply by the accessory power supply unit B 132 is to be requested.
[0201] Data D3 to D2 at address 0x03 represent information indicating whether accessory 200 includes battery 205. As the value of this information, value 0 is used when accessory 200 does not include battery 205, and value 1 is used when accessory 200 includes battery 205. Data D1 to D0 at address 0x03 represent information indicating whether accessory 200 is equipped with a function of charging battery 205. As the value of this information, value 0 is used when accessory 200 is not equipped with a function of charging battery 205, and value 1 is used when accessory 200 is equipped with a function of charging battery 205.
[0202] Data D7 to D0 at address 0x04 represent information indicating requested power of the accessory power supply VACC to be supplied from the camera 100 to the accessory 200. For example, it is assumed that the information indicates a value of current that is 10 times the value of the information. For example, in the case where the value of the information is "10", this indicates a current of 100 mA, and in the case where the value of the information is "100", this indicates a current of 1 A.
[0203] In order to reduce the amount of information, the information may be associated with a predetermined current value. For example, when a current of 100 mA, a current of 300 mA, a current of 450 mA, and a current of 600 mA are requested, values 0, 1, 3, and 4 may be used as respective values of the information.
[0204] Data D7 at address 0x05 represents information indicating whether accessory 200 is in firmware update mode. As a value of this information, in the case where accessory 200 is not in firmware update mode, a value of 0 is used, and in the case where accessory 200 is in firmware update mode, a value of 1 is used. Data D6 at address 0x05 represents information indicating whether accessory 200 is equipped with a firmware update function. As a value of this information, in the case where the accessory is not equipped with a firmware update function, a value of 0 is used, and in the case where the accessory is equipped with a firmware update function, a value of 1 is used.
[0205] Data D5 to D4 at address 0x05 represent information indicating whether the accessory 200 is permitted to operate when the accessory 200 is mounted on the camera 100 via the intermediate connection accessory. As the value of this information, a value of 0 is used when the operation is not permitted, and a value of 1 is used when the operation is permitted. Data D3 to D2 at address 0x05 represent information indicating whether it is necessary to check the installation state of the intermediate connection accessory when the camera 100 is activated. As the value of this information, a value of 0 is used when the installation state does not need to be checked, and a value of 1 is used when the installation state needs to be checked. Data D1 to D0 at address 0x05 represent information indicating whether the accessory 200 is compatible with command notification through I2C. As the value of this information, a value of 0 is used when the accessory 200 is not compatible with command notification, and a value of 1 is used when the accessory 200 is compatible with command notification.
[0206] Data D5 to D4 at address 0x06 represent information indicating a communication method capable of notifying the camera 100 of the reason for the communication request after notifying the camera 100 of the communication request signal / WAKE. As the value of this information, when I2C is capable of notification, a value of 0 is used, when SPI communication is capable of notification, a value of 1 is used, and when both I2C communication and SPI communication are capable of notification, a value of 2 is used.
[0207] Data D3, data D2, data D1, and data D0 at address 0x06 represent information on whether accessory 200 is equipped with a communication function using FNC1 signal, FNC2 signal, FNC3 signal, and FNC4 signal, which are function signals, respectively. Data D0, data D1, data D2, and data D3 correspond to FNC1 signal, FNC2 signal, FNC3 signal, and FNC4 signal, respectively, and as the value of the information, a value of 0 is used when the associated communication function is not equipped, and a value of 1 is used when the associated communication function is equipped.
[0208] Data D7 at address 0x0A represents information indicating whether activation of the camera 100 is requested when the accessory 200 notifies the camera 100 of the communication request signal / WAKE. As the value of this information, value 0 is used when activation of the camera 100 is requested, and value 1 is used when activation of the camera 100 is not requested.
[0209] The data D6 to D0 at the address 0x0A represent information indicating the cause of the communication request signal / WAKE notified by the accessory 200 to the camera 100 . Fig. 9 is a diagram showing an example of the cause of the notification of the communication request signal / WAKE. Fig. 9 The reason for the communication request signal / WAKE notification is shown. Fig. 9 , the reason number 0x00 indicates that the menu call switch of the operation switch 212 is pressed. In addition, the reason number 0x01 indicates that the accessory 200 completes the output control of the audio signal, and the reason number 0x02 indicates that the accessory 200 terminates the mute of the audio signal. Therefore, the accessory 200 can notify the information related to the reason of the communication request signal / WAKE.
[0210] Figure 6 Data D1 at address 0x0C in represents information indicating an SPI communication protocol compatible with accessory 200. As a value of this information, when accessory 200 is compatible with SPI protocol A, a value of 0 is used, and when accessory 200 is compatible with SPI protocol B, a value of 1 is used. Data D0 at address 0x0C represents information indicating control logic of a CS signal for SPI communication compatible with accessory 200. As a value of this information, when the CS signal is low active, a value of 0 is used, and when the CS signal is high active, a value of 1 is used.
[0211] Data D7 to D0 at address 0x0D represent information indicating a time period required as an interval between communication bytes when accessory 200 communicates using SPI protocol A and accessory 200 is not in firmware update mode (data D7 at address 0x05 is 0). Fig. 10A Each of the data represented by the address 0x0D is an example of a time period required as an interval between communication bytes. In addition, the data D7 to D0 at the address 0x0E represent information indicating a time period required as an interval between communication bytes when the accessory 200 communicates using the SPI protocol A and the accessory 200 is in the firmware update mode (the data D7 at the address 0x05 is 1). Fig. 10B Each of those represented by the data at the address 0x0E is shown as an example of a time period required as an interval between communication bytes.
[0212] Fig.11 1 is a flowchart of processing performed by the camera controller A 101 after the accessory 200 is mounted on the camera 100 until the function of the accessory 200 is activated. Fig.11 , each processing operation (step) indicated by an S number is realized by the CPU of the camera controller A 101 loading a predetermined program stored in the ROM of the camera controller A 101 into its RAM.
[0213] In step S401, the camera controller A 101 monitors the signal level of the accessory installation detection signal / ACC_DET to determine whether the accessory 200 is installed. More specifically, the camera controller A 101 determines whether the accessory installation detection signal / ACC_DET is at a low level or at a high level. In the case where the accessory installation detection signal / ACC_DET is determined to be at a low level, it is determined that the accessory 200 is installed, and in the case where the accessory installation detection signal / ACC_DET is determined to be at a high level, it is determined that the accessory 200 is not installed. In the case where it is determined that the accessory installation detection signal / ACC_DET is at a high level ("No" in step S401), the determination of step S401 is repeated, and in the case where it is determined that the accessory installation detection signal / ACC_DET is at a low level ("Yes" in step S401), the processing proceeds to step S402.
[0214] In step S402, the camera controller A 101 controls the power control signal CNT_VACC1 to a high level to turn on the output of the accessory power supply unit A 131. When the power control signal CNT_VACC1 goes high, the accessory power supply unit A 131 outputs the accessory power VACC.
[0215] In step S403, the camera controller A 101 monitors the signal level of the overcurrent detection signal DET_OVC, and determines whether an overcurrent is flowing. More specifically, in the case where the overcurrent detection signal DET_OVC is at a low level, the camera controller A 101 determines that no overcurrent is flowing, and in the case where the overcurrent detection signal DET_OVC is at a high level, the camera controller A 101 determines that an overcurrent is flowing. In the case where it is determined that the overcurrent detection signal DET_OVC is at a low level ("Yes" in step S403), the processing proceeds to step S404, and in the case where it is determined that the overcurrent detection signal DET_OVC is at a high level ("No" in step S403), the present processing is terminated and error processing is performed.
[0216] In step S404, the camera controller A 101 monitors the signal level of the communication request signal / WAKE transmitted from the accessory 200 to detect whether the initialization of the accessory 200 is completed. More specifically, when the communication request signal / WAKE is at a low level, the camera controller A 101 determines that the initialization of the accessory 200 is completed, and when the communication request signal / WAKE is at a high level, the camera controller A 101 determines that the initialization of the accessory 200 is not completed. When it is determined that the communication request signal / WAKE is at a high level (No in step S404), the camera controller A 101 repeats the determination of step S404, and when it is determined that the communication request signal / WAKE is at a low level (Yes in step S404), the processing proceeds to step S405.
[0217] In step S405, the camera controller A 101 performs I2C communication with the accessory 200 to read 15 bytes of accessory information. In step S406, the camera controller A 101 determines whether the accessory 200 mounted on the camera 100 is a device compatible with the camera 100 (hereinafter referred to as a "camera-compatible accessory") based on the read accessory information. In the case where it is determined that the mounted accessory is not a camera-compatible accessory ("No" in step S406), the present process is terminated and error processing is performed. In the case where it is determined that the mounted accessory is a camera-compatible accessory, the process proceeds to step S407.
[0218] In step S407, the camera controller A 101 controls the power control signal CNT_VACC2 to a high level so as to turn on the output of the accessory power supply unit B 132. When the power control signal CNT_VACC2 becomes high, the accessory power supply unit B 132 outputs the accessory power VACC. Note that in the present embodiment, in the case where both the power control signal CNT_VACC1 and the power control signal CNT_VACC2 are controlled to a high level, it is assumed that the accessory power VACC is output by the accessory power supply unit B 132. In step S408, the camera controller A 101 notifies the camera controller B 102 of the accessory information read in step S405, and then terminates the present process.
[0219] Fig.12 1 is a flowchart of processing performed by the camera controller B 102 after the accessory 200 is mounted on the camera 100 until the function of the accessory 200 is activated. Fig.12 , each processing operation (step) indicated by an S number is realized by the CPU of the camera controller B 102 loading a predetermined program stored in the ROM of the camera controller B 102 into its RAM.
[0220] In step S501, the camera controller B 102 determines whether the accessory information has been notified from the camera controller A 101. When it is determined that the accessory information has not been notified ("No" in step S501), the determination in step S501 is repeated, and when it is determined that the accessory information has been notified ("Yes" in step S501), the process proceeds to step S502.
[0221] In step S502, the camera controller B 102 sets the settings of the function signals FNC1 to FNC4 based on the accessory information notified from the camera controller A 101. For example, in the case where it is notified that the accessory 200 is a microphone device, the function signals FNC1, FNC2, and FNC3 are set to the audio data clock signal BCLK, the audio data channel signal LRCLK, and the audio data signal SDATA, respectively. As another example, in the case where it is notified that the accessory 200 is a flash device, the function signal FNC4 is set to the flash lighting synchronization signal XOUT. Note that for the function signal that does not require the control of the accessory 200, a predetermined setting is set to prevent the operation of the camera 100 and the accessory 200 from being hindered.
[0222] In step S503, the camera controller B 102 sets the setting of the control logic of the CS signal of the SPI communication based on the accessory information notified from the camera controller A 101. In step S504, the camera controller B 102 determines whether a predetermined event has occurred for the accessory 200. In a case where it is determined that the predetermined event has not occurred (No in step S504), the camera controller B 102 repeats the determination of step S504, and in a case where it is determined that the predetermined event has occurred (Yes in step S504), the processing proceeds to step S505.
[0223] In step S505, the camera controller B 102 determines whether the event detected in step S504 is an event requiring SPI communication with the accessory 200. In a case where it is determined that the detected event is an event requiring SPI communication ("YES" in step S505), the process proceeds to step S506, and in a case where it is determined that the detected event is not an event requiring SPI communication ("NO" in step S505), the process proceeds to step S507.
[0224] In step S506, the camera controller B 102 performs SPI communication with the accessory 200. For example, as the SPI communication performed in the case where the accessory 200 is a microphone device, there can be mentioned communication for instructing, for example, switching on / off of the operation of the microphone device, switching the sound collection directivity of the microphone device, and switching the equalizer function of the microphone device. Furthermore, as the SPI communication performed in the case where the accessory 200 is a flash device, there can be mentioned, for example, communication for reading setting information of the flash device and communication for notifying the setting information to the flash device. After step S506, the process returns to step S504.
[0225] In step S507, the camera controller B 102 determines whether the event detected in step S504 is an event requiring control using a function signal to communicate with the accessory 200. In a case where it is determined that the detected event is an event requiring control using a function signal ("YES" in step S507), the processing proceeds to step S508, and in a case where it is determined that the detected event is an event not requiring control using a function signal ("NO" in step S507), the processing proceeds to step S509.
[0226] In step S508, the camera controller B 102 performs control of the accessory 200 using the function signal. In the case where the accessory 200 is a microphone device, as the control performed in step S508, there can be mentioned control for accepting the audio data channel signal SDATA as the function signal FNC3 in synchronization with the start of output of the audio data clock signal BCLK as the function signal FNC1 and the audio data channel signal LRCLK as the function signal FNC2. This makes it possible to acquire audio data from the accessory 200. Furthermore, in the case where the accessory 200 is a flash device, as the control performed in step S508, there can be mentioned control of the flash lighting synchronization signal XOUT as the function signal FNC4 at a desired timing. This makes it possible for the camera 100 to notify the flash device of a lighting instruction. After step S508, the process returns to step S504.
[0227] In step S509, the camera controller B 102 performs predetermined camera internal control according to the event detected in step S504. As the camera internal control in the case where the accessory 200 is a microphone device, there can be mentioned control of start / stop of recording audio data in the recording memory 126, control of equalizer processing of audio data, and the like. Furthermore, as the camera internal control in the case where the accessory 200 is a flash device, there can be mentioned control of photometry using the image sensor 122 by causing the flash device to emit light, control of an indication value for calculating the amount of light emitted using the flash device, and the like. After step S509, the process returns to step S504.
[0228] By conducting Fig.11 and 12 By performing the processing shown in the figure, the camera 100 can control the accessory 200 mounted on the camera 100. Note that the details of the processing using the camera controller B 102 are as described above, but Fig.12 For example, when an operation for stopping the use of the accessory 200 or an operation for turning off the power of the camera 100 or the accessory 200 is performed on the camera 100 during the execution of the determination of step S504, the termination step is performed. Fig.12 processing.
[0229] Fig.13 2 is a flowchart of processing performed by the accessory controller 201 after the accessory 200 is mounted on the camera until the function of the accessory 200 operates. Fig.13 , each processing operation (step) indicated by an S number is realized by the CPU of the accessory controller 201 loading a predetermined program stored in the ROM of the accessory controller 201 into its RAM.
[0230] In step S601, the accessory controller 201 determines whether the supply of the accessory power VACC from the camera 100 is started (whether the accessory power VACC is turned on). Here, in a case where the accessory 200 is not equipped with the battery 205, the accessory controller 201 determines that the accessory power VACC is turned on based on the fact that power is supplied to the accessory controller 201 and the accessory controller 201 itself starts operating. In a case where the accessory 200 is equipped with the battery 205, the accessory controller 201 can detect the start of the supply of the accessory power VACC by monitoring the voltage value of the accessory power VACC. In a case where it is determined that the accessory power VACC is not turned on (No in step S601), the accessory controller 201 repeats the determination of step S601, and in a case where it is determined that the accessory power VACC is turned on (Yes in step S601), the process proceeds to step S602.
[0231] In step S602, the accessory controller 201 performs initialization. For example, the accessory controller 201 sets the setting of the operating frequency range of the accessory controller 201 itself, the setting of the input and output control ports of the microcomputer, the initialization setting of the timer function of the microcomputer, the initialization setting of the interrupt function of the microcomputer, etc. In step S603, the accessory controller 201 controls the communication request signal / WAKE to a low level. Thus, the completion of the initialization of the accessory 200 is notified from the accessory controller 201 to the camera 100. In step S604, the accessory controller 201 responds to the I2C communication from the camera 100 to send 15 bytes of accessory information. The accessory information includes Figure 6 In step S605, the accessory controller 201 controls the communication request signal / WAKE to a high level.
[0232] In step S606, the accessory controller 201 determines whether a predetermined event has occurred. If it is determined that the predetermined event has not occurred ("No" in step S606), the accessory controller 201 repeats the determination of step S606, and if it is determined that the predetermined event has occurred ("Yes" in step S606), the process proceeds to step S607.
[0233] In step S607, the accessory controller 201 determines whether the occurred event is an event requiring SPI communication with the camera 100. In a case where it is determined that the occurred event is an event requiring SPI communication with the camera 100 ("YES" in step S607), the process proceeds to step S608, whereas if it is determined that the occurred event is not an event requiring SPI communication with the camera 100 ("NO" in step S607), the process proceeds to step S609.
[0234] In step S608, the accessory controller 201 performs SPI communication with the camera 100. In the case where the communication request signal / WAKE is at a low level during the execution of the SPI communication, the accessory controller 201 changes the communication request signal / WAKE to a high level after the execution of the SPI communication. As the SPI communication performed in the case where the accessory 200 is a microphone device, there can be mentioned communication for instructing, for example, switching on / off of the operation of the microphone device, switching the sound collection directivity of the microphone device, and switching the equalizer function of the microphone device. In addition, as the SPI communication performed in the case where the accessory 200 is a flash device, there can be mentioned, for example, communication for reading setting information of the flash device and communication for notifying the flash device of the setting information. After step S608, the process returns to step S606.
[0235] In step S609, the accessory controller 201 determines whether the occurred event is an event requiring I2C communication with the camera 100. In a case where it is determined that the occurred event is an event requiring I2C communication with the camera 100 ("YES" in step S609), the process proceeds to step S610, and in a case where it is determined that the occurred event is not an event requiring I2C communication with the camera 100 ("NO" in step S609), the process proceeds to step S611.
[0236] In step S610, the accessory controller 201 performs I2C communication with the camera 100. In the case where the communication request signal / WAKE during the execution of SPI communication is at a low level, the accessory controller 201 changes the communication request signal / WAKE to a high level. As the I2C communication performed in step S610, for example, communication for reading the cause of the communication request according to the notification of the communication request signal / WAKE from the accessory controller 201 to the camera 100 can be mentioned. After step S610, the process returns to step S606.
[0237] In step S611, the accessory controller 201 determines whether the event that occurred is an event that is controlled using a function signal. If it is determined that the event that occurred is an event that is controlled using a function signal ("Yes" in step S611), the process proceeds to step S612, and if it is determined that the event that occurred is not an event that is controlled using a function signal ("No" in step S611), the process proceeds to step S613.
[0238] In step S612, the accessory controller 201 performs control of the camera 100 using the function signal. As control performed in the case where the accessory 200 is a microphone device, the following control can be mentioned: the accessory controller 201 performs reception control of the audio data clock signal BCLK as the function signal FNC1 and the audio data channel signal LRCLK as the function signal FNC2 output from the camera 100. Then, the accessory controller 201 performs control of outputting the audio data signal SDATA as the function signal FNC3 in synchronization with the received audio data clock signal BCLK and audio data channel signal LRCLK. Furthermore, as control performed in step S612 in the case where the accessory 200 is a flash device, flash lighting control performed in response to reception of the flash lighting synchronization signal XOUT as the function signal FNC4 can be mentioned. After step S612, the process returns to step S606.
[0239] In step S613, the accessory controller 201 determines whether the occurred event is an event notified to the camera 100 by the communication request signal / WAKE. In the case where it is determined that the occurred event is an event notified to the camera 100 by the communication request signal / WAKE ("Yes" in step S613), the process proceeds to step S614, and in the case where it is determined that the occurred event is not an event notified to the camera 100 by the communication request signal / WAKE ("No" in step S613), the process proceeds to step S615.
[0240] In step S614, the accessory controller 201 stores the reason number of the communication request to the camera in response to the occurred event in the nonvolatile memory of the accessory controller 201 itself, and controls the communication request signal / WAKE to a low level. Fig. 9 As described above, a unique number is assigned to each reason. After step S614, the process returns to step S606.
[0241] In step S615, the accessory controller 201 performs accessory internal control in response to the event that occurred. As the accessory internal control performed in step S615, for example, detection control of the remaining power of the battery 205 in the case where the battery 205 is equipped in the accessory 200 and detection control of the operation switch 212 can be mentioned. After step S615, the process returns to step S606.
[0242] References Fig.13The processing described above enables the accessory 200 to perform a predetermined functional operation after the accessory 200 is mounted on the camera 100. Note that, for example, in the case where an operation for stopping the use of the accessory 200 or an operation for turning off the power of the camera 100 or the accessory 200 is performed on the camera 100 during the repeated execution of the determination of step S606, the operation is terminated. Fig.13 A series of processing operations are shown.
[0243] Next, the first embodiment of the present invention will be described. Fig.13 A checksum error occurs during the SPI communication in step S608.
[0244] Fig.14 1 is a diagram showing another example of the details of communication for notifying the accessory 200 of an operation execution instruction (command) from the camera 100 through SPI communication. Fig.14 In the communication shown, CheckSum_C and CheckSum_A are sent at the same timing as the Nth byte, which makes Fig.14 The communication in Figure 5 In this case, the camera controller B 102 makes a judgment on CheckSum_A, so if CheckSum_A is wrong, the camera 100 (camera controller B 102) can perform the same communication again. However, if CheckSum_C is wrong, the camera 100 cannot perform the resending process unless the accessory 200 notifies the camera 100 of the error in some way. Fig.15 A method of notifying the camera 100 of an error from the accessory 200 in this case will be described.
[0245] Fig.15 It is used to illustrate the Fig.14 0x0A is a sequence diagram showing an example of a method of notifying the camera 100 of an error from the accessory 200 in the event that a checksum error occurs during SPI communication in . In the event that the camera 100 receives a communication request signal / WAKE before a predetermined period of time has elapsed after the determination of CheckSum_A, the camera 100 acquires the content of the received communication request and performs processing corresponding to the acquired content. On the other hand, the accessory 200 determines CheckSum_C. Then, in the event that the received CheckSum_C and the first CheckSum_C_A calculated by the accessory 200 itself do not coincide (in the event of NG), the accessory 200 stores a cause number indicating a checksum error in the address 0x0A and sets the communication request signal / WAKE to a low level. This makes it possible to notify the camera 100 of a checksum error from the accessory 200.
[0246] Here, the communication request signal / WAKE is connected to the camera controller A 101, and the SPI communication is connected to the camera controller B 102. For this reason, the need to communicate between the camera controller A 101 and the camera controller B 102 causes the processing to be complicated and the response to the occurrence of an error to be delayed.
[0247] Fig.16 is used to explain the method for using the first embodiment Figure 5 1 is a sequence diagram showing an example of a method of notifying the camera 100 of an error when a checksum error occurs during SPI communication in the form shown. Figure 5 In the form of SPI communication shown in FIG. 1 , after the camera 100 transmits CheckSum_C through the (N-1)th byte, the accessory 200 transmits CheckSum_A through the Nth byte. In this case, after receiving CheckSum_C from the camera 100, the accessory controller 201 determines whether the value of the received CheckSum_C is consistent with the value of the first CheckSum_C_A calculated by the accessory controller 201 itself based on the received data. Then, in the case where the value of CheckSum_C is consistent with the value of CheckSum_C_A, the accessory controller 201 calculates the second CheckSum_A and transmits it to the camera 100 (camera controller B 102). On the other hand, in the case where the value of CheckSum_C is inconsistent with the value of CheckSum_C_A, the accessory controller 201 calculates the third CheckSum_A by the following formula (4).
[0248] CheckSum_A=AND(SUM(CMD,MOSI_DATA1,…,MOSI_DATA[N-3]),0xFF)…(4)
[0249] This allows the camera 100 (camera controller B 102) to check the received CheckSum_A and, if a checksum error has not occurred, proceed to the next process to be performed, or, if a checksum error has occurred, resend the same command.
[0250] Therefore, by adopting a method of transmitting CheckSum_A after receiving CheckSum_C, the accessory 200 can notify a checksum error during one communication, so the responsiveness when a checksum error occurs can be improved. In addition, since the camera 100 does not need to be aware of whether an error has occurred in the accessory 200, the process using the camera 100 can be simplified. In addition, since the accessory 200 only needs to operate according to the communication content from the camera 100, the accessory 200 does not need to perform special processing other than calculating the third CheckSum_A, so the process using the accessory 200 can be simplified.
[0251] Note that the camera 100 can know whether an error has occurred in the accessory 200 based on the value of CheckSum_A. More specifically, in the case where the value of CheckSum_A does not take 0xff of EXOR, it can be determined that an error has occurred in the accessory 200. In addition, by taking into account the case where the checksum error is not a temporary checksum error but is caused by a failure of hardware, the number of retransmissions of the same command can be specified (limited). In this case, when the checksum error does not improve even after a predetermined number of retransmissions are performed, it is desirable to transition to error processing.
[0252] Next, a second embodiment of the present invention will be described. Fig.17 and Fig.18 To illustrate Fig.13 A checksum error occurs during the I2C communication in step S610 in the process.
[0253] Fig.17 is a diagram showing another example of accessory information stored in the nonvolatile memory (not shown) of the accessory 200. As described above, in the case where the accessory 200 is compatible with the command notification through the I2C communication, the values of the data D1 to D0 at the address 0x05 are set to 1. Fig.17 In the accessory information shown, it is assumed that the value of data D1 to D0 at address 0x05 is set to 1, and the information at address 0x0F is set to "command" instead of Figure 6 In this case, when a command is written from the camera 100 to the address 0x0F of the accessory 200 through I2C communication, the accessory 200 performs processing associated with the written command.
[0254] Fig.18 1 is a diagram showing an example of details of communication performed between the camera 100 and the accessory 200 by I2C communication. Fig.18 In FIG. 1 , the upper row shows a signal transmitted from the camera 100 to the accessory 200, and the lower row shows a signal transmitted from the accessory 200 to the camera 100. Fig.18 , "S" represents a start condition, "P" represents a stop condition, "W" represents a write notification bit, "R" represents a read notification bit, "A" represents a data reception notification (ACK), and "N" represents a data communication completion notification (NACK).
[0255] like Fig.18 As shown, the command CMD_I2C is written from the camera 100 to the address 0x0F of the nonvolatile memory. Then, the camera 100 sends the arguments ARGV0 to ARGVm required to execute the command CMD_I2C and finally CheckSumI2C_C which is the checksum from the camera 100 to the accessory 200. Here, CheckSumI2C_C is calculated by the camera controller B 102 by the following equation (5).
[0256] CheckSumI2C_C=EXOR(AND(SUM(0x0F,CMD_I2C,ARGV0,…,ARGVm),0xFF),0xFF)…(5)
[0257] On the other hand, the accessory 200 returns CMD_I2C received by reading the first byte after the notification bit to the camera 100. Thereafter, the accessory 200 transmits RET0 to RETn as return values and CheckSumI2C_A as a checksum from the accessory 200 to the camera 100.
[0258] In doing so, since I2C communication is half-duplex communication, when the camera 100 requests writing (WRITE), CheckSumI2C_C is sent from the camera 100 to the accessory 200. Then, when reading (READ) is requested later, the accessory 200 sends CheckSumI2C_A to the camera 100. At this time, similarly to the SPI communication described in the first embodiment, the accessory controller 201 determines whether CheckSumI2C_C is consistent with the checksum (hereinafter referred to as "CheckSumI2C_C_A") calculated by the accessory controller 201 itself based on the received data. In the case where the accessory controller 201 determines that CheckSumI2C_C is consistent with CheckSumI2C_C_A, the accessory controller 201 calculates the first CheckSumI2C_A by the following formula (6) and sends it to the camera 100. Furthermore, when the accessory controller 201 determines that CheckSumI2C_C and CheckSumI2C_C_A are inconsistent, the accessory controller 201 calculates a second CheckSumI2C_A by the following equation (7) and sends it to the camera 100. Note that the processing performed by the camera 100 and the accessory 200 based on CheckSumI2C_C and CheckSumI2C_A is the same as in the first embodiment, and therefore description thereof is omitted.
[0259] CheckSumI2C_A=EXOR(AND(SUM(CMD_I2C,RET0,…,RETn),0xFF),0xFF)…(6)
[0260] CheckSumI2C_A=AND(SUM(CMD_I2C,RET0,…,RETn),0xFF)…(7)
[0261] Next, a third embodiment of the present invention will be described. In the first and second embodiments, the values of the checksums (CheckSum_A and CheckSumI2C_A) sent to the camera 100 are made different between the case where a checksum error does not occur in the accessory 200 and the case where a checksum error occurs in the accessory 200. In the third embodiment, another method of coping with the case where a checksum error occurs during SPI communication will be described.
[0262] As described above, the accessory 200 transmits the value 0xA5 indicating the communication enabled state as MISO signal data in the first byte of SPI communication. If the accessory 200 cannot perform the communication process of the first byte, the accessory 200 transmits a value other than 0xA5 as MISO signal data.
[0263] In this case, if the 1st byte of the MISO signal data is not 0xA5, the camera 100 retransmits the same command. In the present embodiment, the number of retransmissions is set to two, and the same command is transmitted up to three times, but in the case where communication is not successful even when the command is transmitted for the third time, the process enters error processing. In this case, if a checksum error occurs in the accessory 200, it is possible to transition to error processing by always setting the 1st byte of subsequent communications to a value other than 0xA5.
[0264] Alternatively, instead of transitioning to error handling, the camera 100 may switch the accessory power supply VACC from off to on. Figure 7 By turning on the accessory power supply unit A 131 as in the above process, communication with the accessory 200 is restarted, and communication with the accessory 200 can be performed again. Note that in this case, it is desirable that the camera 100 and the accessory 200 each reset the contents of communication to prevent a malfunction from occurring when communication is restarted.
[0265] Next, a fourth embodiment of the present invention will be described. In the first and second embodiments, the values of the checksums (CheckSum_A and CheckSumI2C_A) sent to the camera 100 are made different between the case where a checksum error does not occur in the accessory 200 and the case where a checksum error occurs in the accessory 200. In the fourth embodiment, another method of coping with the case where a checksum error occurs during SPI communication and I2C communication will be described.
[0266] The camera 100 determines that a timeout has occurred when a predetermined period of time has passed in a state where the potential of the MISO signal is at a low level, and performs communication again. In this embodiment, the number of retransmissions is set to two, and the same command is sent up to three times, but when communication is not successful even when the command is sent for the third time, the process enters error processing.
[0267] Therefore, in the event that a checksum error occurs in the accessory 200, it is possible to transition to error processing by setting the potential (output level) of the MISO signal for the next communication and subsequent communications to a low level. On the other hand, instead of entering error processing, the camera 100 switches the accessory power supply VACC from off to on, thereby switching from the control mode as described in reference to FIG. Figure 7 By turning on the accessory power supply unit A 131 as in the above process, communication with the accessory 200 is restarted, and communication with the accessory 200 can be performed again. Note that in this case, it is desirable that the camera 100 and the accessory 200 each reset the contents of communication to prevent a malfunction from occurring when communication is restarted.
[0268] Next, a fifth embodiment of the present invention will be described. Here, another method for coping with a checksum error during SPI communication and I2C communication will be described. In the case where a checksum error occurs in accessory 200, as described above with reference to Fig.13 As described above, the accessory controller 201 stores the reason number indicating initialization (S602) in the address 0x0A, and sets the communication request signal / WAKE to a low level (S603). Then, the camera controller B 102 receives the communication request signal / WAKE and acquires the content of the communication request, and performs processing corresponding to the acquired content. This enables the camera 100 and the accessory 200 to establish communication again. Note that in this case, it is desirable that the camera 100 and the accessory 200 each reset the content of the communication, thereby preventing a malfunction from being caused when the communication is restarted.
[0269] Next, a sixth embodiment of the present invention will be described. Still another method of coping with a case where a checksum error occurs during SPI communication and I2C communication will be described.
[0270] The accessory 200 is configured so that, in the event of a checksum error occurring in the accessory 200, after the accessory installation detection signal / ACC_DET is set to a high level for a predetermined period of time, the accessory installation detection signal / ACC_DET may be set to a low level again. Thus, the camera controller A 101 determines that the accessory 200 is installed again after the accessory 200 is removed from the camera 100, and the accessory controller 201 is able to Fig.13 Note that in this case, it is desirable that the camera 100 and the accessory 200 each reset the content of communication, thereby preventing a malfunction from being caused when the communication is restarted.
[0271] Next, a seventh embodiment of the present invention will be described. Still another method of coping with a case where a checksum error occurs during SPI communication and I2C communication will be described.
[0272] Accessory 200 is configured so that when a checksum error occurs in accessory 200, accessory controller 201 resets the firmware of accessory 200. Thus, accessory controller 201 can Fig.13 Note that in this case, it is desirable that the camera 100 and the accessory 200 each reset the content of communication, thereby preventing a malfunction from being caused when the communication is restarted.
[0273] Next, an eighth embodiment of the present invention will be described. In the above-described embodiments, the accessory 200 includes a microcomputer including a CPU, a nonvolatile memory, etc. as the accessory controller 201 for controlling the overall operation of the accessory 200. In contrast, in this embodiment, a method of coping with a checksum error occurring in the accessory when an accessory that does not include a microcomputer is mounted on the camera 100 will be described.
[0274] Fig.19 2 is a block diagram showing the electrical structure of the accessory 200A. Figure 1 Components identical to those of the accessory 200 appearing in FIG. 1 are denoted by the same reference numerals, and redundant description thereof is omitted. The accessory controller 201A of the accessory 200A is not equipped with a microcomputer including a CPU, a nonvolatile memory, etc., and is different from the accessory controller 201 in that the accessory controller 201A performs analog control. Note that the accessory 200A includes an EEPROM 213 as a nonvolatile memory as a data storage section.
[0275] In the accessory 200A, a communication terminal for performing I2C communication between the camera 100 and the accessory 200A is directly connected to the EEPROM 213. The SDA signal of the camera 100 is connected to the EEPROM 213 via the contact TA12 of the accessory connection portion 211, and the SCL signal of the camera 100 is connected to the EEPROM 213 via the contact TA13 of the accessory connection portion 211.
[0276] Fig. 20 An example of accessory information stored in the accessory 200A is shown, and the reference Figure 6 and Fig.17 The accessory information stored in the accessory 200A corresponds to the content of the Figure 6 The difference in the accessory information in accessory 200 is the information to be stored in address 0x0B and address 0x0F of the storage area where the accessory information is stored. More specifically, a checksum of 15 bytes of data from address 0x00 to address 0x0E (the entirety of the accessory information) is stored at address 0x0F at the end of the area, and instead of leaving address 0x0B, a checksum of 2 bytes of data (a portion of the accessory information) mentioned below is stored at address 0x0B. Note that in accessory 200A, data D1 to D0 at address 0x05 are set to 0 (zero), which means that accessory 200A is not compatible with I2C commands.
[0277] It is assumed that the I2C communication performed between the camera 100 and the accessory 200A after the accessory 200A is mounted on the camera 100 is compatible with two types of read communication methods. The first read communication method is a communication method in which the address 0x00 is specified as the read start address, and this method is hereinafter referred to as "read communication method A". In the read communication method A, 15 bytes can be read by one communication. The second read communication method is a communication method in which an address other than the address 0x00 is specified as the read start address, and this method is hereinafter referred to as "read communication method B". In the read communication method B, 2 bytes can be read by one communication.
[0278] Fig.21A is a diagram showing an example of the content of communication by the reading communication method A, in which the upper row shows a transmission signal from the camera 100 to the accessory 200A, and the lower row shows a transmission signal from the accessory 200A to the camera 100. Fig.21A In the , "S" indicates a start condition, "P" indicates a stop condition, "W" indicates a write notification bit, "R" indicates a read notification bit, "A" indicates a data reception notification (ACK), and "N" indicates a data communication completion notification (NACK)
[0279] like Fig.21A As shown, when 0x00 is designated as the read start address, 15 bytes from address 0x00 to address 0x0E and a checksum are sent from the accessory 200A to the camera 100. The checksum in the read communication method A is calculated by the following equation (8). Here, DATA0 represents the data at address 0x00, and DATA14 represents the data at address 0x0E.
[0280] CheckSumI2C_A=EXOR(AND(SUM(DATA0,…,DATA14),0xFF),0xFF)…(8)
[0281] Fig.21B 1 is a diagram showing an example of the content of communication by the reading communication method B, in which the upper row shows a transmission signal from the camera 100 to the accessory 200A, and the lower row shows a transmission signal from the accessory 200A to the camera 100. Fig.21B As shown, address 0x09 other than address 0x00 is designated as the read start address. In this case, it is assumed that 2-byte data at address 0x09 and address 0x0A and a checksum are sent from accessory 200A to camera 100. The checksum in read communication method B is calculated by the following equation (9). In equation (9), DATA(m) is the data at the start address, and DATA(m+1) is the data at the address 1 byte higher than the start address. Fig.21BDATA(m) corresponds to DATA9, and DATA(m+1) corresponds to DATA10.
[0282] CheckSumI2C_A=EXOR(AND(SUM(DATA(m),DATA(m+1),0xFF),0xFF)…(9)
[0283] In the above reference Fig.11 In step S405 (initial communication) in the processing described above, the camera controller A 101 performs I2C communication with the accessory 200A, and reads 15 bytes of accessory information (read communication method A). Then, in step S406, the camera controller A 101 determines whether the accessory 200A is compatible with the camera 100 based on the accessory information read in step S405. In a case where the camera controller A 101 determines that the accessory 200A is compatible with the camera 100 ("Yes" in step S406), the processing proceeds to step S407, and in a case where the camera controller A 101 determines that the accessory 200A is not compatible with the camera 100 ("No" in step S406), the processing proceeds to error processing. In a case where it is determined that a checksum error has occurred in the accessory 200A in reading communication method A, the camera controller A 101 determines that the accessory 200A is not compatible with the camera 100, and the processing proceeds to error processing.
[0284] On the other hand, Fig.13 In step S609 of the process of , the accessory controller 201A determines whether the detected event requires I2C communication with the camera 100. Then, in a case where the accessory controller 201A determines that the detected event requires I2C communication with the camera 100, the process proceeds to step S610 to perform communication related to the checksum by reading the communication method B. In the reading communication method B, as described above, 2 bytes of data can be read by one communication. In a case where the camera controller A 101 determines that a checksum error has occurred in the accessory 200A by reading the communication method B, the camera controller A 101 determines that the accessory 200A is incompatible with the camera 100, and the process proceeds to error processing.
[0285] Note that the data stored in the EEPROM 213 is different from the fixed value of the accessory 200A. Figure 6 Therefore, according to the present embodiment, even for the accessory 200A which does not include a microcomputer, an error in the communication data can be detected.
[0286] Note that the embodiment has been described by focusing mainly on the form in which the accessory 200 is directly mounted on the camera 100, but the embodiment may take another form. For example, the embodiment may take a form in which the camera 100 communicates with a main accessory corresponding to the accessory 200 via an intermediate accessory (such as an adapter device) mounted on the camera 100. In this form, communication control similar to at least a part of the communication control performed by the accessory 200 and the communication control performed by the camera 100 described in the above-mentioned embodiment may be performed by the intermediate accessory. Alternatively, the intermediate accessory may be made to function as a transmission path for outputting information corresponding to information input from the camera 100 to the main accessory and outputting information corresponding to information input from the main accessory to the camera 100. As described above, the accessories according to the present invention may include various accessories such as a microphone device, a lighting device, and an adapter device. In addition, the adapter device may be included in the electronic device according to the present invention.
[0287] For example, in the above-mentioned embodiment, as an example of the electronic device according to the present invention, a camera (digital camera) and an accessory mounted thereon are described, but the electronic device and the accessory according to the present invention are not limited to these. For example, as the electronic device according to the present invention, electronic devices with portability such as digital cameras and smart phones, wearable terminals, car cameras, security cameras, etc. can be mentioned. In addition, insofar as the accessory is any electronic device among various electronic devices that can be mounted on (connected to) these electronic devices, the present invention can be applied to the accessory.
[0288] Other embodiments
[0289] The embodiments of the present invention may also be implemented by the following method, that is, the software (program) for executing the functions of the above-mentioned embodiments is supplied to a system or device through a network or various storage media, and the computer or central processing unit (CPU) or microprocessing unit (MPU) of the system or device reads and executes the program.
[0290] While the present invention has been described with reference to exemplary embodiments, it is to be understood that the invention is not limited to the disclosed exemplary embodiments. The scope of the following claims is to be accorded the broadest description so as to encompass all such modifications, equivalent structures and functions.
[0291] This application claims the benefit of Japanese Patent Application No. 2021-073484, filed on Apr. 23, 2021, which is hereby incorporated by reference in its entirety.
Claims
1. An accessory for sending data to and receiving data from an electronic device via serial communication, the accessory comprising: at least one processor; as well as A memory coupled to the at least one processor, the memory having instructions that, when executed by the processor, operate as the following units: a calculation unit configured to calculate a checksum; a determination unit configured to determine whether the checksum received from the electronic device is consistent with a first checksum calculated by the calculation unit based on the data received from the electronic device; a control unit configured to calculate a second checksum using the calculation unit based on a return value sent to the electronic device in response to data received from the electronic device if the checksum received from the electronic device is consistent with the first checksum, and to calculate a third checksum using the calculation unit if the checksum received from the electronic device is inconsistent with the first checksum; as well as A sending unit is configured to send the second checksum or the third checksum to the electronic device according to the determination result of the determination unit.
2. The accessory according to claim 1, wherein: The control unit sets the third checksum to a 1's complement of the second checksum.
3. The accessory according to claim 2, wherein: The accessory communicates with the electronic device once with a predetermined number of bytes, and The sending unit sends the second checksum or the third checksum to the electronic device after receiving the checksum from the electronic device during one communication.
4. An accessory for sending data to and receiving data from an electronic device via serial communication, the accessory comprising: at least one processor; as well as A memory coupled to the at least one processor, the memory having instructions that, when executed by the processor, operate as the following units: a calculation unit configured to calculate a checksum; a determination unit configured to determine whether the checksum received from the electronic device is consistent with a first checksum calculated by the calculation unit based on the data received from the electronic device; a control unit configured to calculate a second checksum based on a return value sent to the electronic device in response to data received from the electronic device using the calculation unit if the checksum received from the electronic device is consistent with the first checksum, and to notify the electronic device of a checksum error by changing an output level at the communication terminal used for the serial communication if the checksum received from the electronic device is inconsistent with the first checksum; as well as A sending unit is configured to send the second checksum to the electronic device when the checksum received from the electronic device is consistent with the first checksum.
5. An accessory for sending data to and receiving data from an electronic device via serial communication, the accessory comprising: at least one processor; as well as A memory coupled to the at least one processor, the memory having instructions that, when executed by the processor, operate as the following units: a calculation unit configured to calculate a checksum; a determination unit configured to determine whether the checksum received from the electronic device is consistent with a first checksum calculated by the calculation unit based on the data received from the electronic device; a control unit configured to calculate a second checksum based on a return value sent to the electronic device in response to data received from the electronic device using the calculation unit if the checksum received from the electronic device is consistent with the first checksum, and to notify the electronic device of a checksum error by resuming communication with the electronic device if the checksum received from the electronic device is inconsistent with the first checksum; as well as A sending unit is configured to send the second checksum to the electronic device when the checksum received from the electronic device is consistent with the first checksum.
6. An accessory for sending data to and receiving data from an electronic device via serial communication, the accessory comprising: at least one processor; as well as A memory coupled to the at least one processor, the memory having instructions that, when executed by the processor, operate as the following units: a calculation unit configured to calculate a checksum; a determination unit configured to determine whether the checksum received from the electronic device is consistent with a first checksum calculated by the calculation unit based on the data received from the electronic device; a control unit configured to calculate a second checksum based on a return value sent to the electronic device in response to data received from the electronic device using the calculation unit if the checksum received from the electronic device is consistent with the first checksum, and to notify the electronic device of a checksum error by resetting the accessory if the checksum received from the electronic device is inconsistent with the first checksum; as well as A sending unit is configured to send the second checksum to the electronic device when the checksum received from the electronic device is consistent with the first checksum.
7. An electronic device for sending data to and receiving data from an accessory via serial communication, the electronic device comprising: at least one processor; as well as A memory coupled to the at least one processor, the memory having instructions that, when executed by the processor, operate as the following units: a calculation unit configured to calculate a checksum of data sent to the accessory; a sending unit, configured to send the data and the checksum to the accessory; as well as a control unit configured to, in a case where a second checksum based on a return value sent from the accessory in response to the data sent to the accessory is received from the accessory after sending the checksum to the accessory during one communication of a predetermined number of bytes, not resend the data to the accessory, The control unit is configured to resend the data to the accessory during one communication of a predetermined number of bytes if a third checksum received from the accessory after sending the checksum to the accessory indicates a checksum error.
8. A communication system comprising: The accessory according to claim 1; as well as Electronic devices, The electronic device comprises: at least one processor; and A memory coupled to the at least one processor, the memory having instructions that, when executed by the processor, operate as the following units: a calculation unit configured to calculate a checksum of data sent to the accessory; a sending unit configured to send the data and the checksum to the accessory; and A control unit is configured to, if the second checksum is received from the accessory, not resend the data to the accessory, and to resend the data sent to the accessory if the third checksum is received from the accessory.
9. A communication system comprising: The accessory according to claim 4; as well as Electronic devices, The electronic device comprises: at least one processor; and A memory coupled to the at least one processor, the memory having instructions that, when executed by the processor, operate as the following units: a calculation unit configured to calculate a checksum of data sent to the accessory; a sending unit configured to send the data and the checksum to the accessory; and A control unit is configured to not resend the data to the accessory if the second checksum is received from the accessory, and to resend the data to be sent to the accessory if the checksum error is notified from the accessory.
10. A communication system comprising: The accessory according to claim 5; as well as Electronic devices, The electronic device comprises: at least one processor; and A memory coupled to the at least one processor, the memory having instructions that, when executed by the processor, operate as the following units: a calculation unit configured to calculate a checksum of data sent to the accessory; a sending unit configured to send the data and the checksum to the accessory; and A control unit is configured to not resend the data to the accessory if the second checksum is received from the accessory, and to resend the data to be sent to the accessory if the checksum error is notified from the accessory.
11. A communication system comprising: The accessory according to claim 6; as well as Electronic devices, The electronic device comprises: at least one processor; and A memory coupled to the at least one processor, the memory having instructions that, when executed by the processor, operate as the following units: a calculation unit configured to calculate a checksum of data sent to the accessory; a sending unit configured to send the data and the checksum to the accessory; and A control unit is configured to not resend the data to the accessory if the second checksum is received from the accessory, and to resend the data to be sent to the accessory if the checksum error is notified from the accessory.
12. A method for controlling an accessory, the accessory being used to send data to an electronic device and receive data from the electronic device through serial communication, the control method comprising: calculating a first checksum based on data received from the electronic device; determining whether a checksum received from the electronic device is consistent with the first checksum; calculating a second checksum based on a return value sent to the electronic device in response to data received from the electronic device if the checksum received from the electronic device is consistent with the first checksum, and calculating a third checksum if the checksum received from the electronic device is inconsistent with the first checksum; as well as The second checksum or the third checksum is sent to the electronic device according to the determination result.
13. A method for controlling an accessory, the accessory being used to send data to an electronic device and receive data from the electronic device through serial communication, the method comprising: calculating a first checksum based on data received from the electronic device; determining whether a checksum received from the electronic device is consistent with the first checksum; calculating a second checksum based on a return value sent to the electronic device in response to data received from the electronic device if the checksum received from the electronic device is consistent with the first checksum, and sending the second checksum to the electronic device; as well as In a case where the checksum received from the electronic device does not coincide with the first checksum, a checksum error is notified to the electronic device by changing an output level at the communication terminal used for the serial communication.
14. A method for controlling an accessory, the accessory being used to send data to an electronic device and receive data from the electronic device through serial communication, the method comprising: calculating a first checksum based on data received from the electronic device; determining whether a checksum received from the electronic device is consistent with the first checksum; calculating a second checksum based on a return value sent to the electronic device in response to data received from the electronic device if the checksum received from the electronic device is consistent with the first checksum, and sending the second checksum to the electronic device; as well as In a case where the checksum received from the electronic device does not coincide with the first checksum, a checksum error is notified to the electronic device by restarting communication with the electronic device.
15. A method for controlling an accessory, the accessory being used to send data to an electronic device and receive data from the electronic device through serial communication, the method comprising: calculating a first checksum based on data received from the electronic device; determining whether a checksum received from the electronic device is consistent with the first checksum; calculating a second checksum based on a return value sent to the electronic device in response to data received from the electronic device if the checksum received from the electronic device is consistent with the first checksum, and sending the second checksum to the electronic device; as well as In the event that the checksum received from the electronic device is inconsistent with the first checksum, the electronic device is notified of a checksum error by resetting the accessory.
16. A control method of an electronic device, the electronic device being used to send data to an accessory and receive data from the accessory through serial communication, the control method comprising: calculating a checksum of data sent to the accessory; sending the data and the checksum to the accessory; as well as In a case where, during a communication of a predetermined number of bytes, a second checksum based on a return value sent from the accessory in response to data sent to the accessory is received from the accessory after the checksum is sent to the accessory, the data is not resent to the accessory; and in a case where, during a communication of a predetermined number of bytes, a third checksum received from the accessory after the checksum is sent to the accessory indicates a checksum error, the data is resent to the accessory.
17. A non-transitory computer-readable storage medium for storing a program for causing a computer to execute a control method of an accessory, the accessory being used to send data to and receive data from an electronic device through serial communication, the control method comprising: calculating a first checksum based on data received from the electronic device; determining whether a checksum received from the electronic device is consistent with the first checksum; calculating a second checksum based on a return value sent to the electronic device in response to data received from the electronic device if the checksum received from the electronic device is consistent with the first checksum, and calculating a third checksum if the checksum received from the electronic device is inconsistent with the first checksum; as well as The second checksum or the third checksum is sent to the electronic device according to the determination result.
18. A non-transitory computer-readable storage medium for storing a program for causing a computer to execute a control method of an accessory, the accessory being used to send data to and receive data from an electronic device through serial communication, the control method comprising: calculating a first checksum based on data received from the electronic device; determining whether a checksum received from the electronic device is consistent with the first checksum; calculating a second checksum based on a return value sent to the electronic device in response to data received from the electronic device if the checksum received from the electronic device is consistent with the first checksum, and sending the second checksum to the electronic device; as well as In a case where the checksum received from the electronic device does not coincide with the first checksum, a checksum error is notified to the electronic device by changing an output level at the communication terminal used for the serial communication.
19. A non-transitory computer-readable storage medium for storing a program for causing a computer to execute a control method of an accessory, the accessory being used to send data to and receive data from an electronic device through serial communication, the control method comprising: calculating a first checksum based on data received from the electronic device; determining whether a checksum received from the electronic device is consistent with the first checksum; calculating a second checksum based on a return value sent to the electronic device in response to data received from the electronic device if the checksum received from the electronic device is consistent with the first checksum, and sending the second checksum to the electronic device; as well as In a case where the checksum received from the electronic device does not coincide with the first checksum, a checksum error is notified to the electronic device by restarting communication with the electronic device.
20. A non-transitory computer-readable storage medium for storing a program for causing a computer to execute a control method of an accessory, the accessory being used to send data to and receive data from an electronic device through serial communication, the control method comprising: calculating a first checksum based on data received from the electronic device; determining whether a checksum received from the electronic device is consistent with the first checksum; calculating a second checksum based on a return value sent to the electronic device in response to data received from the electronic device if the checksum received from the electronic device is consistent with the first checksum, and sending the second checksum to the electronic device; as well as In the event that the checksum received from the electronic device is inconsistent with the first checksum, the electronic device is notified of a checksum error by resetting the accessory.
21. A non-transitory computer-readable storage medium for storing a program for causing a computer to execute a control method of an electronic device, the electronic device being used to send data to and receive data from an accessory through serial communication, the control method comprising: calculating a checksum of data sent to the accessory; sending the data and the checksum to the accessory; as well as In a case where, during a communication of a predetermined number of bytes, a second checksum based on a return value sent from the accessory in response to data sent to the accessory is received from the accessory after the checksum is sent to the accessory, the data is not resent to the accessory; and in a case where, during a communication of a predetermined number of bytes, a third checksum received from the accessory after the checksum is sent to the accessory indicates a checksum error, the data is resent to the accessory.
Citation Information
Patent Citations
Check sum writing method for eeprom
JP1993158807A
Communication system
JP1996204709A
Game machine
JP2017093712A
Optical filter and spectrometer
JP2021073484A
Data check method and device and electronic equipment
CN105183579A