Accessories and Electronic Devices and Their Control Methods, Communication Systems, and Storage Media

By including a communication unit, a storage unit, a processor and a memory in the accessories, and determining whether to execute a command based on the flags in the storage unit, the problem of failure when the slave device performs predetermined processing through communication and insufficient memory capacity is solved.

CN115242963BActive Publication Date: 2025-06-13CANON KK
View PDF 4 Cites 0 Cited by

Patent Information

Application Number
CN202210430750.7
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-06-13
Estimated Expiration
2042-04-22

AI Technical Summary

Technical Problem

In the prior art, a slave device that does not include a CPU is prone to failure when a predetermined process is performed by communication of a host device, and even if a slave device that includes a CPU is insufficient, the memory capacity is insufficient.

Method used

An accessory is provided, including a communication unit, a storage unit, at least one processor and at least one memory, and whether to execute a command from a host device by checking a flag stored in the storage unit.

Benefits of technology

The problem of failure when the slave device excluding the CPU performs predetermined processing through communication is solved, and the amount of memory used is reduced in the case of including the CPU.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115242963B_ABST
    Figure CN115242963B_ABST
Patent Text Reader

Abstract

The present invention relates to an accessory and an electronic device, and a control method, a communication system, and a storage medium therefor. The accessory and the electronic device can suppress failures and malfunctions of the accessory when sending a command to be executed by the accessory from the electronic device, and can reduce the memory capacity. The accessory is communicably connected to the electronic device. The accessory includes: a communication unit that communicates with the electronic device; a storage unit that allows reading and writing and stores a flag indicating whether execution of a command by the accessory is permitted; and a control unit that, when receiving a predetermined command from the electronic device, does not execute the predetermined command when the flag indicates that execution of the command is not permitted, and executes the predetermined command when execution of the command is permitted.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to an accessory and a control method and storage medium therefor, an electronic device to which the accessory is communicably connected and a control method and storage medium therefor, and a communication system including the electronic device and the accessory. Background Art

[0002] As a method for serial communication between electronic devices, half-duplex (e.g., I2C (registered trademark) communication) and full-duplex (e.g., SPI (registered trademark) communication) have been conventionally adopted. 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 host device and the slave device, a method called checksum can be used as a method for determining whether received data is correct. In the case where the checksum in the slave device is inconsistent, the same communication can be performed again by notifying (slave request) the host device from the slave device other than through serial communication. When doing so, in the case where the slave device is equipped with a CPU, a checksum can be added to the end of the transmission, but in the case where the slave device is not equipped with a CPU, a checksum cannot be added.

[0004] As a technique for storing a checksum in a storage device such as an EEPROM, for example, Japanese Patent Laid-Open No. 5-158807 proposes a method of changing a write address according to the number of times of writing the checksum every time the checksum is updated. Further, as a method for detecting the occurrence of an error through communication, for example, Japanese Patent Laid-Open No. 2019-140565 proposes a method of sending a command from a diagnostic device to an imaging unit through communication and setting an error flag in the case where an error occurs as a result of an imaging operation of the imaging unit.

[0005] A slave device including a CPU can perform a predetermined process in response to a transmission from a host device. However, causing a slave device not including a CPU to perform a predetermined process through communication from a host device causes a failure of the slave device. Further, even in the case where the slave device includes a CPU, the slave device does not always have sufficient memory capacity, and thus it is necessary to minimize the amount of memory used. Summary of the Invention

[0006] In a first aspect of an embodiment, there is provided an accessory that can be communicatively connected to an electronic device. The accessory includes: a communication unit for communicating with the electronic device; a storage unit that allows reading and writing thereto and is used for storing a flag indicating whether to allow the accessory to execute a command; at least one processor; and at least one memory coupled to the at least one processor, the at least one memory being used for storing instructions that, when executed by the at least one processor, cause the accessory to operate. The operation includes: when a predetermined command is received from the electronic device, not executing the predetermined command when the flag indicates that execution of the command is not allowed, and executing the predetermined command when execution of the command is allowed.

[0007] In a second aspect of an embodiment, there is provided an electronic device that can be connected to an accessory. The electronic device includes: a communication unit for communicating with the accessory; a reading unit for reading the flag stored in the storage unit provided in the accessory; at least one processor; and at least one memory coupled to the at least one processor, the at least one memory being used for storing instructions that, when executed by the at least one processor, cause the electronic device to operate. The operation includes: when the flag indicates that the accessory is not allowed to execute a command, not sending a command to the accessory, and when the flag indicates that execution of the command is allowed, sending a command to the accessory.

[0008] In a third aspect of an embodiment, there is provided a communication system that includes: an electronic device; and an accessory that can be communicatively connected to the electronic device. Wherein, the accessory includes: a storage unit that allows reading and writing thereto and is used for storing a flag indicating whether to allow the accessory to execute a command; at least one processor; and at least one memory coupled to the at least one processor, the at least one memory being used for storing instructions that, when executed by the at least one processor, cause the accessory to operate. The operation includes: when a predetermined command is received from the electronic device, not executing the predetermined command when the flag indicates that execution of the command is not allowed, and executing the predetermined command when the flag indicates that execution of the command is allowed. And wherein, the electronic device includes: a reading unit for reading the flag; at least one processor; and at least one memory coupled to the at least one processor, the at least one memory having instructions that, when executed by the at least one processor, cause the electronic device to operate. The operation includes: when the flag indicates that the accessory is not allowed to execute a command, not sending a command to the accessory, and when the flag indicates that execution of the command is allowed, sending a command to the accessory.

[0009] In a fourth aspect of the embodiment, a control method for an accessory is provided. The accessory can be communicatively connected to an electronic device. The control method includes: establishing communication with the electronic device; when receiving a predetermined command from the electronic device, checking a flag stored in a storage unit equipped with the accessory, which indicates whether the accessory is allowed to execute the command; and not executing the predetermined command when the flag indicates that the command is not allowed to be executed, and executing the predetermined command when the flag indicates that the command is allowed to be executed.

[0010] In a fifth aspect of the embodiment, a control method for an electronic device is provided. The electronic device can be connected to an accessory. The control method includes: establishing communication with the accessory; reading a flag stored in a storage unit equipped with the accessory; and not sending a command to the accessory when the flag indicates that the accessory is not allowed to execute the command, and sending a command to the accessory when the flag indicates that the accessory is allowed to execute the command.

[0011] In a sixth aspect of the embodiment, a non-transitory computer-readable storage medium is provided for storing a program. The program is used to cause a computer to execute a control method for an accessory. The accessory can be communicatively connected to an electronic device. The control method includes: establishing communication with the electronic device; when receiving a predetermined command from the electronic device, checking a flag stored in a storage unit equipped with the accessory, which indicates whether the accessory is allowed to execute the command; and not executing the predetermined command when the flag indicates that the command is not allowed to be executed, and executing the predetermined command when the flag indicates that the command is allowed to be executed.

[0012] In a seventh aspect of the embodiment, a non-transitory computer-readable storage medium is provided for storing a program. The program is used to cause a computer to execute a control method for an electronic device. The electronic device can be connected to an accessory. The control method includes: establishing communication with the accessory; reading a flag stored in a storage unit equipped with the accessory; and not sending a command to the accessory when the flag indicates that the accessory is not allowed to execute the command, and sending a command to the accessory when the flag indicates that the accessory is allowed to execute the command.

[0013] More features of the present invention will become apparent from the following description of exemplary embodiments (with reference to the accompanying drawings). Description of the Drawings

[0014] Figure 1 is a block diagram showing the respective electrical structures of a camera and an accessory.

[0015] Figure 2A and Figure 2BIt is a diagram schematically showing waveforms of two types of SPI protocols of an SPI communication method.

[0016] Figure 3A and Figure 3B It is a flowchart of operations performed by a camera controller and an accessory controller according to a first communication protocol.

[0017] Figure 4A and Figure 4B It is a flowchart of operations performed by a camera controller and an accessory controller according to a second communication protocol.

[0018] Figure 5 It is a diagram showing an example of an operation execution command sent from a camera to an accessory.

[0019] Figure 6 It is a diagram showing an example of accessory information stored in an accessory.

[0020] Figure 7 It is a sequence diagram showing processes performed by an accessory and a camera.

[0021] Figure 8 It is a diagram showing an example of information indicating the type of an accessory.

[0022] Figure 9 It is a diagram for explaining the reason for notifying a communication request signal from an accessory to a camera.

[0023] Figure 10A and Figure 10B It is a diagram showing an example of a time interval of communication bytes in SPI communication.

[0024] Figure 11 It is a flowchart of processes performed by a camera after an accessory is installed.

[0025] Figure 12 It is a flowchart of processes performed by a camera for activating functions of an accessory.

[0026] Figure 13 It is a flowchart of processes performed by an accessory installed on a camera.

[0027] Figure 14 It is a diagram showing accessory information stored in an accessory according to a first embodiment.

[0028] Figure 15A and Figure 15B It is a flowchart of processes performed by an accessory according to a first embodiment for receiving and executing a command and a flowchart of processes performed by a camera for sending a command to the accessory.

[0029] Figure 16This is a diagram showing an example of the content of camera - accessory communication for read notification according to the second embodiment.

[0030] Figure 17 This is a diagram showing an example of the content of camera - accessory communication for write notification according to the second embodiment.

[0031] Figure 18 This is a diagram showing an example of the content of camera - accessory communication for command notification according to the second embodiment.

[0032] Figure 19 This is a diagram showing an example of a command executed through the second embodiment.

[0033] Figure 20A and Figure 20B This is a diagram showing an example of the waveform of I2C communication.

[0034] Figure 21 This is a diagram showing the processing performed by the camera controller when the camera controller sends NC - byte data to the accessory controller.

[0035] Figure 22 This is a diagram showing the processing performed by the camera controller when the camera controller receives ND - byte data from the accessory controller.

[0036] Figure 23 This is a diagram showing the processing performed by the accessory controller when the camera controller and the accessory controller send and receive NE - byte data. Detailed Description of the Invention

[0037] Hereinafter, the present invention will be described in detail with reference to the drawings showing embodiments of the present invention. Here, the imaging device is described as an electronic device according to the present invention. There is no particular limitation on the accessory communicably connected to the imaging device as long as the accessory can communicate with the imaging device. As accessories, a lighting device (such as a flash device), a display device (such as an electronic viewfinder), and an audio device (such as a microphone device) can be mentioned, etc.

[0038] The imaging device and the accessory form an imaging system (communication system), where the imaging device serves as the host device and the accessory serves as the slave device.

[0039] Figure 1This is a block diagram showing the respective electrical configurations of a camera device (hereinafter referred to as "camera") denoted by reference numeral 100 and an accessory 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 unit 127. In addition, the camera 100 includes a backlight unit 128, an accessory power supply unit A 131, an accessory power supply unit B 132, a protection unit 133, and a camera connection unit 141.

[0040] 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) that control the overall operation of the camera 100 and are each formed of a microcomputer including a CPU or the like. The camera controller A 101 monitors switches and the like that are components of an operation unit operated by the user, and performs operations even when the camera 100 is in a standby state, and performs power control and the like in response to the user's operation. The camera controller B 102 is responsible for controlling the image sensor 122, the display unit 127, etc., and stops its operation when the camera 100 is on standby. 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 elapses without any external operation on the camera 100, the camera 100 transitions 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 individual processors is described, but the two may be provided in a single processor.

[0041] The system power supply unit 112 includes a DC-DC converter circuit, a low dropout (LDO) circuit, a charge pump circuit, etc., and generates power to be supplied to the components of the camera 100. The 1.8V voltage generated by the system power supply unit 112 is always supplied to the camera controller A 101 as the 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 as the microcomputer power supply VMCU2_C at a desired timing. By controlling the system power supply unit 112, the camera controller A 101 performs on / off control of the power supply to the components of the camera 100.

[0042] An optical lens 121 (so-called interchangeable lens) is removably attached to a camera 100. Note that the optical lens 121 may be provided integrally with the camera 100 (non-removably attached to the camera 100). Light from a subject (incident light) incident through the optical lens 121 forms an image on an imaging surface (photographing surface) of an image sensor 122 formed of a CMOS sensor, a CCD sensor, or the like. Note that the optical lens 121 and the camera 100 may be integrally formed with each other. The image sensor 122 encodes a subject image (optical image) formed on the photographing surface into a digital photographing signal. An image processor 123 generates image data by performing noise reduction processing, white balance processing, etc. on the digital photographing signal, and converts the generated image data into an image file in a format such as JPEG format, so as to store the image data in a recording memory 126. In addition, the image processor 123 generates VRAM image data for display on a display unit 127 from the generated image data.

[0043] A memory controller 124 controls the transmission and reception of image data and other data generated by the image processor 123 and the like. A volatile memory 125 is a memory such as a DDR3 SDRAM that can be read and written at high speed, and is used as a work space 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 portion (not shown). The display unit 127 is a display disposed on the back surface of the camera 100, and is constituted by an LCD panel, an organic EL display panel, or the like. A backlight unit 128 adjusts the brightness of the display unit 127 by changing the backlight amount of the display unit 127.

[0044] An accessory power supply unit A 131 and an accessory power supply unit B 132 convert the voltage supplied from a system power supply unit 112 into a predetermined voltage, and in the present embodiment, generate 3.3V as an 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 consuming little power by itself. 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 power consumption of the accessory power supply unit B 132 by itself is greater than the power consumption of the accessory power supply unit A 131 by itself. Therefore, in the case of a small load current, the accessory power supply unit A 131 is more efficient than the accessory power supply unit B 132, and in the case of a large load current, the accessory power supply unit B 132 is more efficient than the accessory power supply unit A 131. A camera controller A 101 controls the on / off switching of the accessory power supply unit A 131 and the accessory power supply unit B 132 according to the operation state of the accessory 200.

[0045] The protection unit 133 is composed of a current fuse element, a PolySwitch (registered trademark) device, or an electronic fuse circuit formed by combining a resistor, an amplifier, and a switching element. When 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 thus excessive (abnormal), the protection unit 133 outputs an overcurrent detection signal DET_OVC. In the present embodiment, the protection unit 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 1 A flows. The overcurrent detection signal DET_OVC is a signal that indicates an overcurrent when the signal goes high. Note that the predetermined value (current value) is not limited to 1 A.

[0046] The camera 100 and the accessory 200 are electrically connected to each other by one-to-one contact between a plurality of contacts (terminals) TC01 to TC21 of the camera connection portion 141 of the camera 100 and a plurality of contacts (terminals) TA01 to TA21 of the accessory connection portion 211 of the accessory 200.

[0047] 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.

[0048] The contact TC01, which is the third ground contact of the camera connection portion 141, is connected to the ground terminal (GND), and not only serves as a contact for the reference potential, but also serves to control the wiring impedance of the differential signal D1N and the differential signal D1P. The contacts TC02 and TC03 are connected to the camera controller B 102, 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 contacts TC02, TC03, TC07 to TC17, TC19, and TC20 are communication contacts.

[0049] The contact TC04, which is the first ground contact, is connected to the ground terminal and serves as a contact for the reference potential of the camera 100 and the accessory 200. The accessory power supply VACC generated by the accessory power supply units A 131 and B 132 is connected to the contact TC05, which is a power supply contact, via the protection unit 133. The contact TC04 is arranged at a position outside the contact TC05 in the contact arrangement direction.

[0050] The accessory installation detection signal / ACC_DET is connected to the contact TC06 which serves as the installation detection contact. The accessory installation detection signal / ACC_DET is pulled up to the camera microcomputer power supply VMCU_C via a resistance element Rp134 (e.g., 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. When the level (potential) of the accessory installation detection signal / ACC_DET is at a high level (predetermined potential or higher), it is detected that the accessory is not installed, and when the level (potential) is at a low potential (GND potential), it is detected that the accessory 200 is installed.

[0051] The change in the signal level (potential) of the accessory installation detection signal / ACC_DET from a high level to a low level that occurs when the camera 100 is powered on is used as a trigger for various communications between the camera 100 and the accessory 200 via the contact.

[0052] Based on detecting that the accessory 200 is installed, the camera controller A 101 supplies power to the accessory 200 via the contact TC05 which serves as a power supply contact.

[0053] The SCLK signal, MOSI signal, MISO signal, and CS signal connected to the contacts TC07, TC08, TC09, and TC10 are signals used for SPI communication which is a type of serial communication performed by the camera controller B 102 which serves as a communication host. In the present embodiment, it is assumed that the SPI communication is performed at a communication clock frequency of 1 MHz, a data length of 8 bits (1 byte), a bit order with MSB first, and a full-duplex communication method.

[0054] 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 the SCLK signal, and this method is hereinafter referred to as "SPI protocol A".

[0055] Figure 2A is a diagram schematically showing the waveform of the communication of SPI protocol A. In Figure 2A , the CS signal is active low (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 which is after a predetermined time period T_CS has elapsed since timing A1, the camera controller B102 starts outputting the SCLK signal and the MOSI signal. Similarly, when the accessory controller 201 of the accessory 200 (details of which will be described hereinafter) detects the falling edge of the SCLK signal, the accessory controller 201 starts outputting the MISO signal.

[0056] The camera controller B 102 stops outputting the SCLK signal at timing A3 when the output of the SCLK signal for 1-byte data is completed. Then, the camera controller B 102 suppresses the output of the SCLK signal until a predetermined time period T_INTERVAL has elapsed since timing A3, and at timing A4 when the predetermined time period T_INTERVAL has elapsed, the camera controller B 102 resumes outputting the SCLK signal for the next byte of communication.

[0057] Figure 3A It is a flowchart for explaining the operations performed by the camera controller B 102 according to the SPI protocol A. In Figure 3A this, each processing operation (step) represented by the S number is implemented by the CPU of the camera controller B 102 loading a predetermined program stored in the ROM (not shown) of the camera controller B102 into its RAM (not shown).

[0058] In step S101, the camera controller B 102 stores the value representing the number of bytes used for communication as the variable NA. For example, in the case of 3-byte communication, the variable NA is set to the value 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 elapsed after the CS signal is changed to a low level. The camera controller B 102 waits ( "No" in step S103) until the predetermined time period T_CS has elapsed, and when the camera controller B 102 determines that the predetermined time period T_CS has elapsed ( "Yes" in step S103), the process proceeds to step S104.

[0059] In step S104, for the communication of 1-byte data, the camera controller B 102 controls the output of the MOSI signal data and the input of the MISO signal data while controlling the output 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). When the camera controller B 102 determines that the variable NA is equal to 0 (zero) ( "Yes" in step S106), the process proceeds to step S107, and when the camera controller B 102 determines that the variable NA is not equal to 0 ( "No" in step S106), the process proceeds to step S108.

[0060] In step S108, the camera controller B 102 determines whether a predetermined time period T_INTERVAL has elapsed after the communication of the 1-byte data in step S104. The camera controller B 102 waits ( "No" in step S108) until the predetermined time period T_INTERVAL has elapsed, and when 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.

[0061] Figure 3B is a flowchart for explaining the operations performed by the accessory controller 201 according to SPI protocol A. In Figure 3B each processing operation (step) represented 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).

[0062] In step S201, the accessory controller 201 determines whether the CS signal has changed to a low level. When the accessory controller 201 determines that the CS signal has not changed to a low level ( "No" in step S201), the accessory controller 201 repeats the determination in step S201, and when the accessory controller 201 determines that the CS signal has changed to a low level ( "Yes" in step S201), the process proceeds to step S202. In step S202, the accessory controller 201 controls the input of MOSI signal data and the output of MISO signal data according to the input of the SCLK signal, thereby performing the communication of 1-byte data. In step S203, the accessory controller 201 determines whether the CS signal has changed to a high level. When the accessory controller 201 determines that the CS signal has not changed to a high level ( "No" in step S203), the process 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 a high level ( "Yes" in step S203), the accessory controller 201 terminates this process, thereby terminating the SPI communication.

[0063] The second communication protocol among the two types of communication protocols of the SPI communication method is a method of checking whether the accessory 200 is in a communicable state before the camera 100 outputs the SCLK signal, and is hereinafter referred to as "SPI protocol B".

[0064] Figure 2BFIG. is a diagram schematically showing waveforms of communication of SPI protocol B. At timing B1, camera controller B 102 changes the CS signal to a low level, thereby requesting accessory controller 201 to perform SPI communication. In response to this request, camera controller 102 checks the potential of the MISO signal, and if the MISO signal is at a high level, determines that accessory controller 201 is in a state capable of communication, and if the MISO signal is at a low level, determines that accessory controller 201 is in a state incapable of communication. On the other hand, when accessory controller 201 detects a falling edge of the CS signal, if accessory controller 201 is in a state capable of SPI communication, accessory controller 201 controls the MISO signal to a high level (timing B2), and if accessory controller 201 is in a state incapable of SPI communication, accessory controller 201 controls the MISO signal to a low level.

[0065] When it is confirmed at timing B3 that the MISO signal is at a high level, camera controller B 102 starts outputting the SCLK signal and the MOSI signal. Similarly, when detecting a falling edge of the SCLK signal, accessory controller 201 starts outputting the MISO signal. When the SCLK signal for outputting 1-byte data is completed at timing B4, camera controller B 102 stops outputting the SCLK signal. After accessory controller 201 performs transmission and reception of 1-byte data, if accessory controller 201 is in a state capable of SPI communication, accessory controller 201 controls the MISO signal to a high level, and if accessory controller 201 is in a state incapable of SPI communication, accessory controller 201 controls the MISO signal to a low level (timings B5 and B6). Camera controller B102 checks the potential of the MISO signal at timing B7, and if the MISO signal is at a high level, camera controller B 102 determines that accessory controller 201 is in a state capable of communication, and if the MISO signal is at a low level, camera controller B 102 determines that accessory controller 201 is in a state incapable of communication.

[0066] Figure 4A is a flowchart for explaining operations performed by camera controller B 102 according to SPI protocol B. In Figure 4A , each processing operation (step) represented by an S number is implemented by loading a predetermined program stored in the ROM of camera controller B102 into its RAM by the CPU of camera controller B 102.

[0067] In step S111, the camera controller B 102 stores the value representing the number of bytes used for transmission as a variable NB. For example, when performing 3-byte communication, the variable NB is set to the value 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 (in step S113, it is "no") until the MISO signal becomes high, and when the camera controller B 102 determines that the MISO signal is at a high level (in step S113, it is "yes"), the process proceeds to step S114.

[0068] In step S114, for communicating 1-byte data, the camera controller B 102 controls the output of the SCLK signal, and also controls the output of the MOSI signal data and the input of the MISO signal data. 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.

[0069] 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 (in step S116, it is "yes"), the process proceeds to step S117, and if the camera controller B 102 determines that the communication of all data is not completed (in step S116, it is "no"), the process proceeds to step S118.

[0070] 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 (in step S118, it is "no") until the MISO signal becomes high, and when the camera controller B 102 determines that the MISO signal is at a high level (in step S118, it is "yes"), the process returns to step S114.

[0071] Figure 4B It is a flowchart for explaining the operations performed by the accessory controller 201 according to SPI control B. In Figure 4B each processing operation (step) represented by an S number is implemented by the CPU of the accessory controller 201 loading a predetermined program stored in the ROM of the accessory controller 201 into its RAM.

[0072] In step S211, the accessory controller 201 determines whether the CS signal changes to a low level. When 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 in step S211. When the accessory controller 201 determines that the CS signal changes to a low level ( "Yes" in step S211), the process proceeds to step S212. In step S212, the accessory controller 201 determines whether the accessory controller 201 is in a state capable of performing SPI communication. When the accessory controller 201 determines that the accessory controller 201 is in a state capable of performing SPI communication ( "Yes" in step S212), the process proceeds to step S213. When the accessory controller 201 determines that the accessory controller 201 is not in a state capable of performing SPI communication ( "No" in step S212), the process proceeds to step S214.

[0073] In step S213, the accessory controller 201 controls the MISO signal to a high level, and then the process proceeds to step S215. In step S214, the accessory controller 201 controls the MISO signal to a low level, and then the process returns to step S212.

[0074] In step 215, the accessory controller 201 performs 1-byte data communication by controlling the input of MOSI signal data and the output of 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. When 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, when the accessory controller 201 determines that the CS signal changes to a high level ( "Yes" in step S216), the accessory controller 201 terminates this process, and thus the SPI communication terminates.

[0075] Figure 5 It is a diagram showing an example of the details of communication for notifying an operation execution instruction (command) from the camera 100 to the accessory 200 through SPI communication. In the communication of the first byte, the camera controller B 102 transmits "CMD", which is information indicating the command number, as MOSI signal data. In response to this, the accessory controller 201 transmits the value "0xA5" as MISO signal data. In addition, when the accessory controller 201 cannot perform the communication process of the first byte, the accessory controller 201 transmits a value other than "0xA5" as MISO signal data.

[0076] In the communication of the second byte, the camera controller B 102 sends the argument "MOSI_DATA1" associated with the command number CMD. Similarly, in the communication of the third byte to the (N - 2)th byte, the camera controller B 102 sends the arguments "MOSI_DATA2" to "MOSI_DATA[N - 3]" associated with the command number CMD. In response to this, in the communication of the second byte, the accessory controller 201 sends the command number CMD received in the communication of the first byte as 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 third byte, the accessory controller 201 sends "MISO_DATA1" as the return value associated with the command number CMD. Similarly, in the communication of the fourth byte to the (N - 2)th byte, the accessory controller 201 sends "MISO_DATA2" to "MISO_DATA[N - 4]" as the return values associated with the command number CMD. Note that it is assumed that the arguments and return values are predetermined for each command number, and one or both of each argument and each return value can be omitted.

[0077] In the communication of the (N - 1)th byte, the camera controller B 102 sends "CheckSum_C" as the checksum data as MOSI signal data. CheckSum_C is calculated according to the data sent from the camera controller B 102 to the accessory controller 201 by Equation (1) described below. On the other hand, the accessory controller 201 sends "0x00" representing the address as MISO signal data.

[0078] In the communication of the Nth byte, the camera controller B 102 sends "0x00" as MOSI signal data. On the other hand, the accessory controller 201 sends "CheckSum_A" as the checksum data as MISO signal data.

[0079] CheckSum_A is calculated as the first CheckSum_A by Equation (2) described below, or as the second CheckSum_A by Equation (3) described below. More specifically, the accessory controller 201 calculates CheckSum_C_A based on the actually received data. Then, the accessory controller 201 determines whether the received CheckSum_C and CheckSum_C_A calculated based on the received data are consistent. When the accessory controller 201 determines that CheckSum_C and CheckSum_C_A are consistent, the accessory controller 201 calculates the first CheckSum_A by Equation (2) described below and sends the first CheckSum_A to the camera controller B 102. When the accessory controller 201 determines that CheckSum_C and CheckSum_C_A are inconsistent, the accessory controller 201 calculates the second CheckSum_A by Equation (3) described below and sends the second CheckSum_A to the camera controller B 102. Note that the second CheckSum_A is set to the one's complement of the first CheckSum_A.

[0080] CheckSum_C = EXOR(AND(SUM(CMD, MOSI_DATA1, …, MOSI_DATA[N - 3]), 0xFF), 0xFF) …(1)

[0081] CheckSum_A = EXOR(AND(SUM(0xA5, CMD, MISO_DATA1, …, MISO_DATA[N - 4]), 0xFF), 0xFF) …(2)

[0082] CheckSum_A = AND(SUM(0xA5, CMD, MISO_DATA1, …, MISO_DATA[N - 4]), 0xFF) …(3)

[0083] Refer again to Figure 1 , and continue to describe the electrical structure of the camera 100. The 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 A101 receives a communication request from the accessory 200 by detecting the falling edge of the communication request signal / WAKE.

[0084] 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 for I2C communication, which is a type of serial communication. The communication using the SDA signal and the SCL signal is an open-drain communication pulled up to the camera microcomputer power supply VMCU_C, and in this embodiment, the communication frequency is assumed to be 100 kbps.

[0085] In I2C communication, both data transmission from the camera 100 and data transmission from the accessory 200 are performed through the SDA signal. The I2C communication has a lower communication speed compared to SPI communication. In addition, since the SPI communication has a higher communication speed compared to I2C communication, the SPI communication is suitable for communicating information with a large amount of data. Therefore, in the communication between the camera 100 and the accessory 200 in this embodiment, the SPI communication is used to communicate information with a large amount of data, while 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 when it is determined based on the data communication that the SPI communication can be executed, or when the SPI communication is required, it can be controlled to perform the SPI communication later.

[0086] Figure 20A and Figure 20B are diagrams showing examples of the waveforms of I2C communication. Figure 20A shows an example of the waveform of the communication when the camera 100 sends N-byte data (DATA[1] to DATA[N]) to the accessory 200, while Figure 20B shows an example of the waveform of the communication when the camera 100 receives N-byte data (DATA[1] to DATA[N]) from the accessory 200.

[0087] In Figure 20A and Figure 20B , the upper waveforms are the waveforms of the SCL signal, and the lower waveforms are the waveforms of the SDA signal. Below the waveform of the SDA signal, the meanings of the respective related parts of the SDA signal and which of the camera controller A101 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 information representing a response. Therefore, in order to make the description easier to understand, the correspondence between the respective parts of the data and the number of bytes from the start of the communication is shown above the diagram of the waveform. The details of the communication content will be described with reference to Figures 21 to 23 , so the description with reference to Figure 20A and Figure 20B is omitted.

[0088] Refer to Figure 20A, in the communication of the first byte and the second byte, 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 third byte to the (N + 2)th byte, the camera controller A 101 sends N - byte data (DATA[ADDRESS] to DATA[ADDRESS + N]) to the accessory controller 201.

[0089] Reference Figure 20B , in the communication of the first byte and the second byte, 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 fourth byte to the (N + 3)th byte, the camera controller A 101 receives N - byte data (DATA[ADDRESS] to DATA[ADDRESS + N]) from the accessory controller 201.

[0090] Now, reference Figures 21 to 23 will be used to explain the process. Figure 21 is a diagram showing the process performed by the camera controller A 101 when the camera controller A 101 sends NC - byte data to the accessory controller 201. In Figure 21 , each processing operation (step) represented by the S number is implemented by the CPU of the camera controller A 101 loading the program stored in the ROM (not shown) of the camera controller A 101 into its RAM (not shown).

[0091] In step S3001, the camera controller A 101 stores the value representing the number of bytes used for transmission as the variable NC. For example, when 3 - byte data is to be sent, the variable NC is set to the value 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.

[0092] In step S3003, the camera controller A 101 sets the slave - address information representing the slave address of the accessory controller 201 in the most - significant 7 bits of the data to be sent. In this embodiment, the slave address of the accessory controller 201 is 1010000 in binary.

[0093] In step S3004, the camera controller A 101 sets the information representing the write (WRITE) communication in the least - significant 1 bit of the data to be sent. The least - significant 1 bit set to the value 0 means write communication.

[0094] In step S3005, the camera controller A 101 sends the data set to be transmitted in steps S3003 and S3004 (10100000 in the case of binary numbers, i.e., 0xA0 in the case of hexadecimal numbers) to the accessory controller 201.

[0095] After sending 1-byte 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 given a data reception notification (ACK) ("Yes" in step S3006), and the process 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 transmitted data ("No" in step S3006), and the process proceeds to step S3014.

[0096] In step S3007, the camera controller A 101 sets the storage address information (start address information) of the data to be sent to the accessory controller 201 as the data to be transmitted. In this embodiment, it is assumed that the size of the data of the start address information is 1 byte and its value is 0x00.

[0097] In step S3008, the camera controller A 101 sends the set 1-byte start address information (value 0x00) to the accessory controller 201. After sending the 1-byte data of the start address information, in step S3009, 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 given a data reception notification (ACK) ("Yes" in step S3009), and the process 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 transmitted data ("No" in step S3009), and the process proceeds to step S3014.

[0098] In step S3010, the camera controller A 101 sets the variable MC to the value 1. The variable MC is used to count the number of data items to be transmitted. In step S3011, the camera controller A 101 sends 1-byte data to the accessory controller 201 by outputting an SCL signal of 1 byte and changing the SDA signal to the desired level during the period when 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.

[0099] After sending 1-byte data, in step S3012, 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, camera controller A 101 determines that accessory controller 201 has performed a data reception notification (ACK) ("Yes" in step S3012), and the process proceeds to step S3013. On the other hand, when the signal level of the SDA signal is high, camera controller A 101 determines that accessory controller 201 has not normally received the transmitted data ("No" in step S3012), and the process proceeds to step S3014.

[0100] In step S3013, camera controller A 101 checks whether the value of variable MC is equal to the value of variable NC. When the value of variable MC is equal to the value of variable NC ("Yes" in step S3013), camera controller A 101 determines that the transmission of all data is completed, and the process proceeds to step S3014. On the other hand, when the value of variable MC is not equal to the value of variable NC ("No" in step S3013), camera controller A 101 determines that there is still data to be transmitted, and the process proceeds to step S3015.

[0101] In step S3015, camera controller A 101 adds 1 to variable MC, and then the process returns to step S3011. Whenever the process returns to step S3011 in this way, camera controller A 101 sequentially increments the address of the data to be transmitted and transmits 1-byte data associated with that address.

[0102] By repeating the transmission of 1-byte data in this way until it is determined in step S3013 that variable MC is equal to variable NC, camera controller A 101 transmits NC-byte data to accessory controller 201. In this embodiment, when variable NC is set to 3, 3-byte data can be transmitted.

[0103] In step S3014, camera controller A 101 changes the SDA signal to high level (stop condition) while the SCL signal is at high level. This notifies accessory controller 201 of the termination of communication.

[0104] Figure 22 This is the process performed by camera controller A 101 when camera controller A 101 receives ND-byte data from accessory controller 201. In Figure 22 each processing operation (step) represented by the S number is implemented by loading the program stored in the ROM of camera controller A 101 into its RAM by the CPU of camera controller A 101.

[0105] In step S3101, the camera controller A 101 sets the variable ND to a value representing the number of bytes of data to be received. For example, when 3-byte data is to be received, the variable ND is set to the value 3. In this embodiment, it is assumed that the variable ND is set to the value 3. In steps S3102 to S3106, the camera controller A 101 respectively performs the same processing operations as those performed in Figure 21 steps S3002 to S3006 of

[0106] 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 this 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 start address information (value 0x00) of the set 1-byte data to the accessory controller 201.

[0107] In step S3109, the camera controller A 101 outputs an SCL signal for 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 notified data reception (ACK) (yes in step S3109), and the process proceeds to step S3110. 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 data (no in step S3109), and the process proceeds to step S3122.

[0108] In step S3110, similar to step S3102, the camera controller A 101 changes the SDA signal to low during the period when the SCL signal is high, thereby notifying the start condition to the accessory controller 201. In step S3111, the camera controller A 101 sets the slave address information representing the slave address of the accessory controller 201 in the most significant 7 bits of the transmission data. In this embodiment, it is assumed that the slave address of the accessory controller 201 is 1010000 in binary.

[0109] In step S3112, the camera controller A 101 sets the information indicating read (READ) communication in the least significant 1 bit of the transmission data. The least significant 1 bit set to the value 1 means read communication.

[0110] In step S3113, the camera controller A 101 sends the data set to be transmitted in steps S3111 and S3112 (10100001 in binary, i.e., 0xA1 in hexadecimal) to the accessory controller 201.

[0111] After transmitting 1-byte 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 notified data reception (ACK) (yes in step S3114), and the process 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 transmitted data (no in step S3114), and the process proceeds to step S3122.

[0112] 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 an SCL signal of 1-byte data and reads the signal level of the SDA signal at each timing when the SCL signal changes from low level to high level. This enables reception of 1-byte data from the accessory controller 201. The received 1-byte data can be stored in the non-volatile memory 125 as data associated with the address 0x00 or used for predetermined processing.

[0113] In step S3117, the camera controller A 101 determines whether 1-byte data can be normally received. When the camera controller A 101 determines that the byte data can be normally received (yes in step S3117), the process proceeds to step S3118. On the other hand, when the camera controller A 101 determines that 1-byte data cannot be normally received (no in step S3117), the process proceeds to step S3119.

[0114] 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 process 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 process proceeds to step S3120.

[0115] In step S3120, the camera controller A 101 outputs an SCL signal of 1-byte data and then controls the SDA signal to a low level, thereby notifying the accessory controller 201 of data reception (ACK) to inform that data communication will continue. In step S3121, the camera controller A 101 adds 1 to the variable MD and then returns the process to step S3116. After returning to step S3116 in this way, 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.

[0116] By repeating the reception of 1-byte data in this way until it is determined in step S3118 that the value of the variable MD is equal to the value of the variable ND, the camera controller A 101 receives ND bytes of data from the accessory controller 201. When the variable ND is set to 3 as in this embodiment, 3 bytes of data can be received.

[0117] In step S3119, the camera controller A 101 outputs an 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.

[0118] Figure 23 It is a flowchart of the process performed by the accessory controller 201 when NE bytes of data are transmitted and received between the camera controller A 101 and the accessory controller 201. Note that this process includes the process for the accessory controller 201 to receive NE bytes of data from the camera controller A 101 and the process for the accessory controller 201 to transmit NE bytes of data to the camera controller A 101. In Figure 23 each processing operation (step) represented by the S number is implemented by the CPU of the accessory controller 201 loading a predetermined program stored in the ROM of the accessory controller 201 into its RAM.

[0119] In step S3201, the accessory controller 201 waits (it is "No" in S3201) until the SDA signal goes low while the SCL signal is at a high level (start condition is detected). When the accessory controller 201 detects the start condition (it is "Yes" in S3201), the process proceeds to step S3202.

[0120] In step S3202, the accessory controller 201 sets the variable ME to 0. The variable ME is used to count the number of transmitted data items or received data items. In step S3203, the accessory controller 201 receives 1-byte data sent from the camera controller A101.

[0121] In step S3204, the accessory controller 201 determines whether the most significant 7 bits of the 1-byte data received in step S3203 match the slave address of the accessory controller 201 (0x50 in this embodiment). When the accessory controller 201 determines that the data matches the slave address (Yes in step S3204), the process proceeds to step S3205. When the accessory controller 201 determines that the data does not match the slave address (No in step S3204), the process proceeds to step S3221.

[0122] In step S3205, the accessory controller 201 notifies the camera controller A101 of data reception (ACK) by controlling the SDA signal to be low in response to the next output of the SCL signal for one clock. In step S3206, the accessory controller 201 determines the type of the next 1-byte communication data based on the least significant 1 bit of the 1-byte data received in step S3203. When the least significant 1 bit of the data is 0, the accessory controller 201 determines that the next 1-byte communication data is the start address information to be written from the camera controller A101 to the accessory controller 201 (Yes in step S3206), and the process proceeds to step S3207. On the other hand, when the least significant 1 bit of the data is 1, the accessory controller 201 determines that the next 1-byte communication data is the data to be sent from the accessory controller 201 to the camera controller A101 (No in step S3206), and the process proceeds to step S3209.

[0123] In step S3207, the accessory controller 201 receives 1-byte data sent from the camera controller A101. The received 1-byte data is information related to the data address where the data to be transmitted and received through the following communication is stored. In this embodiment, as described in Figure 21 and Figure 22 it is assumed that the start address information is 0x00.

[0124] In step S3209, the accessory controller 201 sets the start address information to the address information pre-stored in the accessory controller 201 or the address information notified in advance from the camera controller A101.

[0125] In step S3208, the accessory controller 201 determines whether 1-byte data has been correctly received. When the accessory controller 201 determines that 1-byte data has been correctly received (Yes in step S3208), the process proceeds to step S3210. When the accessory controller 201 determines that 1-byte data has not been correctly received (No in step S3208), the process proceeds to step S3221.

[0126] In step S3210, the accessory controller 201 notifies the camera controller A 101 of data reception (ACK) by controlling the SDA signal to a low level in response to the next output of the SCL signal after receiving 1-byte data.

[0127] In step S3211, the accessory controller 201 determines whether the SDA signal goes low while the SCL signal is at a high level (whether a start condition is detected). When the accessory controller 201 detects a 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, which represents the slave address and the type of communication. On the other hand, when the accessory controller 201 does not detect a 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. When the accessory controller 201 determines that it has detected a start condition (Yes in step S3211), the process proceeds to step S3212. When the accessory controller 201 determines that it has not detected a start condition (No in step S3211), the process proceeds to step S3216.

[0128] In step S3212, the accessory controller 201 receives 1-byte data sent 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 match the slave address of the accessory controller 201 (0x50 in this embodiment). When the accessory controller 201 determines that the most significant 7 bits of the data match the slave address of the accessory controller 201 (Yes in step S3213), the process proceeds to step S3214. When the accessory controller 201 determines that the most significant 7 bits of the data do not match the slave address of the accessory controller 201 (No in step S3213), the process proceeds to step S3221.

[0129] In step S3214, the accessory controller 201 determines the type of data for the next one-byte communication based on the least significant bit of the one-byte data received in step S3212. If the least significant bit of the data is 1, the accessory controller 201 determines that the data for the next one-byte communication is the transmission data to be read from the accessory controller 201 to the camera controller A 101 ("Yes" in step S3214), and the process proceeds to step S3215. On the other hand, if the accessory controller 201 determines that the least significant bit of the data is 0 ("No" in step S3214), the process proceeds to step S3221.

[0130] In step S3215, the accessory controller 201 notifies the camera controller A 101 of data reception (ACK) by controlling the SDA signal to a low level in response to the next output of the SCL signal after receiving the one-byte data.

[0131] In step S3221, the accessory controller 201 notifies the camera controller A 101 of the completion of data communication (NACK) by controlling the SDA signal to a high level, and then the process proceeds to step S3225. In step S3222, the accessory controller 201 transmits one-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.

[0132] In step S3223, the accessory controller 201 increments the variable ME by 1. In the next step S3224, the accessory controller 201 checks the signal level of the SDA signal after transmitting the one-byte data. If the signal level of the SDA signal is high, the accessory controller 201 determines that this means the camera controller A 101 has notified the completion of receiving all data (NACK) ("Yes" in step S3224), and the process proceeds to step S3225. On the other hand, if 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 process returns to step S3222.

[0133] After the process returns to step S3222 in this way, the accessory controller 201 sequentially increments the address of the data to be transmitted and transmits one-byte data associated with the incremented address. Therefore, the accessory controller 201 repeats transmitting one-byte data until NACK is notified from the camera controller A 101 in step S3224, and the accessory controller 201 transmits NE bytes of data to the camera controller A 101.

[0134] In step S3225, the accessory controller 201 determines whether the SDA signal changes to a high level (stop condition) during the period when the SCL signal is at a high level. The accessory controller 201 repeats this determination (being "No" in step S3225) until a stop condition is detected, and when it is determined that a stop condition has been detected (being "Yes" in step S3225), this process is terminated.

[0135] Now, in step S3216 where the process enters when the answer to the question in step S3211 is negative ("No"), the accessory controller 201 receives 1-byte data. This 1-byte data is stored in a non-volatile 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 a predetermined process.

[0136] In step S3217, the accessory controller 201 adds 1 to the variable ME. In the next step S3218, the accessory controller 201 determines whether 1-byte data can be normally received. When the accessory controller 201 determines that 1-byte data can be normally received (being "Yes" in step S3218), the process enters step S3219, while when the controller 201 determines that 1-byte data cannot be normally received (being "No" in step S3218), the process enters step S3221.

[0137] In step S3219, the accessory controller 201 notifies the camera controller A 101 of data reception (ACK) by controlling the SDA signal to a low level in response to the next output of the SCL signal after receiving 1-byte data. In step S3220, the accessory controller 201 determines whether the SDA signal changes to a high level (stop condition) during the period when the SCL signal is at a high level. When the accessory controller 201 determines that a stop condition has been detected (being "Yes" in step S3220), this process is terminated. On the other hand, when a stop condition has not been detected (being "No" in step S3220), the accessory controller 201 determines that the data transmission from the camera controller A 101 to the accessory controller 201 is to continue, so the process returns to step S3216.

[0138] After the process returns to step S3216 in this way, 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 repeats receiving 1-byte data until a stop condition is notified in step S3220, whereby the accessory controller 201 receives NE bytes of data from the camera controller A 101.

[0139] The FNC1 signal, FNC2 signal, FNC3 signal, and FNC4 signal connected to contact TC14, contact TC15, contact TC16, and contact TC17 respectively are signals (function signals) whose functions can be changed according to the type of accessory 200. For example, when the accessory 200 is a microphone device, the function signal communicated via TC15 is an audio data signal. When the accessory 200 is a lighting device (flash device), the function signal communicated via TC14 is a signal notifying the light emission timing.

[0140] Note that according to the type of accessory installed on the camera 100, one of the signals that can communicate to achieve various different functions can be communicated via the same contact. For example, when the accessory 200 is different from the lighting device, a synchronization signal for controlling a timing other than the light emission timing can be communicated via TC14. Contacts TC14 to TC17 are called function signal contacts. The communication using at least one of the function signal contacts is called function signal communication.

[0141] Function signal communication can be performed in parallel with I2C communication or SPI communication without depending on the timing of I2C communication or SPI communication.

[0142] The types of accessories mentioned here are microphone devices and lighting devices, etc. Accessories that achieve functions with the same purpose are classified as accessories of the same type, such as in the case of lighting devices with different performances. Accessories that achieve functions with different purposes are classified as accessories of different types, such as in the case of a microphone device and a lighting device.

[0143] Function signal communication is performed based on the information obtained through I2C communication or SPI communication.

[0144] Contact TC18, which is the second ground contact, is connected to the ground terminal, and similar to contact TC04, which is the first ground contact, contact TC18 serves as the reference potential for the camera 100 and the accessory 200. Contact TC19, which is a differential signal contact, and contact TC20, which is a differential signal contact, are connected to the camera controller B 102. Differential signal D2N is connected to contact TC19 and differential signal D2P is connected to contact TC20. For example, USB communication can be performed via TC19 and TC20. Differential signal D2N and differential signal D2P are differential data communication signals that perform data communication as a pair.

[0145] Contact TC21, which is the fourth ground contact, is connected to the ground terminal and serves not only as a contact for the reference potential but also as a contact for controlling the wiring impedance of differential signals D2N and D2P.

[0146] The contacts TC01, TC04, TC06, TC18, and TC21 are connected to a ground portion of a flexible printed circuit board (not shown), such as that of the camera 100. The ground portion of the flexible printed circuit board is fixed to a metal member having a potential at the ground level of the camera 100 by means of a screw or the like. The metal member having a potential at the ground level is an engagement member provided in a fitting socket (not shown) of the camera 100 for engaging with the fitting 200, or a substrate (not shown) inside the camera 100.

[0147] In the present embodiment, the mounting detection contact TC06 to which the fitting mounting 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, noise (clock noise) caused by potential changes in the clock signal is transmitted to the contacts adjacent to the contact of the clock signal, which may cause malfunctions. 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 mounting detection contact TC06 is arranged adjacent to the contact TC07 for the SCLK signal, thereby reducing the influence of the clock noise.

[0148] The fitting mounting detection signal / ACC_DET is pulled up before the fitting is mounted, but is set to the ground level after the fitting is mounted. On the other hand, the contact TC07 for transmitting the SCLK signal as a clock signal does not transmit the clock signal before the fitting is mounted, so the potential does not change. Instead, only after the fitting is mounted, the contact TC07 transmits the clock signal, which causes a change in potential. When the contact TC07 for the SCLK signal transmits the clock signal, the mounting detection contact TC06 is at the ground potential. Therefore, even when the mounting detection contact TC06 receives clock noise, it is difficult for the potential of the control circuits of the camera 100 and the fitting 200 to change, so malfunctions can be prevented. In addition, it is possible to suppress the clock noise from being transmitted to a position farther than the mounting 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.

[0149] 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 more clock noise is generated from the SCLK signal contact TC07 than from the SCL signal contact TC13. For this reason, arranging the mounting detection contact TC06 adjacent to the SCLK signal contact TC07 is more effective in preventing malfunctions caused by clock noise than arranging the mounting detection contact TC06 adjacent to the SCL signal contact TC13.

[0150] In addition, the difference between the SCL signal and the SCLK signal is not only in frequency. The SCL signal transmitted 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 an open-drain connection. On the other hand, the SCLK signal transmitted 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 a CMOS output. For this reason, the change edge of the voltage of the SCL signal contact TC13 is often smoother than that of the SCLK signal contact TC07, making it difficult to generate clock noise. Therefore, arranging the mounting detection contact TC06 adjacent to the SCLK signal contact TC07 is more effective in preventing failures caused by clock noise than arranging the mounting detection contact TC06 adjacent to the SCL signal contact TC13.

[0151] In addition, there is a case where differential signals D1N and D1P are also sent as a pair to the first differential signal contact TC19 and the second differential signal contact TC20 to thereby transmit 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 is higher in frequency than the clock signals (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, they emit less clock noise than the SCLK signal contact TC07 and the SCL signal contact TC13 that transmit single-ended signals. For this reason, arranging the mounting detection signal TC06 adjacent to the SCLK signal contact TC07 is more effective in preventing failures caused by clock noise than arranging the mounting detection contact TC06 adjacent to the first differential signal contact TC19 and the second differential signal contact TC20.

[0152] Note that the contact (first data contact) TC08 arranged on the side of the SCLK signal contact TC07 opposite to the mounting detection contact TC06 transmits the MOSI signal (first data signal). Since the MOSI signal is a data signal, the MOSI signal seems to be vulnerable to clock noise. However, since the MOSI signal is a data signal based on the same SPI communication standard as the clock signal transmitted via the SCLK signal contact TC07, the timing of the potential change is synchronized with the clock signal, so 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.

[0153] Next, it will be described Figure 1The electrical structure of the accessory 200 shown in [Figure number]. The accessory 200 includes an accessory controller 201, an accessory power supply unit 202, a power switch 203, a charging unit 204, a battery 205, a functional unit 206, a differential communication unit 207, an external communication interface unit 208, an external connection terminal 209, and a connection detection unit 210. In addition, the accessory 200 includes an accessory connection unit 211 and an operation switch 212.

[0154] 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 unit 141 and the accessory connection unit 211.

[0155] The accessory power supply unit 202 includes a DC-DC converter circuit, an LDO circuit, a charge pump circuit, etc., and generates power to be supplied to the components of the accessory 200. The voltage of 1.8V, i.e., the accessory microcomputer power supply VMCU_A generated by the accessory power supply unit 201, is always supplied to the accessory controller 201. Note that the voltage generated by the accessory power supply unit 202 can be configured to be different from 1.8V. The accessory controller 201 controls the accessory power supply unit 202 to thereby perform on / off control of the power supply to the components of the accessory 200.

[0156] The charging unit 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 has been supplied from the camera 100, the accessory controller 201 controls the charging unit 204 to charge the battery 205. Note that in this embodiment, an example of the structure of the accessory 200 in which the battery 205 can be installed is described, but the accessory 200 can be configured to operate using only the power supplied from the camera 100 without installing the battery 205, and in this case, the charging unit 204 can be omitted.

[0157] The differential communication unit 207 is a circuit for performing differential communication with the camera 100 and is capable of sending data to the camera 100 and receiving data from the camera 100. The external communication interface unit 208 is an interface circuit for performing data communication with an external device (not shown) and is, for example, an Ethernet communication interface, a wireless LAN communication interface, or a public network communication interface. The accessory controller 201 controls the differential communication unit 207 and the external communication interface unit 208, whereby data received from the camera 100 can be sent to the external device, and conversely, data received from the external device can be sent to the camera 100.

[0158] The functional unit 206 has different functions according to the type of the accessory 200. For example, when the accessory 200 is a flash device, the functional unit 206 includes a light-emitting circuit and a charging circuit. When the accessory 200 is a microphone device, the functional unit 206 includes an audio codec circuit and a microphone circuit.

[0159] The external connection terminal 209 is for connecting to an external device, and in this embodiment, it is a USB type-C connector. The connection detection unit 210 is for detecting that an external device is connected to the external connection terminal 209. The accessory controller 201 receives the output signal from the connection detection unit 210, thereby detecting that an external device is connected to the external connection terminal 209.

[0160] The power switch 203 is for turning on / off the main power supply of the accessory 200. The accessory controller 201 can detect whether the power switch 203 is in the on position or the off position by reading the signal level of the terminal connected to the power switch 203. The operation switch 212 is for operating 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 operation switch 212 and performs a predetermined process according to the detection result.

[0161] The accessory connection unit 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 a row in this order from one end to the other end.

[0162] The contact TA01, which is the third ground contact of the accessory connection unit 211, is connected to the ground terminal and is used not only as a contact for the reference potential but also as a contact for controlling the wiring impedance of the differential signals D1N and D1P. The contacts TA02 and TA03 are connected to the differential communication unit 207. The differential signal D1N is connected to the contact TA02 and the differential signal D1P is connected to the contact TA03. The differential signals D1N and D1P are differential data communication signals for performing data communication as a pair. The contacts TA02 and TA03, the contacts TA07 to TA17, TA19 and TA20 are communication contacts.

[0163] The contact TA04, which is the first ground contact, is connected to the ground terminal and is used as a contact for the reference potential of the camera 100 and the accessory 200. The contact TA05, which is the power contact, is connected to the accessory power supply unit 202 and the charging unit 204 and is connected to the accessory power VACC supplied from the camera 100. The contact TA04 is arranged at a position outside the contact TA05 in the contact arrangement direction.

[0164] When the accessory 200 is connected to the camera 100, the contact TA06, which is an installation detection contact, is directly connected to the ground terminal to set the accessory installation detection signal / ACC_DET to the ground level (ground potential) which is a low level. This enables the camera 100 to detect that the accessory 200 is installed 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.

[0165] The communication request signal / WAKE for requesting communication with the camera 100 is connected to the contact TA11. When the accessory controller 201 determines that communication with the camera 100 (camera controller A 101) is required, the accessory controller 201 outputs the communication request signal / WAKE at a low level, thereby requesting the camera 100 to communicate.

[0166] According to the detected installation 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 the power supply by changing the signal level (potential) of the communication request signal / WAKE from a high level to a low level.

[0167] The accessory controller 201 can notify the occurrence of a reason 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 the need for the camera 100 to request communication. With this configuration, the camera controller A101 can omit the operation of periodically checking by polling whether a reason that makes it necessary for the accessory 200 to communicate with the camera 100 has occurred. In addition, when a reason that makes communication necessary occurs, the accessory 200 can notify the camera 100 of this fact in real time.

[0168] 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.

[0169] The FNC1 signal, FNC2 signal, FNC3 signal, and FNC4 signal respectively connected to the contacts TA14, TA15, TA16, and TA17 are signals (function signals) whose functions can be changed according to the type of the accessory 200. For example, when the accessory 200 is a microphone device, the corresponding function signal among these function signals is an audio data signal, and when the accessory 200 is a lighting device (flash device), the corresponding function signal among these function signals is a signal for notifying the light emission timing.

[0170] The contact TA18, which serves as the second ground contact, is connected to the ground terminal. Similar to the contact TA04 which serves as the first ground contact, the potential of the contact TA18 is used as the reference potential for the camera 100 and the accessory 200. The contacts TA19 and 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 in a pair. The contact TA21, which serves as the fourth ground contact, is connected to the ground terminal.

[0171] The contacts TA01, TA04, TA06, TA18, and TA21 are connected to a ground portion of a flexible printed circuit board (not shown) of the accessory 200, for example. The ground portion of the flexible printed circuit board is fixed to a metal member having a potential at the ground level of the accessory 200 by a screw (not shown) or the like. The metal member having a potential at the ground level is a socket mounting leg for engaging with the accessory socket of the camera 100, or a substrate (not shown) inside the accessory 200.

[0172] Next, reference will be made to Figure 7 to describe the outline of the process performed when the accessory 200 is mounted on the camera 100. Figure 7 is a sequence diagram showing an example of the processing operations performed when the accessory 200 is mounted on the camera 100.

[0173] 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 it is determined that the accessory 200 is mounted, the camera controller A 101 sets the power control signal CNT_VACC1 to the high level in order to turn on the output of the accessory power supply unit A 131. The accessory power supply unit A 131 changes to the high level according to the power control signal CNT_VACC1 and outputs the accessory power VACC to the accessory 200.

[0174] In the accessory 200, when the accessory power VACC is received, the accessory power supply unit 202 generates the power VMCU_A for operating the accessory controller 201, and the accessory controller 201 starts by receiving the power VMCU_A. After starting, the accessory controller 201 initializes the components of the accessory 200. After that, when the accessory 200 becomes capable of communicating with the camera 100, the accessory controller 201 sets the communication request signal / WAKE (contact TA11) to the low level.

[0175] In the camera 100, when the camera controller A 101 detects a low level of the communication request signal / WAKE (TC11), the camera controller A 101 determines that communication with the accessory 200 has been established. Then, the camera controller A 101 requests the accessory 200 (accessory controller 201) to send accessory information through I2C communication.

[0176] Figure 6 FIG. is a diagram showing an example of accessory information stored in a non-volatile memory (not shown) of the accessory controller 201 of the accessory 200. The accessory information is used for the camera 100 to identify the type of the accessory 200 and the specifications related to communication and operation (functions) with the accessory 200. The accessory information is mapped to a memory space with addresses from 0x00 to 0x0F (hereinafter referred to as, for example, "address 0x0F"). The camera controller B 102 can read 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 this embodiment, a checksum of the read data is added as the last data of the I2C communication. Details of the accessory information will be described below.

[0177] In the accessory 200, in response to a request for accessory information from the camera 100, the accessory controller 201 sends the accessory information stored in itself to the camera controller A 101. After sending 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.

[0178] After various settings of the camera 100 are completed, the camera controller A 101 notifies the camera controller B 102 of the accessory information. Based on the accessory information, the camera controller B 102 notifies the control command to the accessory 200 and controls the function signal through SPI communication. The accessory controller 201 performs control in response to the function signal and control command from the camera 100 through SPI communication.

[0179] Next, the accessory information stored in the accessory 200 will be described (see Figure 6 ). The data D7 to D0 at address 0x00 represent information indicating the type of the accessory (hereinafter referred to as "accessory type information"). Figure 8An example of accessory type information is shown. For example, the number 0x81 indicates that the accessory is a flash device, and the number 0x82 indicates that the accessory is an interface conversion adapter device. In addition, the number 0x83 indicates that the accessory is a microphone device, and the number 0x84 indicates that the accessory is a multi-accessory connection adapter device for mounting multiple accessory devices on the camera 100.

[0180] 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 the interface to make the camera 100 and the accessory compatible with each other when the interfaces of the camera 100 and the accessory are different. The multi-accessory connection adapter is an adapter device capable of mounting multiple accessories.

[0181] The data D7 to D0 at the address 0x01 represent information indicating the model (identification number) of the accessory 200. The accessory 200 can be uniquely identified by this information and the accessory type information. The data D7 to D0 at the address 0x02 represent information indicating the version of the firmware of the accessory 200. Note that "ACC" in the lines of the addresses 0x01 and 0x02 is used here as an abbreviation for "accessory".

[0182] The data D7 and D6 at the address 0x03 represent information indicating whether to request the supply of the accessory power VACC to the accessory 200 when the camera 100 is in the power-off state. As the value of this information, the value 0 is used when power supply is not required, the value 1 is used when power supply using the accessory power unit A 131 is to be requested, and the value 2 is used when power supply using the accessory power unit B 132 is to be requested.

[0183] The data D5 to D4 at the address 0x03 indicate whether to request the 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, the value 0 is used when power supply is not required, the value 1 is used when power supply using the accessory power unit A 131 is to be requested, and the value 2 is used when power supply using the accessory power unit B 132 is to be requested.

[0184] The data D3 to D2 at address 0x03 represent information indicating whether the accessory 200 includes the battery 205. As the value of this information, the value 0 is used when the accessory 200 does not include the battery 205, and the value 1 is used when the accessory 200 includes the battery 205. The data D1 to D0 at address 0x03 represent information indicating whether the accessory 200 is equipped with a function to charge the battery 205. As the value of this information, the value 0 is used when the accessory 200 is not equipped with a function to charge the battery 205, and the value 1 is used when the accessory 200 is equipped with a function to charge the battery 205.

[0185] The data D7 to D0 at address 0x04 represent information indicating the requested power VACC of the accessory power supply to be supplied from the camera 100 to the accessory 200. For example, it is assumed that this information represents a value of current, which is 10 times the value of this information. For example, when the value of this information is "10", this represents a current of 100 mA, and when the value of this information is "100", this represents a current of 1 A.

[0186] In order to reduce the amount of information, the information can be associated with a predetermined current value. For example, when requesting a current of 100 mA, 300 mA, 450 mA, and 600 mA, the values 0, 1, 3, and 4 can be used as the respective values of the information.

[0187] The data D7 at address 0x05 represent information indicating whether the accessory 200 is in the firmware update mode. As the value of this information, the value 0 is used when the accessory 200 is not in the firmware update mode, and the value 1 is used when the accessory 200 is in the firmware update mode. The data D6 at address 0x05 represent information indicating whether the accessory 200 is equipped with a firmware update function. As the value of this information, the value 0 is used when the accessory is not equipped with a firmware update function, and the value 1 is used when the accessory is equipped with a firmware update function.

[0188] The data D5 to D4 at address 0x05 represent information indicating whether the accessory 200 is permitted to operate when the accessory 200 is installed on the camera 100 via an intermediate connection accessory. As the value of this information, the value 0 is used when the operation is not permitted, and the value 1 is used when the operation is permitted. The data D3 to D2 at address 0x05 represent information indicating whether the accessory 200 needs to check the installation status of the intermediate connection accessory when the camera 100 is started. As the value of this information, the value 0 is used when the installation status does not need to be checked, and the value 1 is used when the installation status needs to be checked. The data D1 to D0 at address 0x05 represent information indicating whether the accessory 200 is compatible with command notifications via I2C communication. As the value of this information, the value 0 is used when the accessory 200 is not compatible with the command notification, and the value 1 is used when the accessory 200 is compatible with the command notification.

[0189] The data D5 to D4 at address 0x06 represent information indicating the following communication method, which can notify the reason for the communication request to the camera 100 after the accessory 200 notifies the communication request signal / WAKE to the camera 100. As the value of this information, the value 0 is used when I2C communication can perform the notification, the value 1 is used when SPI communication can perform the notification, and the value 2 is used when both I2C communication and SPI communication can perform the notification.

[0190] The data D3, data D2, data D1, and data D0 at address 0x06 represent information indicating whether the accessory 200 is equipped with a communication function that uses the FNC1 signal, FNC2 signal, FNC3 signal, and FNC4 signal, which are function signals respectively. The data D0, D1, D2, and D3 correspond to the FNC1 signal, FNC2 signal, FNC3 signal, and FNC4 signal respectively, and as the value of this information, the value 0 is used when the associated communication function is not equipped, and the value 1 is used when the associated communication function is equipped.

[0191] The data D7 at address 0x0A represents information indicating whether the camera 100 is requested to start when the accessory 200 notifies the communication request signal / WAKE to the camera 100. As the value of this information, the value 0 is used when the camera 100 is requested to start, and the value 1 is used when the camera 100 is not requested to start.

[0192] The data D6 to D0 at address 0x0A represent information indicating the reason for the communication request signal / WAKE notified by the accessory 200 to the camera 100. Figure 9 It is a diagram showing an example of the reason for the notification of the communication request signal / WAKE. This occurs when the accessory 200 is a microphone deviceFigure 9 The reason for the notification of the communication request signal / WAKE shown. In Figure 9 , the reason number 0x00 indicates that the menu call switch of the operation switch 212 has been pressed. In addition, the reason number 0x01 indicates that the accessory 200 has completed the output control of the audio signal, and the reason number 0x02 indicates that the accessory 200 has terminated the muting of the audio signal. Therefore, the accessory 200 can notify the camera 100 of information related to the reason for the communication request signal / WAKE.

[0193] Figure 6 The data D1 at the address 0x0C in represents information indicating the SPI communication protocol compatible with the accessory 200. As the value of this information, when the accessory 200 is compatible with the SPI protocol A, the value 0 is used, and when the accessory 200 is compatible with the SPI protocol B, the value 1 is used. The data D0 at the address 0x0C represents information indicating the control logic of the CS signal for the SPI communication compatible with the accessory 200. As the value of this information, when the CS signal is active low, the value 0 is used, and when the CS signal is active high, the value 1 is used.

[0194] The data D7 to D0 at the address 0x0D represent information indicating the time period required as the interval between communication bytes when the accessory 200 communicates using the SPI protocol A and furthermore the accessory 200 is not in the firmware update mode (the data D7 at the address 0x05 is 0). Figure 10A Examples of the time periods required as the interval between communication bytes, each represented by the data at the address 0x0D, are shown. In addition, the data D7 to D0 at the address 0x0E represent information indicating the time period required as the interval between communication bytes when the accessory 200 communicates using the SPI protocol A and furthermore the accessory 200 is in the firmware update mode (the data D7 at the address 0x05 is 1). Figure 10B Examples of the time periods required as the interval between communication bytes, each represented by the data at the address 0x0E, are shown.

[0195] Figure 11 is a flowchart of the processing performed by the camera controller A 101 from when the accessory 200 is installed on the camera 100 until the activation of the functions of the accessory 200. In Figure 11 , each processing operation (step) represented by the S number is implemented by the CPU of the camera controller A 101 loading the program stored in the ROM of the camera controller A 101 into its RAM.

[0196] 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. When 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 when 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. When it is determined that the accessory installation detection signal / ACC_DET is at a high level ( "No" in step S401), the determination in step S401 is repeated, and when it is determined that the accessory installation detection signal / ACC_DET is at a low level ( "Yes" in step S401), the process proceeds to step S402.

[0197] 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.

[0198] 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, when the overcurrent detection signal DET_OVC is at a low level, the camera controller A 101 determines that no overcurrent is flowing, and when the overcurrent detection signal DET_OVC is at a high level, the camera controller A 101 determines that an overcurrent is flowing. When it is determined that the overcurrent detection signal DET_OVC is at a low level ( "Yes" in step S403), the process proceeds to step S404, and when the camera controller A 101 determines that the overcurrent detection signal DET_OVC is at a high level ( "No" in step S403), this process is terminated and error processing is performed.

[0199] In step S404, the camera controller A 101 monitors the signal level of the communication request signal / WAKE sent 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 (i.e., "No" in step S404), the camera controller A 101 repeats the determination in step S404, and when it is determined that the communication request signal / WAKE is at a low level (i.e., "Yes" in step S404), the process proceeds to step S405.

[0200] 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 installed 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. When it is determined that the installed accessory is not a camera-compatible accessory (i.e., "No" in step S406), this process is terminated and error processing is performed. When it is determined that the installed accessory is a camera-compatible accessory (i.e., "Yes" in step S406), the process proceeds to step S407.

[0201] In step S407, the camera controller A 101 controls the power control signal CNT_VACC2 to a high level to turn on the output of the accessory power supply unit B 132. When the power control signal CNT_VACC2 goes high, the accessory power supply unit B 132 outputs the accessory power VACC. Note that in this embodiment, it is assumed that the accessory power VACC is output by the accessory power supply unit B 132 when both the power control signal CNT_VACC1 and the power control signal CNT_VACC2 are controlled to a high level. 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 this process.

[0202] Figure 12 It is a flowchart of the process performed by the camera controller B 102 from after the accessory 200 is installed on the camera 100 until the function of the accessory 200 is activated. In Figure 12 each processing operation (step) represented by the S number is implemented by loading the program stored in the ROM of the camera controller B 102 into its RAM by the CPU (not shown) of the camera controller B 102.

[0203] In step S501, the camera controller B 102 determines whether accessory information has been notified from the camera controller A 101. When it is determined that accessory information has not been notified (No in step S501), the determination in step S501 is repeated, and when it is determined that accessory information has been notified (Yes in step S501), the process proceeds to step S502.

[0204] 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, when 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, when it is notified that the accessory 200 is a flash device, the function signal FNC4 is set to the flash emission synchronization signal XOUT. Note that for the function signals that do not require control of the accessory 200, predetermined settings are set to prevent the operations of the camera 100 and the accessory 200 from being obstructed.

[0205] In step S503, the camera controller B 102 sets the control logic settings of the CS signal for 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 for the accessory 200 has occurred. When it is determined that the predetermined event has not occurred (No in step S504), the camera controller B 102 repeats the determination in step S504, and when it is determined that the predetermined event has occurred (Yes in step S504), the process proceeds to step S505.

[0206] In step S505, the camera controller B 102 determines whether the event detected in step S504 is an event that requires SPI communication with the accessory 200. When it is determined that the detected event is an event that requires SPI communication (Yes in step S505), the process proceeds to step S506, and when it is determined that the detected event is not an event that requires SPI communication (No in step S505), the process proceeds to step S507.

[0207] In step S506, the camera controller B 102 performs SPI communication with the accessory 200. For example, in the case where the accessory 200 is a microphone device, the SPI communication may include communication for instructing, for example, turning on / off the operation of switching the microphone device, switching the sound collection directivity of the microphone device, and switching the equalizer function of the microphone device. In addition, in the case where the accessory 200 is a flash device, the SPI communication may include, for example, communication for reading the setting information of the flash device and communication for notifying the flash device of the setting information. After step S506, the process returns to step S504.

[0208] In step S507, the camera controller B 102 determines whether the event detected in step S504 is an event that requires control using a function signal to communicate with the accessory 200. If it is determined that the detected event is an event that requires control using a function signal (Yes in step S507), the process proceeds to step S508, and if it is determined that the detected event is an event that does not require control using a function signal (No in step S507), the process proceeds to step S509.

[0209] In step S508, the camera controller B 102 controls the accessory 200 using a function signal. In the case where the accessory 200 is a microphone device, the control performed in step S508 may include controlling to receive the audio data signal SDATA as the function signal FNC3 in synchronization with the start of the 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 enables the camera 100 to obtain audio data from the accessory 200. In addition, in the case where the accessory 200 is a flash device, the control performed in step S508 may include controlling the flash emission synchronization signal XOUT as the function signal FNC4 at a desired timing. This enables the camera 100 to notify the flash device of the emission instruction. After step S508, the process returns to step S504.

[0210] In step S509, camera controller B 102 performs predetermined internal camera controls based on the event detected in step S504. As internal camera controls in the case where accessory 200 is a microphone device, mention may be made of control of start / stop of recording audio data in recording memory 126, control of equalizer processing of audio data, and the like. Further, as internal camera controls in the case where accessory 200 is a flash device, mention may be made of control of photometry using image sensor 122 by causing the flash device to emit light, control of calculating an indication value of the emission amount using the flash device, and the like. After step S509, the process returns to step S504.

[0211] By performing Figure 11 and 12 the processes shown, camera 100 is able to control accessory 200 mounted on camera 100. Note that the details of the processes using camera controller B 102 are as described above, but Figure 12 the processes do not include a termination step. For example, in the case where an operation for stopping the use of accessory 200 or an operation for disconnecting the power supply of camera 100 or accessory 200 is performed on camera 100 during repeated execution of the determination in step S504, the Figure 12 processes are terminated.

[0212] Figure 13 is a flowchart of the processes performed by accessory controller 201 from after accessory 200 is mounted on camera 100 until the functional operation of accessory 200. In Figure 13 each processing operation (step) indicated by an S number is implemented by the CPU of accessory controller 201 loading a program stored in the ROM of accessory controller 201 into its RAM.

[0213] In step S601, accessory controller 201 determines whether the supply of accessory power VACC from camera 100 has started (whether accessory power VACC is turned on). Here, in the case where accessory 200 is not equipped with battery 205, accessory controller 201 determines that accessory power VACC is turned on based on the fact that power is supplied to accessory controller 201 and accessory controller 201 itself starts operating. In the case where accessory 200 is equipped with battery 205, accessory controller 201 can detect the start of the supply of accessory power VACC by monitoring the voltage value of accessory power VACC. In the case where it is determined that accessory power VACC is not turned on (No in step S601), accessory controller 201 repeats the determination in step S601, and in the case where it is determined that accessory power VACC is turned on (Yes in step S601), the process proceeds to step S602.

[0214] In step S602, the accessory controller 201 is initialized. For example, the accessory controller 201 sets the setting of its own operating frequency range, 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. Thereby, the accessory controller 201 notifies the camera 100 of the completion of the initialization of the accessory 200. In step S604, the accessory controller 201 responds to the I2C communication from the camera 100 to send 15-byte accessory information. This accessory information includes Figure 6 the various information shown. In step S605, the accessory controller 201 controls the communication request signal / WAKE to a high level.

[0215] In step S606, the accessory controller 201 determines whether a predetermined event has occurred. When it is determined that no predetermined event has occurred (No in step S606), the accessory controller 201 repeats the determination in step S606, and when it is determined that a predetermined event has occurred (Yes in step S606), the process proceeds to step S607.

[0216] In step S607, the accessory controller 201 determines whether the occurred event is an event that requires SPI communication with the camera 100. When it is determined that the occurred event is an event that requires SPI communication with the camera 100 (Yes in step S607), the process proceeds to step S608, and if it is determined that the occurred event is not an event that requires SPI communication with the camera 100 (No in step S607), the process proceeds to step S609.

[0217] In step S608, the accessory controller 201 performs SPI communication with the camera 100. When 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 when the accessory 200 is a microphone device, mention may be made of communication for indicating, for example, the on / off of switching 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 when the accessory 200 is a flash device, mention may be made of communication for reading the 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.

[0218] In step S609, the accessory controller 201 determines whether the event that has occurred is an event that requires I2C communication with the camera 100. When it is determined that the event that has occurred is an event that requires I2C communication with the camera 100 (Yes in step S609), the process proceeds to step S610. When it is determined that the event that has occurred is not an event that requires I2C communication with the camera 100 (No in step S609), the process proceeds to step S611.

[0219] In step S610, the accessory controller 201 performs I2C communication with the camera 100. When the communication request signal / WAKE is at a low level during the execution of SPI communication, 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 reason for the communication request based on 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.

[0220] In step S611, the accessory controller 201 determines whether the event that has occurred is an event that is controlled using a function signal. When it is determined that the event that has occurred is an event that is controlled using a function signal (Yes in step S611), the process proceeds to step S612. When it is determined that the event that has occurred is not an event that is controlled using a function signal (No in step S611), the process proceeds to step S613.

[0221] In step S612, the accessory controller 201 controls the camera 100 using a function signal. As the control performed when 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 controls the output of 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. In addition, as the control performed in step S612 when the accessory 200 is a flash device, flash emission control performed in response to receiving the flash emission synchronization signal XOUT as the function signal FNC4 can be mentioned. After step S612, the process returns to step S606.

[0222] In step S613, the accessory controller 201 determines whether the event that has occurred is an event notified to the camera 100 via the communication request signal / WAKE. If it is determined that the event that has occurred is an event notified to the camera 100 via the communication request signal / WAKE (Yes in step S613), the process proceeds to step S614. If it is determined that the event that has occurred is not an event notified to the camera 100 via the communication request signal / WAKE (No in step S613), the process proceeds to step S615.

[0223] In step S614, the accessory controller 201 stores the reason number of the communication request to the camera 100 in response to the event that has occurred in its own volatile memory, and controls the communication request signal / WAKE to a low level. As the reason number of the communication request, as described above with reference to Figure 9 the above, a unique number is assigned according to each reason. After step S614, the process returns to step S606.

[0224] In step S615, the accessory controller 201 performs internal control of the accessory in response to the event that has occurred. As the internal control of the accessory performed in step S615, for example, detection control of the remaining battery level of the battery 205 and detection control of the operation switch 212 can be mentioned in the case where the battery 205 is provided in the accessory 200. After step S615, the process returns to step S606.

[0225] As described above with reference to Figure 13 the above processing enables the accessory 200 to perform a predetermined function operation after the accessory 200 is installed on the camera 100. Note that, for example, during the determination of repeatedly executing step S606, if an operation for stopping the use of the accessory 200 on the camera 100 or an operation for disconnecting the power supply of the camera 100 or the accessory 200 is performed, the Figure 13 series of processing operations shown are terminated.

[0226] Next, a first embodiment of the present invention will be described. Here, the processing performed by the camera 100 to cause the accessory 200 to execute a predetermined command will be described. Note that, unless otherwise specifically mentioned, the control of the communication between the camera 100 and the accessory 200 is performed by the camera controller B 102 and the accessory controller 201.

[0227] As described above, in step S604 of the processing described with reference to Figure 13 the above, the accessory controller 201 sends 15-byte accessory information in response to the I2C communication (initial communication) from the camera 100. Here, although the accessory information includes as described above with reference to Figure 6The various information described above, but assuming that the accessory 200 according to the first embodiment has Figure 14 the accessory information shown instead of Figure 6 the accessory information shown.

[0228] Figure 14 FIG. is a diagram showing the accessory information held by the accessory 200 according to the first embodiment. Figure 6 The accessory information shown and Figure 14 the accessory information of are different in terms of address 0x0F. Figure 14 The address 0x0F of the accessory information in is used as the address for holding the checksum when sending the accessory information, but is used as the receiving address for the command when executing the command by receiving a command from the camera 100. In addition, the data D1 to D0 at address 0x05 represent the I2C command execution flag indicating whether to execute the received command or send a command. When the I2C command execution flag is "1" (executing the received command), the accessory 200 performs processing associated with the command received from the camera 100.

[0229] Reference will be made respectively to Figure 15A and Figure 15B to describe the processing related to the I2C command execution flag using the accessory 200 and the camera 100. Figure 15A is a flowchart of the processing performed by the accessory 200 when the accessory 200 holding Figure 14 the accessory information shown receives a command from the camera 100. In Figure 15A , each processing operation (step) represented by the S number is implemented 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 S701, the accessory controller 201 receives a command from the camera 100. In step S702, the accessory controller 201 determines whether the I2C command execution flag set as the data D1 to D0 at address 0x05 of the accessory information is 1. As described above, the value 1 of the I2C command execution flag means to execute the command (permit command execution), and its value 0 means not to execute the command (not permit command execution). When the I2C command execution flag is 0 (No in step S702), this processing is terminated, and when the I2C command execution flag is 1 (Yes in step S702), the processing proceeds to step S703.

[0231] In step S703, the accessory controller 201 executes the command received in step S701. In step S704, the accessory controller 201 determines whether the execution of the command in step S703 is successful. If the execution of the command is successful (Yes in step S704), the process proceeds to step S705, and if the execution of the command is not successful (failed) (No in step S704), the process proceeds to step S706.

[0232] In step S705, the accessory controller 201 sends the result indicating the successful execution of the command to the camera 100, and then terminates this process. In step S706, the accessory controller 201 sends the result indicating the failed execution of the command to the camera 100, and then terminates this process.

[0233] Figure 15B It is a flowchart of the process by the camera 100 for sending a command to the accessory 200 that holds the Figure 14 accessory information shown. In Figure 15B this, each processing operation (step) represented by the S number is implemented 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.

[0234] In step S801, the camera controller B 102 determines whether the I2C command execution flag stored in the data D1 to D0 at address 0x05 as the accessory information is 1 (whether command execution is permitted). If the I2C command execution flag is 0 (No in step S801), this process is terminated, and if the I2C command execution flag is 1 (Yes in step S801), the process proceeds to step S802.

[0235] In step S802, the camera controller B 102 sends the command to be executed by the accessory 200 to the accessory 200. In step S803, the camera controller B 102 receives the execution result of the command sent from the accessory 200 in step S705 or S706, and then terminates this process. Note that when the execution result of the command received in S803 indicates the failed execution of the command, the camera controller B 102 performs a process for re - executing the command (re - sending of the command) or an error process.

[0236] Next, a second embodiment of the present invention will be described. Here, the communication data communicated through the I2C communication between the camera 100 and the accessory 200 will be described. Note that unless otherwise specifically mentioned, the control of the communication between the camera 100 and the accessory 200 is performed by the camera controller B 102 and the accessory controller 201.

[0237] Figure 16 This is a diagram showing details of communication in the case where the camera 100 according to the second embodiment sends a read notification to the accessory 200 via I2C communication. In Figure 16 , the upper row shows the transmission signal from the camera 100 to the accessory 200, and the lower row shows the transmission signal from the accessory 200 to the camera 100. Further, in Figure 16 , "S" represents a start condition, "P" represents a stop condition, "W" represents a write notification bit, "R" represents a read notification bit, and "A" represents a data reception notification (ACK).

[0238] First, the camera 100 sends the read start address 0x00 to the accessory 200. The accessory 200 sends the accessory information to the camera 100 in the form of 15-byte data. More specifically, after receiving the read notification bit, the accessory 200 sends the data (DATA0) at address 0x00 as the first byte, the data at address 0x01 as the second byte,..., and the data (DATA14) at address 0x0E as the 15th byte in this order, and then the accessory 200 sends the data at address 0x0F representing CheckSumI2C_A, which is the checksum from the accessory 200, as the 16th byte. In this case, CheckSumI2C_A is calculated by the accessory controller 201 using the following formula (4).

[0239] CheckSumI2C_A = EXOR(AND(SUM(DATA0,…DATA14),0xFF),0xFF) …(4)

[0240] Figure 17 This is a diagram showing details of communication in the case where the camera 100 according to the second embodiment sends a write notification to the accessory 200 via I2C communication. Similar to Figure 16 , also in Figure 17 , the upper row shows the transmission signal from the camera 100 to the accessory 200, and the lower row shows the transmission signal from the accessory 200 to the camera 100. Further, in Figure 17 , "S", "P", "W", "R", and "A" are the same as these symbols in Figure 16 .

[0241] The camera 100 sends the address of the data to be written and the data to the accessory 200. Then, after the writing in the accessory 200 is completed, the accessory 200 sends a data reception completion notification to the camera 100. More specifically, the camera 100 sends the address ADDR_I2C of the data to be written to the accessory 200, then sends the data (DATA) to be written to that address, and finally sends CheckSumI2C_C which is the checksum of the camera 100. On the other hand, after receiving the read notification bit, the accessory 200 first writes the data (DATA) to the received data address ADDR_I2C. Then, the accessory 200 sends the received data (written data) as the first byte through the write completion notification, and finally sends CheckSumI2C_A which is the checksum from the accessory 200. In Figure 17 In the case of the example shown, the number of data is 1, but sometimes multiple data items are written together in one communication.

[0242] By using CheckSumI2C_C from the camera 100, the accessory 200 can detect communication errors. Then, in the case where a communication error has occurred, writing the data is prohibited, thereby preventing incorrect data from being written to the accessory 200. The CheckSumI2C_C used in this case is calculated by the following formula (5), and CheckSumI2C_A is calculated by the following formula (6).

[0243] CheckSumI2C_C = EXOR(AND(SUM(ADDR_I2C, DATA), 0xFF), 0xFF)…(5)

[0244] CheckSumI2C_A = EXOR(AND(SUM(DATA), 0xFF), 0xFF)…(6)

[0245] Figure 18 is a diagram showing an example of the details of the communication when the camera 100 according to the second embodiment sends a command notification to the accessory 200 through I2C communication. Similar to Figure 16 similarly in Figure 18 the upper row shows the transmission signal from the camera 100 to the accessory 200, and the lower row shows the transmission signal from the accessory 200 to the camera 100. In addition, in Figure 18 the “S”, “P”, “W”, “R” and “A” are the same as these symbols in Figure 16 this.

[0246] The camera 100 sends command data and arguments to the accessory 200, and the accessory 200 notifies the camera 100 of the return value after completing the execution of the command. More specifically, first, the camera 100 sends the address 0x0F where the command is to be stored and the command represented by CMD_I2C to the accessory 200. Subsequently, the camera 100 sends the arguments ARGV0 to ARGVm required for the command CMD_I2C, and finally sends CheckSumI2C_C. In this case, the arguments ARGV0 to ARGVm vary with the command CMD_I2C, and in some cases, no arguments are used.

[0247] On the other hand, after receiving the read notification bit, the accessory 200 executes the process associated with the command CMD_I2C, and sends the received command CMD_I2C as the first byte to the camera 100 by notifying the completion of the execution of the command. Subsequently, the accessory 200 sends RET0 to RETn as the return value to the camera 100, and finally sends CheckSumI2C_A as the checksum from the accessory 200. In this case, the return values RET0 to RETn vary with the command CMD_I2C, and in some cases, no arguments are used.

[0248] By using CheckSumI2C_C sent from the camera 100, the accessory 200 can detect communication errors. Then, in the case where a communication error has occurred, the execution of the command is prohibited, thereby preventing the execution of an incorrect command. The CheckSumI2C_C used in this case is calculated by the following formula (7), and CheckSumI2C_A is calculated by the following formula (8).

[0249] Note that the following formula (8) represents CheckSumI2C_A in the case where the execution of the command is successful, and CheckSumI2C_A in the case where the execution of the command fails can be calculated by the following formula (9). Therefore, in the case where the execution of the command fails, by sending a value of CheckSumI2C_A different from the value of CheckSumI2C_A in the case where the execution of the command is successful to the camera 100, it is possible to notify the camera 100 of the failure of the execution of the command from the accessory 200.

[0250] CheckSumI2C_C = EXOR(AND(SUM(0x0F,CMD_I2C,ARGV0,…,ARGVm),0xFF),0xFF)…(7)

[0251] CheckSumI2C_A = EXOR(AND(SUM(CMD_I2C, RET0, …, RETn), 0xFF), 0xFF)…(8)

[0252] CheckSumI2C_A = AND(SUM(CMD_I2C, RET0, …, RETn), 0xFF)…(9)

[0253] Figure 19 is a diagram showing an example of a command to be executed in the present embodiment. In Figure 19 it, "Number (command number) represents the number assigned to the command CMD_I2C sent from the camera 100 to the accessory 200. In addition, "Arguments", "Return values", and "Type" represent the number of arguments ARGV0 to ARGVm set when sending the command, the number of return values RET0 to RETn returned by the accessory 200 after executing the command, and the type of processing executed by the accessory 200.

[0254] For example, in the case of starting charging of the accessory 200, among the data to be sent from the camera 100, the number of the command CMD_I2C is 0x03, there are no arguments ARGV0 to ARGVm as shown by setting "Arguments" to 0, and finally it becomes CheckSumI2C_C. When receiving this data from the camera 100, the accessory 200 executes charging as indicated by the type of the command and sends the received command, address 0x03, and the calculated CheckSumI2C_A as data indicating the completion of the command execution to the camera 100. Note that since the "Return values" are 0, there are no return values RET0 to RETn to be sent from the accessory 200 to the camera 100.

[0255] In addition, in the case where the camera 100 acquires the charging voltage from the accessory 200, among the data to be sent from the camera 100, the number of the command CMD_I2C is 0x82, there are no arguments ARGV0 to ARGVm as shown by setting "Arguments" to 0, and finally it becomes CheckSumI2C_C. When receiving this data from the camera 100, the accessory 200 acquires the charging voltage and sends data indicating the completion of the command execution to the camera 100. In this case, the data indicating the completion of the command execution is formed by the received command, address 0x82, the return value RET0 (since the return value is 1) as voltage data, and the calculated CheckSumI2C_A.

[0256] As described above, by writing data to any address from address 0x00 to 0x0E of the accessory information, the data at the address can be changed. On the other hand, address 0x0F is the area for storing the checksum, and since the accessory controller 201 calculates CheckSumI2C_A when sending data, it is not necessary to rewrite the data at address 0x0F from the camera 100. In the second embodiment, by using an address that does not require rewriting data by an instruction from the camera 100 as the write address of the command, the command can be executed without increasing the area of the accessory information.

[0257] In addition, when the camera 100 reads the accessory information from the accessory 200, the data of CheckSumI2C_C calculated by the camera 100 is not added. This is because, even in the case of an error, problems such as malfunctions will not occur. On the other hand, in the case where the camera 100 writes data to the accessory information area of the accessory 200, or in the case where a predetermined command is executed by the accessory 200, if an error occurs, the error cannot be detected without the checksum. Then, since the error cannot be detected, a malfunction occurs, which sometimes leads to a failure in the accessory 200. Therefore, in the case where the camera 100 writes data to the accessory information area of the accessory 200, or in the case where the accessory 200 is made to execute a predetermined command, the checksum calculated by the camera 100 is sent from the camera 100 to the accessory 200.

[0258] Note that the embodiments have been described mainly focusing on the form in which the accessory 200 is directly mounted on the camera 100, but the embodiments can adopt another form. For example, the embodiments can adopt 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 etc.) mounted on the camera 100. In this form, at least a part of the communication control executed by the accessory 200 and the communication control executed by the camera 100 described in the above embodiments can be executed by the intermediate accessory. Alternatively, the intermediate accessory can be made to function as a transmission path for outputting information corresponding to the information input from the camera 100 to the main accessory and outputting information corresponding to the information input from the main accessory to the camera 100. As described above, the accessory according to the present invention includes various accessories such as a microphone device, a lighting device, and an adapter device. In addition, the adapter device can be included in the electronic device according to the present invention.

[0259] For example, in the above-described embodiments, as examples of the electronic device and the accessory according to the present invention, a imaging device (digital camera) and an accessory mounted thereon were 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, portable electronic devices such as digital video cameras, smart phones, wearable terminals, in-vehicle cameras, security cameras, etc. can be mentioned. In addition, within the scope that the accessory is any of various electronic devices that can be mounted on (connected to) these electronic devices, the present invention can be applied to the accessory.

[0260] Other embodiments

[0261] Embodiments of the present invention can also be implemented by the following method, that is, a software (program) that executes the functions of the above-described embodiments is supplied to a system or device via a network or various storage media, and the computer or the central processing unit (CPU), microprocessing unit (MPU) of the system or device reads and executes the program.

[0262] Although the present invention has been described with reference to exemplary embodiments, it should be understood that the present invention is not limited to the disclosed exemplary embodiments. The scope of the appended claims is to be accorded the broadest interpretation so as to encompass all such modifications, equivalent structures and functions.

[0263] This application claims the benefit of Japanese Patent Application No. 2021-073485 filed on Apr. 23, 2021, the entire contents of which are incorporated herein by reference.

Claims

1. An accessory capable of communicatively connecting to an electronic device, the accessory comprising: a storage unit that allows reading from and writing to it and is used to store accessory information including a flag indicating whether the accessory is allowed to execute a command; a communication unit for sending the accessory information to the electronic device when the accessory is mounted on the electronic device; at least one processor; and at least one memory coupled to the at least one processor, the at least one memory being used to store instructions which, when executed by the at least one processor, cause the accessory to perform operations, the operations including: when a predetermined command is received from the electronic device through the communication unit, not executing the predetermined command when the flag indicates that execution of the command is not allowed, and executing the predetermined command when execution of the command is allowed.

2. The accessory according to claim 1, wherein, the operations further include: adding a checksum to the communication to the electronic device for the electronic device to read the information stored in the storage unit of the accessory, and also adding a checksum to the communication to the electronic device for the electronic device to write a command to the storage unit.

3. The accessory according to claim 2, wherein, in the storage unit, the address where the checksum to be added to the communication to the electronic device for the electronic device to read the information stored in the storage unit of the accessory is stored is the same address as the address where the command received from the electronic device is written.

4. The accessory according to claim 1, wherein, when the accessory does not include an arithmetic unit, the storage unit stores the flag indicating that execution of the command is not allowed as the flag.

5. The accessory according to claim 1, wherein, the operations further include: making the value of the checksum included in the notification of the command execution result to the electronic device different between the case where the execution of the command received from the electronic device is successful and the case where the execution of the command is unsuccessful.

6. The accessory according to claim 1, wherein, the communication unit performs I2C communication with the electronic device.

7. An electronic device capable of connecting an accessory, the electronic device comprising: a communication unit for communicating with the accessory; a reading unit for reading the accessory information including a flag stored in the storage unit provided in the accessory when the accessory is mounted on the electronic device; at least one processor; and at least one memory coupled to the at least one processor, the at least one memory being used to store instructions which, when executed by the at least one processor, cause the electronic device to perform operations, the operations including: when the flag indicates that the accessory is not allowed to execute a command, not sending a command to the accessory, and when the flag indicates that execution of the command is allowed, sending a command to the accessory.

8. The electronic device according to claim 7, wherein, the operations further include: Rather than adding a checksum to the communication to the accessory for the electronic device to read the accessory information from the accessory, a checksum is added to the communication to the accessory for the electronic device to write a command to the storage unit.

9. The electronic device according to claim 7, wherein, the communication unit performs I2C communication with the accessory.

10. A communication system, comprising: an electronic device; and an accessory communicatively connected to the electronic device, wherein the accessory includes: a storage unit that allows reading and writing thereto and stores accessory information including a flag indicating whether the accessory is allowed to execute a command; a communication unit for sending the accessory information to the electronic device when the accessory is mounted on the electronic device; at least one processor; and at least one memory coupled to the at least one processor, the at least one memory for storing instructions which, when executed by the at least one processor, cause the accessory to operate, the operation including: when a predetermined command is received from the electronic device through the communication unit, not executing the predetermined command when the flag indicates that execution of the command is not allowed, and executing the predetermined command when the flag indicates that execution of the command is allowed, and wherein the electronic device includes: a reading unit for reading the accessory information when the accessory is mounted on the electronic device; at least one processor; and at least one memory coupled to the at least one processor, the at least one memory having instructions which, when executed by the at least one processor, cause the electronic device to operate, the operation including: when the flag indicates that the accessory is not allowed to execute a command, not sending a command to the accessory, and when the flag indicates that execution of the command is allowed, sending a command to the accessory.

11. A control method for an accessory communicatively connected to an electronic device, the control method comprising: establishing communication with the electronic device; when the accessory is mounted on the electronic device, sending the accessory information stored in the storage unit provided in the accessory to the electronic device, the accessory information including a flag indicating whether the accessory is allowed to execute a command; checking the flag when a predetermined command is received from the electronic device; and not executing the predetermined command when the flag indicates that execution of the command is not allowed, and executing the predetermined command when the flag indicates that execution of the command is allowed.

12. A control method for an electronic device connectable to an accessory, the control method comprising: establishing communication with the accessory; when the accessory is mounted on the electronic device, reading the accessory information including a flag stored in the storage unit provided in the accessory; and when the flag indicates that the accessory is not allowed to execute a command, not sending a command to the accessory, and when the flag indicates that execution of the command is allowed, sending a command to the accessory.

13. A non-transitory computer-readable storage medium for storing a program, the program being for causing a computer to execute a control method of a fitting, the fitting being communicably connectable to an electronic device, the control method comprises: establishing communication with the electronic device; when the fitting is mounted on the electronic device, sending fitting information stored in a storage unit provided in the fitting to the electronic device, the fitting information including a flag indicating whether the fitting is permitted to execute a command; when a predetermined command is received from the electronic device, checking the flag; and when the flag indicates that execution of the command is not permitted, not executing the predetermined command, and when the flag indicates that execution of the command is permitted, executing the predetermined command.

14. A non-transitory computer-readable storage medium for storing a program, the program being for causing a computer to execute a control method of an electronic device, the electronic device being connectable to a fitting, the control method comprises: establishing communication with the fitting; when the fitting is mounted on the electronic device, reading fitting information including a flag stored in a storage unit provided in the fitting; and when the flag indicates that the fitting is not permitted to execute a command, not sending a command to the fitting, and when the flag indicates that execution of the command is permitted, sending a command to the fitting.

Citation Information

Patent Citations

  • Check sum writing method for eeprom

    JP1993158807A

  • Imaging apparatus and imaging system

    JP2019140565A

  • Display driver and display device

    JP2021073485A

  • Communications bus transceiver

    US20050060472A1