Electronic device and accessory, and control method thereof, communication system, and program
The accessory device with a command execution flag and control mechanism addresses malfunctions and memory constraints in slave devices by managing command execution effectively.
Patent Information
- Application Number
- JP2021073485
- Authority / Receiving Office
- JP · JP
- Patent Type
- Patents
- Current Assignee / Owner
- Filing Date
- 2021-04-23
- Publication Date
- 2026-02-17
- Estimated Expiration
- 2041-04-23
AI Technical Summary
Slave devices without a CPU face malfunctions and memory capacity constraints during communication with a master device, and even those with a CPU may not have sufficient memory.
An accessory device with a flag that indicates whether it can execute commands, allowing the accessory to skip commands it cannot handle, and a communication system that includes a control mechanism to manage command execution based on the flag's status.
Prevents malfunctions and reduces memory usage in slave devices by ensuring only executable commands are processed, optimizing memory utilization.
Smart Images

Figure 0007814849000005 
Figure 0007814849000006 
Figure 0007814849000007
Abstract
Description
[Technical Field]
[0001] The present invention relates to an electronic device, a control method and program therefor, an accessory communicatively connectable to the electronic device, a control method and program therefor, and a communication system having the electronic device and the accessory. [Background technology]
[0002] Methods for performing serial communication between electronic devices include half-duplex (e.g., I2C (registered trademark) communication) and full-duplex (e.g., SPI (registered trademark) communication). Two devices performing serial communication are divided into an electronic device that issues a communication clock and performs communication (hereinafter referred to as a "master device"), and an accessory that receives the clock from the master device and performs communication (hereinafter referred to as a "slave device").
[0003] The master and slave devices can each use a method called a checksum to determine whether the received data is correct. If the checksum does not match on the slave device side, the slave device can send a notification (slave request) separate from the serial communication to the master device, allowing the same communication to be performed again. In this case, if the slave device has a CPU, it can add a checksum to the end of the communication, but if it does not have a CPU, it cannot add a checksum.
[0004] As a technique for storing a checksum in a storage device such as an EEPROM, for example, Patent Document 1 proposes a method in which the write address is changed according to the number of writes each time the checksum is updated. Also, as a method for detecting the occurrence of an error through communication, for example, Patent Document 2 proposes a method in which a diagnostic device sends a command to an imaging unit through communication, and if an error occurs as a result of the imaging operation by the imaging unit, an error flag is set. [Prior art documents] [Patent documents]
[0005] [Patent Document 1] Japanese Patent Application Publication No. 5-158807 [Patent Document 2] Japanese Patent Application Publication No. 2019-140565 Summary of the Invention [Problem to be solved by the invention]
[0006] A slave device equipped with a CPU can perform predetermined processing through communication from a master device, but having a slave device without a CPU perform predetermined processing through communication from a master device can cause malfunctions, etc. Furthermore, even if a slave device is equipped with a CPU, it does not always have an abundant memory capacity, so there is a desire to use as little memory as possible.
[0007] The present invention aims to provide a technology that can prevent malfunctions and failures in a slave device (accessory) that receives a command from a master device (electronic device) and can reduce the memory capacity used. [Means for solving the problem]
[0008] The accessory according to the present invention is an accessory that is communicatively connected to an electronic device. , read A flag that can be read and written and indicates whether the accessory can execute a command. Accessory information including a storage means for storing the a communication means for transmitting the accessory information to the electronic device in response to the accessory being attached to the electronic device; The present invention is characterized by comprising a control means that, when a predetermined command is received from the electronic device, does not execute the predetermined command if the flag indicates that the command cannot be executed, and executes the predetermined command if the flag indicates that the command can be executed. [Effects of the Invention]
[0009] According to the present invention, when a command for processing to be executed by a slave device is communicated from a master device to a slave device, it is possible to suppress malfunctions and failures in the slave device and reduce the memory capacity used. [Brief explanation of the drawings]
[0010] [Figure 1] FIG. 2 is a block diagram showing the electrical configuration of the camera and the accessory. [Figure 2] 1A and 1B are diagrams showing schematic waveforms of two types of SPI protocols in an SPI communication method. [Figure 3] 10 is a flowchart showing the operations of a camera control unit and an accessory control unit in a first communication protocol. [Figure 4] 10 is a flowchart showing the operations of a camera control unit and an accessory control unit in a second communication protocol. [Figure 5] FIG. 10 is a diagram showing an example of an operation execution command from a camera to an accessory. [Figure 6] FIG. 10 is a diagram illustrating an example of accessory information held by an accessory. [Figure 7] FIG. 10 is a sequence diagram illustrating an example of processing executed by an accessory and a camera. [Figure 8] FIG. 10 is a diagram showing an example of information indicating the type of an accessory. [Figure 9] 10A and 10B are diagrams illustrating factors of a communication request signal sent from an accessory to a camera. [Figure 10] FIG. 10 is a diagram illustrating an example of a communication byte interval in SPI communication. [Figure 11] 10 is a flowchart of a process executed by the camera after an accessory is attached. [Figure 12] 10 is a flowchart of a process in which the camera enables a function of an accessory. [Figure 13] 10 is a flowchart of a process executed by an accessory attached to a camera. [Figure 14] FIG. 3 is a diagram showing accessory information held by an accessory according to the first embodiment. [Figure 15] 10 is a flowchart showing a process in which an accessory receives and executes a command, and a process in which a camera transmits a command to the accessory according to the first embodiment. [Figure 16] FIG. 10 is a diagram showing an example of communication content between a camera and an accessory in the second embodiment. [Figure 17] FIG. 10 is a diagram showing an example of communication content between a camera and an accessory in the second embodiment. [Figure 18] FIG. 10 is a diagram showing an example of communication content between a camera and an accessory in the second embodiment. [Figure 19] FIG. 10 is a diagram illustrating an example of a command executed in the second embodiment. [Figure 20] FIG. 10 is a diagram illustrating an example of an I2C communication waveform. [Figure 21] 10 is a diagram showing a process performed by the camera control unit A101 when transmitting NC byte data from the camera control unit A101 to the accessory control unit 201. FIG. [Figure 22] 10 is a diagram showing the processing performed by the camera control unit A101 when the camera control unit A101 receives ND byte data from the accessory control unit 201. FIG. [Figure 23] 10 is a diagram showing the processing performed by the accessory control unit 201 when the camera control unit A101 and the accessory control unit 201 transmit and receive NE byte data. DETAILED DESCRIPTION OF THE INVENTION
[0011] Hereinafter, embodiments of the present invention will be described in detail with reference to the accompanying drawings. Here, an imaging device will be taken as an example of an electronic device according to the present invention. Accessories communicably connected to the imaging device are not particularly limited as long as they are electronic devices that can communicate with the imaging device. Examples of accessories include lighting devices (such as flash devices), display devices (such as electronic viewfinders), and audio devices (such as microphones).
[0012] The imaging device and the accessory constitute an imaging system (communication system), in which the imaging device functions as a master device and the accessory functions as a slave device.
[0013] 1 is a block diagram showing the electrical configuration of an imaging device 100 (hereinafter referred to as "camera 100") and an accessory 200. The camera 100 has a camera control unit A101, a camera control unit B102, a battery 111, a system power supply unit 112, an imaging sensor 122, an image processing unit 123, a memory control unit 124, a volatile memory 125, a recording memory 126, and a display unit 127. The camera 100 also has a backlight unit 128, an accessory power supply unit A131, an accessory power supply unit B132, a protection unit 133, and a camera connection unit 141.
[0014] The battery 111 supplies power to each component of the camera 100. The battery 111 is detachable from the camera 100. The camera control unit A101 and the camera control unit B102 are circuits (control means) that control the overall operation of the camera 100 and are configured by a microcomputer incorporating a CPU and other components. The camera control unit A101 monitors the switches and other components that make up the operation unit operated by the user, operates even when the camera 100 is in standby mode, and performs power control and other operations in response to user operations. The camera control unit B102 controls the image sensor 122, the display unit 127, and other components, and stops operating when the camera 100 is in standby mode. The standby mode refers to a state in which the camera 100 is powered on but power consumption is suppressed (low power consumption mode). After the camera 100 is powered on, the camera 100 transitions to the standby mode if a certain period of time has passed without any external operation being performed on the camera 100. In this embodiment, the camera control unit A101 and the camera control unit B102 are configured by separate processors, but they may be provided in a single processor.
[0015] The system power supply unit 112 is configured with a DC-DC converter circuit, an LDO (Low Drop Out), a charge pump circuit, etc., and generates power to be supplied to each unit of the camera 100. A voltage of 1.8V generated by the system power supply unit 112 is constantly supplied from the battery 111 to the camera control unit A101 as a camera microcomputer power supply VMCU_C. In addition, several types of voltages generated by the system power supply unit 112 are supplied from the battery 111 to the camera control unit B102 at any timing as a camera microcomputer power supply VMCU2_C. The camera control unit A101 controls the system power supply unit 112 to turn on / off the power supply to each unit of the camera 100.
[0016] The camera 100 is provided with a detachable optical lens 121 (a so-called interchangeable lens). The optical lens 121 may be integrally (non-detachably) provided on the camera 100. Light (incident light) from a subject incident through the optical lens 121 is focused on an imaging surface (imaging surface) of an imaging sensor 122, which may be a CMOS sensor, a CCD sensor, or the like. The optical lens 121 and the camera 100 may be integrated into one unit. The imaging sensor 122 encodes the subject image (optical image) focused on the imaging surface into a digital imaging signal. The image processing unit 123 performs image processing such as noise reduction and white balance processing on the digital imaging signal to generate image data, and converts the generated image data into an image file in JPEG format or the like for recording in the recording memory 126. The image processing unit 123 also generates VRAM image data from the generated image data to be displayed on the display unit 127.
[0017] The memory control unit 124 controls the transmission and reception of image data generated by the image processing unit 123 and other units, as well as other data. The volatile memory 125 is a memory such as a DDR3 SDRAM that is capable of high-speed reading and writing, and is used as a workspace for image processing performed by the image processing unit 123. The recording memory 126 is a readable and writable recording medium such as an SD card or a CFexpress card that is attachable to and detachable from the camera 100 via a connector (not shown). The display unit 127 is a display disposed on the rear surface of the camera 100, and is configured by an LCD panel, an organic EL display panel, or the like. The backlight unit 128 adjusts the brightness of the display unit 127 by changing the amount of light from the backlight of the display unit 127.
[0018] The accessory power supply unit A131 and the accessory power supply unit B132 each convert the voltage supplied from the system power supply unit 112 to a predetermined voltage. In this embodiment, 3.3 V is generated as the accessory power supply VACC, but other voltages may also be used. The accessory power supply unit A131 is a power supply unit with low self-consumption power, such as an LDO. The accessory power supply unit B132 is a power supply unit with a DC-DC converter circuit, such as a DC-DC converter, that can pass a larger current than the accessory power supply unit A131. The accessory power supply unit B132 also consumes more self-consumption power than the accessory power supply unit A131. Therefore, when the load current is small, the accessory power supply unit A131 is more efficient than the accessory power supply unit B132, and when the load current is large, the accessory power supply unit B132 is more efficient than the accessory power supply unit A131. The camera control unit A101 controls switching on / off of the voltage output of the accessory power supply unit A131 and the accessory power supply unit B132 depending on the operating state of the accessory 200.
[0019] The protection unit 133 is configured with a current fuse element, a polyswitch element, or an electronic fuse circuit that combines a resistor, an amplifier, and a switch element. The protection unit 133 outputs an overcurrent detection signal DET_OVC when the value of the power supply current supplied to the accessory 200 from the accessory power supply unit A131 and the accessory power supply unit B132 exceeds a predetermined value and becomes excessive (abnormal). In this embodiment, the protection unit 133 is an electronic fuse circuit, and notifies the camera control unit A101 of the overcurrent detection signal DET_OVC when a current of 1 A or more flows. The overcurrent detection signal DET_OVC is a signal that indicates an overcurrent by being at a Hi level. Note that the predetermined value (current value) is not limited to 1 A.
[0020] The camera 100 and the accessory 200 are electrically connected by one-to-one contact between a plurality of contacts (terminals) TC01 to TC21 of the camera connection section 141 of the camera 100 and a plurality of contacts TA01 to TA21 of the accessory connection section 211 of the accessory 200.
[0021] The camera connection unit 141 is a connector for making an electrical connection with the accessory 200 via 21 contacts TC01 to TC21 arranged in a row. The contacts TC01 to TC21 are arranged in this order in a row from one end to the other.
[0022] Contact TC01, which serves as a third ground contact of camera connection unit 141, is connected to ground (GND) and serves not only as a reference potential contact but also as a contact for controlling the wiring impedance of differential signals D1N and D1P. Contacts TC02 and TC03 are connected to camera control unit B102, with differential signal D1N connected to contact TC02 and differential signal D1P connected to contact TC03. Differential signals D1N and D1P are differential data communication signals that form a pair to perform data communication. Contacts TC02, TC03, 07-17, 19, and 20 are communication contacts.
[0023] Contact TC04, which serves as a first ground contact, is connected to GND and serves as a reference potential contact for camera 100 and accessory 200. Contact TC05, which serves as a power contact, is connected to accessory power VACC generated by accessory power supply units A131 and B132 via protection unit 133. Contact TC04 is arranged further outward than contact TC05 in the arrangement direction of the contacts.
[0024] An accessory attachment detection signal / ACC_DET is connected to contact TC06, which serves as an attachment detection contact. The accessory attachment detection signal / ACC_DET is pulled up to the camera microcomputer power supply VMCU_C via a resistive element Rp134 (e.g., 10 kΩ). The camera control unit A101 can detect whether the accessory 200 is attached by reading the signal level of the accessory attachment detection signal / ACC_DET. If the signal level (electric potential) of the accessory attachment detection signal / ACC_DET is Hi level (predetermined electric potential) or higher, it is detected that the accessory 200 is not attached, and if it is Lo level (GND electric potential), it is detected that the accessory 200 is attached.
[0025] When the power of the camera 100 is turned on, the signal level (electric potential) of the accessory attachment detection signal / ACC_DET changes from Hi level to Lo level, which triggers various communications between the camera 100 and the accessory 200 via the contacts.
[0026] Upon detecting that the accessory 200 has been put into an attached state, the camera control unit A101 supplies power to the accessory 200 via TC05, which serves as a power contact.
[0027] SCLK, MOSI, MISO, and CS connected to contacts TC07, TC08, TC09, and TC10, respectively, are signals for performing SPI communication, a type of serial communication, with the camera control unit B102 acting as the communication master. In this embodiment, the SPI communication has a communication clock frequency of 1 MHz, a data length of 8 bits (1 byte), a bit order of MSB first, and a full-duplex communication method.
[0028] In this embodiment, the camera 100 and the accessory 200 are assumed to support two types of communication protocols of the SPI communication method. The first communication protocol is a method in which the camera 100 does not check whether the accessory 200 is in a communication-enabled state before outputting SCLK, and is hereinafter referred to as "SPI protocol A." Figure 2(a) is a diagram showing an outline of the communication waveform of SPI protocol A. In Figure 2(a), the CS signal is set to Lo active (active at Lo level).
[0029] At timing A1, the camera control unit B102 changes CS to Lo level and requests SPI communication from the accessory control unit 201. At timing A2, a predetermined time T_CS after timing A1, the camera control unit B102 starts outputting SCLK and MOSI. Similarly, the accessory control unit 201 (details will be described later) included in the accessory 200 starts outputting MISO when it detects a falling edge change of SCLK.
[0030] The camera control unit B102 stops the SCLK output at timing A3 when the SCLK output for one byte is completed.The camera control unit B102 then stops the SCLK output from timing A3 until a predetermined time T_INTERVAL has elapsed, and resumes the SCLK output at timing A4 when the time T_INTERVAL has elapsed, and communicates the next one byte.
[0031] Fig. 3(a) is a flowchart illustrating the operation of the camera control unit B102 in the SPI protocol A. Each process (step) indicated by an S number in Fig. 3(a) is realized by the CPU of the camera control unit B102 loading a predetermined program stored in the ROM of the camera control unit B102 into the RAM of the camera control unit B102.
[0032] In S101, the camera control unit B102 stores a value indicating the number of bytes to be communicated in the variable NA. For example, if 3 bytes are to be communicated, '3' is stored. In S102, the camera control unit B102 changes CS to the Lo level to request SPI communication. In S103, the camera control unit B102 determines whether a predetermined time T_CS has elapsed since changing CS to the Lo level. The camera control unit B102 waits until the time T_CS has elapsed (No in S103), and if it determines that the predetermined time T_CS has elapsed (Yes in S103), the process proceeds to S104.
[0033] In S104, the camera control unit B102 performs SCLK output control to communicate 1 byte of data, as well as MOSI data output control and MISO data input control. In S105, the camera control unit B102 decrements the value of the variable NA. In S106, the camera control unit B102 determines whether the variable NA is 0 (zero). If the camera control unit B102 determines that the variable NA is 0 (Yes in S106), the process proceeds to S107, and if the camera control unit B102 determines that the variable NA is not 0 (No in S106), the process proceeds to S108.
[0034] In S108, the camera control unit B102 determines whether a predetermined time T_INTERVAL has elapsed since the communication of 1 byte of data was completed in S104. The camera control unit B102 waits until the time T_INTERVAL has elapsed (No in S108), and if it determines that the time T_INTERVAL has elapsed (Yes in S108), the process returns to S104. In S107, the camera control unit B102 changes CS to Hi level, thereby ending the series of SPI communications.
[0035] Fig. 3(b) is a flowchart illustrating the operation of the accessory control unit 201 in SPI protocol A. Each process (step) indicated by an S number in Fig. 3(b) is realized by the CPU of the accessory control unit 201 expanding a predetermined program stored in its own ROM into its own volatile memory.
[0036] In S201, the accessory control unit 201 determines whether CS has changed to Lo. If the accessory control unit 201 determines that CS has not changed to Lo (No in S201), it repeats the determination in S201, and if it determines that CS has changed to Lo (Yes in S201), it proceeds to S202. In S202, the accessory control unit 201 controls the input of MOSI data and the output of MISO data in accordance with the SCLK signal input, thereby communicating 1 byte of data. In S203, the accessory control unit 201 determines whether CS has changed to Hi. If the accessory control unit 201 determines that CS has not changed to Hi (No in S203), it returns the process to S202 to communicate the next 1 byte. On the other hand, if the accessory control unit 201 determines that CS has changed to Hi (YES in S203), it ends this process, thereby ending the SPI communication.
[0037] The second of the two communication protocols of the SPI communication method is a method in which the camera 100 checks whether the accessory 200 is in a communication-enabled state before outputting SCLK, and is hereinafter referred to as "SPI protocol B."
[0038] 2(b) is a diagram showing an outline of the communication waveform of SPI protocol B. The camera control unit B102 requests SPI communication from the accessory control unit 201 by changing CS to Lo level at timing B1. In response to this communication request, the camera control unit B102 checks the potential of MISO, and if it is Hi level, determines that the accessory control unit 201 is in a communication-enabled state, and if it is Lo level, determines that the accessory control unit 201 is in a communication-disabled state. On the other hand, when the accessory control unit 201 detects the falling edge of CS, it controls MISO to Hi level if SPI communication is enabled, or controls MISO to Lo level if communication is disabled (timing B2).
[0039] When the camera control unit B102 confirms that MISO is at Hi level at timing B3, it starts outputting SCLK and MOSI. Similarly, when the accessory control unit 201 detects a falling edge of SCLK, it starts outputting MISO. When the camera control unit B102 completes output of one byte of SCLK at timing B4, it stops outputting SCLK. After transmitting and receiving one byte of data, the accessory control unit 201 controls MISO to Hi level if SPI communication is possible, and controls MISO to Lo level if SPI communication is not possible (timings B5 and B6). The camera control unit B102 checks the potential of MISO at timing B7, and if it is at Hi level, it determines that the accessory control unit 201 is in a communication possible state, and if it is at Lo level, it determines that the accessory control unit 201 is in a communication impossible state.
[0040] Fig. 4(a) is a flowchart illustrating the operation of the camera control unit B102 in the SPI protocol B. Each process (step) indicated by an S number in Fig. 4(a) is realized by the CPU of the camera control unit B102 loading a predetermined program stored in the ROM of the camera control unit B102 into the RAM of the camera control unit B102.
[0041] In S111, the camera control unit B102 stores a numerical value indicating the number of bytes to be communicated in the variable NB. For example, when communicating 3 bytes, 3 is stored in the variable NB. In S112, the camera control unit B102 changes CS to Lo level to request SPI communication. In S113, the camera control unit B102 determines whether MISO is at Hi level. The camera control unit B102 waits until MISO is at Hi level (No in S113), and if it determines that MISO has become Hi level (Yes in S113), the process proceeds to S114.
[0042] In S114, the camera control unit B102 performs SCLK output control, MOSI data output control, and MISO data input control to communicate 1 byte of data. In S115, the camera control unit B102 stores the value obtained by subtracting 1 from the value of the variable NB as a new variable NB.
[0043] In S116, the camera control unit B102 determines whether communication of all data has been completed (whether the variable NB has become 0). Here, it is determined that communication of all data has been completed when the variable NB has become 0. If the camera control unit B102 determines that communication of all data has been completed (Yes in S116), the process proceeds to S117, and if it determines that communication of all data has not been completed (No in S117), the process proceeds to S118.
[0044] In S117, the camera control unit B102 changes CS to Hi level, thereby ending a series of SPI communications. Meanwhile, in S118, the camera control unit B102 determines whether MISO has changed to Hi level. The camera control unit B102 waits until MISO changes to Hi level (No in S118), and if it determines that MISO has changed to Hi level (Yes in S118), the process returns to S114.
[0045] Fig. 4(b) is a flowchart illustrating the operation of the accessory control unit 201 in SPI protocol B. Each process (step) indicated by an S number in Fig. 4(b) is realized by the CPU of the accessory control unit 201 expanding a predetermined program stored in its own ROM into its own volatile memory.
[0046] In S211, the accessory control unit 201 determines whether CS has changed to Lo. If the accessory control unit 201 determines that CS has not changed to Lo (No in S211), it repeats the determination of S211, and if it determines that CS has changed to Lo (Yes in S211), it proceeds to S212. In S212, the accessory control unit 201 determines whether SPI communication is possible. If the accessory control unit 201 determines that SPI communication is possible (Yes in S212), it proceeds to S213, and if it determines that SPI communication is not possible (No in S212), it proceeds to S214.
[0047] In S213, the accessory control unit 201 controls MISO to Hi level, and then the process proceeds to S215. In S214, the accessory control unit 201 controls MISO to Lo level, and then the process returns to S212.
[0048] In S215, the accessory control unit 201 controls the input of MOSI data and the output of MISO data in response to the SCLK signal input, thereby communicating 1 byte of data. In S216, the accessory control unit 201 determines whether CS has changed to Hi. If the accessory control unit 201 determines that CS has not changed to Hi (No in S216), it returns the process to S212 to communicate the next 1 byte. On the other hand, if the accessory control unit 201 determines that CS has changed to Hi (YES in S216), it ends this process, thereby ending the SPI communication.
[0049] 5 is a diagram showing an example of communication content when the camera 100 notifies the accessory 200 of an operation execution command via SPI communication. In the first byte of communication, the camera control unit B102 transmits 'CMD', which is information indicating a command number, as MOSI data. In response, the accessory control unit 201 transmits the value '0xA5', which is information indicating a communication-enabled state, as MISO data. Furthermore, if the accessory control unit 201 cannot execute the communication process for the first byte, it transmits a value other than '0xA5' as MISO data.
[0050] In communicating the second byte, the camera control unit B102 transmits 'MOSI_DATA1', which is an argument corresponding to the command number CMD. Similarly, from the third byte to the (N-2)th byte onwards, it transmits 'MOSI_DATA2 to MOSI_DATA[N-3]', which are arguments corresponding to the command number CMD. In response to this, in communicating the second byte, the accessory control unit 201 transmits the command number CMD received in the first byte as MISO data. This allows the camera control unit B102 to determine that the accessory control unit 201 has correctly received the MOSI data. In communicating the third byte, the accessory control unit 201 transmits 'MISO_DATA1', which is a return value corresponding to the command number CMD, as MISO data. Similarly, from the fourth byte to the (N-2)th byte onwards, the accessory control unit 201 transmits 'MISO_DATA2 to MISO_DATA[N-4]', which are return values corresponding to the command number CMD. Note that the number of arguments and return values is predetermined for each command number, but either or both of the arguments and return values may be omitted.
[0051] In the (N-1)th byte of communication, the camera control unit B102 transmits 'CheckSum_C' as checksum data as MOSI data. CheckSum_C is calculated by the camera control unit B102 using the following formula 1 from the data that the camera control unit B102 transmits to the accessory control unit 201. Meanwhile, the accessory control unit 201 transmits the value '0x00', which indicates an address, as MISO data.
[0052] In the Nth byte of communication, the camera control unit B102 transmits '0x00' as the MOSI data, while the accessory control unit 201 transmits 'CheckSum_A' as the checksum data as the MISO data.
[0053] CheckSum_A is the first CheckSum_A calculated by the following formula 2, or the second CheckSum_A calculated by the following formula 3. That is, the accessory control unit 201 calculates CheckSum_C_A from the actually received data. Then, the accessory control unit 201 determines whether the received CheckSum_C matches the CheckSum_C_A calculated from the received data. If CheckSum_C and CheckSum_C_A match, the accessory control unit 201 calculates the first CheckSum_A by the following formula 2 and transmits it to the camera control unit B102. On the other hand, if the accessory control unit 201 determines that CheckSum_C and CheckSum_C_A do not match, it calculates the second CheckSum_A by the following formula 3 and transmits it to the camera control unit B102. Note that the second CheckSum_A is the one's complement of the first CheckSum_A.
[0054]
number
[0055] Returning to the explanation of the electrical configuration of the camera 100 in Fig. 1, a communication request signal / WAKE is connected to the contact TC11, which is used by the accessory 200 to request communication from the camera control unit A101. The communication request signal / WAKE is pulled up to the camera microcomputer power supply VMCU_C via a resistor. The camera control unit A101 receives a communication request from the accessory 200 by detecting the falling edge of the communication request signal / WAKE.
[0056] The SDA connected to contact TC12 and the SCL connected to contact TC13 are signals for performing I2C communication, a type of serial communication, with the camera control unit A101 acting as the communication master. SDA and SCL are open-drain communication signals pulled up to the camera microcomputer power supply VMCU_C, and in this embodiment, the communication frequency is 100 kbps.
[0057] In I2C communication, data is transmitted from both the camera 100 and the accessory 200 via SDA. I2C communication has a slower communication speed than SPI communication. SPI communication is also faster than I2C communication and is therefore more suitable for transmitting large amounts of information. Therefore, in communication between the camera 100 and the accessory 200 in this embodiment, information with large amounts of data is communicated using SPI communication, and information with small amounts of data is communicated using I2C communication. For example, data is first communicated using I2C communication, and if SPI communication is possible or necessary based on this data, control can be exercised to further execute SPI communication.
[0058] Figure 20 shows an example of an I2C communication waveform. Figure 20(a) shows an example of the waveform when the camera transmits N bytes of data (DATA[1] to DATA[N]) to the accessory, and Figure 20(b) shows an example of the waveform when the camera receives N bytes of data (DATA[1] to DATA[N]) from the accessory.
[0059] In Figures 20(a) and (b), the waveform at the top is SCL, and the waveform at the bottom is SDA. Below the SDA waveform, it is shown what the signal means at each timing, and whether the control unit controlling the output level of the SDA signal is the camera control unit A101 or the accessory control unit 201. Furthermore, since the communication data is made up of one-byte data and one-bit information indicating a response, for ease of explanation, the number of bytes of data from the start of communication is shown at the top of the figure. Details of the communication content will be explained using the flowcharts in Figures 21 to 23, so only an outline will be given in Figures 20(a) and (b).
[0060] 20(a), in communication of the first and second bytes, the camera control unit A101 notifies the accessory control unit 201 of storage address information of the data to be transmitted. In communication of the third to (N+2)th bytes, the camera control unit A101 transmits N bytes of data (DATA[ADDRESS] to DATA[ADDRESS+N]) to the accessory control unit 201.
[0061] 20(b), in communication of the first and second bytes, the camera control unit A101 notifies the accessory control unit 201 of storage address information of the data to be received. In communication of the third to (N+3)th bytes, the camera control unit A101 receives N bytes of data (DATA[ADDRESS] to DATA[ADDRESS+N]) from the accessory control unit 201.
[0062] Here, the flowcharts of Figures 21 to 23 will be described. Figure 21 is a flowchart of the processing performed by the camera control unit A101 when transmitting NC byte data from the camera control unit A101 to the accessory control unit 201. Each process indicated by an S number in the flowchart of Figure 21 is realized by the CPU of the camera control unit A101 expanding a program stored in the ROM of the camera control unit A101 into the RAM of the camera control unit A101.
[0063] In S3001, the camera control unit A101 stores a numerical value indicating the number of bytes to be transmitted in the variable NC. For example, when transmitting 3 bytes, 3 is stored in the variable NC. In this embodiment, 3 is stored in the variable NC. In S3002, the camera control unit A101 changes the SDA to the Lo level while the SCL is at the Hi level (START condition). This notifies the accessory control unit 201 of the start of communication.
[0064] In S3003, the camera control unit A101 sets, in the most significant 7 bits of the transmission data, slave address information indicating the slave address of the accessory control unit 201. In this embodiment, the slave address of the accessory control unit 201 is assumed to be 1010000 in binary.
[0065] In S3004, the camera control unit A101 sets information indicating that this is WRITE communication in the lowest 1 bit of the transmission data. Setting this bit to 0 means that this is WRITE communication.
[0066] In S3005, the camera control unit A101 transmits to the accessory control unit 201 the data (10100000 in binary, 0xA0 in hexadecimal) set as transmission data in S3003 and S3004.
[0067] In S3006, the camera control unit A101 outputs SCL for one clock after transmitting one byte of data, and checks the signal level of SDA. If the signal level of SDA is Lo, the camera control unit A101 determines that this is a data reception acknowledgement (ACK) from the accessory control unit 201 (Yes in S3006), and proceeds to S3007. On the other hand, if the signal level of SDA is Hi, the camera control unit A101 determines that the accessory control unit 201 has not received the data normally (No in S3006), and proceeds to S3014.
[0068] In S3007, the camera control unit A101 sets, as transmission data, information about the storage address of the data to be transmitted to the accessory control unit 201 (start address information). In this embodiment, the size of the start address information is 1 byte, and the value is 0x00.
[0069] In S3008, the camera control unit A101 transmits the set one-byte start address information (value 0x00) to the accessory control unit 201. In S3009, after transmitting the one-byte start address information data, the camera control unit A101 outputs SCL for one clock and checks the SDA signal level. If the SDA signal level is Lo, the camera control unit A101 determines that this is a data reception acknowledgement (ACK) from the accessory control unit 201 (Yes in S3009), and proceeds to S3010. On the other hand, if the SDA signal level is Hi, the camera control unit A101 determines that the accessory control unit 201 has not received the data normally (No in S3009), and proceeds to S3014.
[0070] In S3010, the camera control unit A101 stores 1 in the variable MC. The variable MC is a variable for counting the amount of transmitted data. In S3011, the camera control unit A101 outputs one byte of SCL and changes SDA to a desired signal level while SCL is Lo, thereby transmitting one byte of data to the accessory control unit 201. Here, the start address information is 0x00 and the variable MC is 1, so one byte of data corresponding to address 0x00 is transmitted.
[0071] In S3012, the camera control unit A101 outputs SCL for one clock after transmitting one byte of data, and checks the signal level of SDA. If the signal level of SDA is Lo, the camera control unit A101 determines that this is a data reception acknowledgement (ACK) from the accessory control unit 201 (Yes in S3012), and proceeds to S3013. On the other hand, if the signal level of SDA is Hi, the camera control unit A101 determines that the accessory control unit 201 has not received the data normally (No in S3012), and proceeds to S3014.
[0072] In S3013, the camera control unit A101 checks whether the variable MC has the same value as the variable NC. If the variable MC has the same value as the variable NC, the camera control unit A101 determines that transmission of all data has been completed (Yes in S3013) and proceeds to S3014. If the variable MC does not have the same value as the variable NC, the camera control unit A101 determines that transmission data still remains (No in S3013) and proceeds to S3015.
[0073] In S3015, the camera control unit A101 adds 1 to the variable MC, and then returns the process to S3011. In this way, after returning to S3011, the camera control unit A101 sequentially increments the address of the data to be transmitted, and transmits one byte of data corresponding to each address.
[0074] In this way, by repeatedly transmitting one byte of data until the variables MC and NC become the same value in the process of S3013, the camera control unit A101 transmits NC bytes of data to the accessory control unit 201. When the variable NC is set to 3 as in this embodiment, 3 bytes of data can be transmitted.
[0075] In S3014, the camera control unit A101 changes SDA to Hi level while SCL is at Hi level (STOP condition), thereby notifying the accessory control unit 201 of the end of communication.
[0076] Fig. 22 is a flowchart of the processing performed by the camera control unit A101 when the camera control unit A101 receives ND byte data from the accessory control unit 201. Each process indicated by an S number in the flowchart in Fig. 22 is realized by the CPU of the camera control unit A101 expanding a program stored in the ROM of the camera control unit A101 into the RAM of the camera control unit A101.
[0077] In S3101, the camera control unit A101 stores a numerical value indicating the number of bytes to be received in a variable ND. For example, when 3 bytes are received, 3 is stored in the variable ND. In this embodiment, it is assumed that 3 is stored in the variable ND. In S3102 to S3106, the camera control unit A101 executes the same processes as in S3002 to S3006, respectively.
[0078] In S3107, the camera control unit A101 sets, as transmission data, information on the storage address of the data received from the accessory control unit 201 (start address information). In this embodiment, the size of the start address information is 1 byte, and its value is 0x00. In S3108, the camera control unit A101 transmits the set 1-byte start address information (value 0x00) to the accessory control unit 201.
[0079] In S3109, the camera control unit A101 outputs SCL for one clock after transmitting one byte of start address information data, and checks the signal level of SDA. If the signal level of SDA is Lo, the camera control unit A101 determines that this is a data reception acknowledgement (ACK) from the accessory control unit 201 (Yes in S3109), and proceeds to S3110. On the other hand, if the signal level of SDA is Hi, the camera control unit A101 determines that the accessory control unit 201 has not received the data normally (No in S3109), and proceeds to S3122.
[0080] In S3110, the camera control unit A101 changes SDA to Lo level while SCL is at Hi level, as in S3102, and notifies the accessory control unit 201 of a START condition. In S3111, the camera control unit A101 sets slave address information indicating the slave address of the accessory control unit 201 in the most significant 7 bits of the transmission data. In this embodiment, the slave address of the accessory control unit 201 is assumed to be 1010000 in binary.
[0081] In S3112, the camera control unit A101 sets information indicating READ communication in the lowest 1 bit of the transmission data. Setting this bit to 1 means that the communication is READ communication.
[0082] In S3113, the camera control unit A101 transmits to the accessory control unit 201 the data (10100001 in binary, 0xA1 in hexadecimal) set as transmission data in S3003 and S3004.
[0083] In S3114, the camera control unit A101 outputs SCL for one clock after transmitting one byte of data, and checks the signal level of SDA. If the signal level of SDA is Lo, the camera control unit A101 determines that this is a data reception acknowledgement (ACK) from the accessory control unit 201 (Yes in S3114), and proceeds to S3115. On the other hand, if the signal level of SDA is Hi, the camera control unit A101 determines that the accessory control unit 201 has not received the data normally (No in S3114), and proceeds to S3122.
[0084] In S3115, the camera control unit A101 stores 1 in the variable MD. The variable MD is a variable for counting the amount of received data. In S3116, the camera control unit A101 outputs one byte of SCL and reads the SDA signal level at the timing when SCL changes from Lo to Hi. This makes it possible to receive one byte of data from the accessory control unit 201. The received one byte of data can be stored in the volatile memory 125 as data corresponding to address 0x00, or used for predetermined processing.
[0085] In S3117, the camera control unit A101 determines whether one byte of data has been received successfully. If the camera control unit A101 determines that the data has been received successfully (Yes in S3117), the process proceeds to S3118, and if the camera control unit A101 determines that the data has not been received successfully (No in S3117), the process proceeds to S3119.
[0086] In S3118, the camera control unit A101 determines whether the variable MD is the same value as the variable ND. If the variable MD is the same value as the variable ND, the camera control unit A101 determines that reception of all data has been completed (Yes in S3118) and proceeds to S3119. On the other hand, if the variable MD is not the same value as the variable ND, the camera control unit A101 determines that received data remains (No in S3118) and proceeds to S3120.
[0087] In S3120, the camera control unit A101 outputs one byte of SCL and controls SDA to the Lo level, thereby issuing a data reception acknowledgement (ACK) to the accessory control unit 201 and notifying it that data communication will continue. In S3121, the camera control unit A101 adds 1 to the variable MD, and then returns the process to S3116. After the process returns to S3116, the camera control unit A101 sequentially increments the addresses of the data to be received and receives one byte of data corresponding to each address.
[0088] In this way, by repeatedly receiving 1 byte of data until the variable MD and the variable ND have the same value in the process of S3118, the camera control unit A101 receives ND bytes of data from the accessory control unit 201. When the variable ND is set to 3 as in this embodiment, 3 bytes of data can be received.
[0089] In S3119, the camera control unit A101 outputs one byte of SCL and controls SDA to Hi level, thereby notifying the accessory control unit 201 that data communication has been completed (NACK). In S3122, the camera control unit A101 changes SDA to Hi level while SCL is at Hi level (STOP condition). This notifies the accessory control unit 201 that communication has ended.
[0090] 23 is a flowchart of processing performed by the accessory control unit 201 when NE bytes of data are transmitted and received between the camera control unit A101 and the accessory control unit 201. This processing includes processing by the accessory control unit 201 to receive NE bytes of data from the camera control unit A101, and processing by the accessory control unit 201 to transmit NE bytes of data from the accessory control unit A101. Each processing step indicated by an S number in the flowchart in FIG. 23 is realized by the CPU of the accessory control unit 201 loading a program stored in the ROM of the accessory control unit 201 into the RAM of the accessory control unit 201.
[0091] In S3201, the accessory control unit 201 waits for SDA to change to Lo level (start condition) while SCL is at Hi level (No in S3201). If the accessory control unit 201 detects the START condition (Yes in S3201), the process proceeds to S3202.
[0092] In S3202, the accessory control unit 201 stores 0 in the variable ME. The variable ME is a variable for counting the number of pieces of transmitted and received data. In S3203, the accessory control unit 201 receives 1 byte of data transmitted from the camera control unit A101.
[0093] In S3204, the accessory control unit 201 determines whether the upper 7 bits of the 1-byte data received in S3203 match the slave address (0x50 in this embodiment) of the accessory control unit 201. If the accessory control unit 201 determines that the data matches the slave address (Yes in S3204), the process proceeds to S3205, and if it determines that the data does not match the slave address (No in S3204), the process proceeds to S3221.
[0094] In S3205, the accessory control unit 201 sends a data reception acknowledgement (ACK) to the camera control unit A101 by controlling SDA to a Low level for the next SCL clock output after receiving one byte. In S3206, the accessory control unit 201 determines the type of data for the next one-byte communication based on the lowest one bit of the one-byte data received in S3203. If the lowest one bit of data is 0, the accessory control unit 201 determines that the data for the next one-byte communication is writing of start address information from the camera control unit A101 to the accessory control unit 201 (Yes in S3206), and proceeds to S3207. On the other hand, if the lowest one bit of data is 1, the accessory control unit 201 determines that the data for the next one-byte communication is transmission data from the accessory control unit 201 to the camera control unit A101 (No in S3206), and proceeds to S3209.
[0095] In S3207, the accessory control unit 201 receives one byte of data transmitted from the camera control unit A101. The received one byte of data is information indicating an address where data to be transmitted and received in subsequent communication is stored. In this embodiment, as described with reference to FIGS. 21 and 22, the start address information is assumed to be 0x00.
[0096] In S3209, the accessory control unit 201 sets address information stored in advance in the accessory control unit 201 or address information notified in advance from the camera control unit A101 as start address information.
[0097] In S3208, the accessory control unit 201 determines whether or not one byte of data was successfully received. If the accessory control unit 201 determines that one byte of data was successfully received (Yes in S3208), the process proceeds to S3210, and if the accessory control unit 201 determines that one byte of data was not successfully received (No in S3208), the process proceeds to S3221.
[0098] In S3210, the accessory control unit 201 controls SDA to a Low level for the next SCL clock output after receiving one byte of data, thereby sending a data reception notification (ACK) to the camera control unit A101.
[0099] In S3211, the accessory control unit 201 determines whether or not SDA has changed to a low level while SCL is at a high level (a START condition has been reached). If the accessory control unit 201 detects a START condition, it determines that the next 1-byte of data to be communicated is data to be transmitted from the camera control unit A101 to the accessory control unit 201, and is data indicating a slave address and a communication type. On the other hand, if the accessory control unit 201 does not detect a START condition, it determines that the next 1-byte of data to be communicated is data information to be received by the accessory control unit 201 from the camera control unit A101. If the accessory control unit 201 determines that a START condition has been detected (Yes in S3211), it proceeds to S3212, and if it determines that a START condition has not been detected (No in S3211), it proceeds to S3216.
[0100] In S3212, the accessory control unit 201 receives one byte of data transmitted from the camera control unit A101. In S3213, the accessory control unit 201 determines whether the most significant seven bits of the one byte of data received in S3212 match the slave address of the accessory control unit 201 (0x50 in this embodiment). If the accessory control unit 201 determines that the most significant seven bits of the data match the slave address of the accessory control unit 201 (Yes in S3212), the process proceeds to S3214. If the accessory control unit 201 determines that the most significant seven bits of the data do not match the slave address of the accessory control unit 201 (No in S3212), the process proceeds to S3221.
[0101] In S3214, the accessory control unit 201 determines the type of data for the next 1-byte communication based on the data of the lowest 1 bit of the 1-byte data received in S3203. If the data of the lowest 1 bit is 1, the accessory control unit 201 determines that the data for the next 1-byte communication is a read of transmission data from the accessory control unit 201 to the camera control unit A101 (Yes in S3214), and proceeds to S3215. On the other hand, if the data of the lowest 1 bit is 0 (No in S3214), the accessory control unit 201 proceeds to S3221.
[0102] In S3215, the accessory control unit 201 controls SDA to be at the Lo level for the next SCL clock output after receiving one byte, thereby sending a data reception notification (ACK) to the camera control unit A101.
[0103] In S3221, the accessory control unit 201 controls SDA to Hi level to notify the camera control unit A101 that data communication is complete (NACK), and then proceeds to S3225. In S3222, the accessory control unit 201 transmits to the camera control unit A101 one byte of data corresponding to the start address information received from the camera control unit A101 in S3207 or the start address information set in S3209.
[0104] In S3223, the accessory control unit 201 adds 1 to the variable ME. Subsequently, in S3224, the accessory control unit 201 checks the signal level of SDA after transmitting one byte of data. If the signal level of SDA is Hi, the accessory control unit 201 determines that this is a notification (NACK) that the camera control unit A101 has completed receiving all data (Yes in S3224), and proceeds to S3225. On the other hand, if the signal level of SDA is Hi, the accessory control unit 201 determines that the camera control unit A101 is still requesting data transmission from the accessory control unit 201 (No in S3224), and returns the process to S3222.
[0105] In this way, after returning the process to S3222, the accessory control unit 201 sequentially increments the address of the data to be transmitted and transmits one byte of data corresponding to each address. By repeatedly transmitting one byte of data in this way until a NACK is notified from the camera control unit A101 in S3224, the accessory control unit 201 transmits NE bytes of data to the camera control unit A101.
[0106] In S3225, the accessory control unit 201 determines whether or not SDA has changed to Hi level (a STOP condition has been reached) while SCL is at Hi level. The accessory control unit 201 repeats the determination until a STOP condition is reached (No in S3225), and when it determines that a STOP condition has been reached (Yes in S3225), it ends this processing.
[0107] After the determination in S3211 is No, in S3216 the accessory control unit 201 receives one byte of data. This one byte of data is stored in a non-volatile memory (not shown) or used for predetermined processing as data corresponding to the start address information received from the camera control unit A101 in S3207.
[0108] In S3217, the accessory control unit 201 adds 1 to the variable ME. Subsequently, in S3218, the accessory control unit 201 determines whether or not 1 byte of data was successfully received. If the accessory control unit 201 determines that 1 byte of data was successfully received (Yes in S3218), the process proceeds to S3219, and if it determines that 1 byte of data was not successfully received (No in S3218), the process proceeds to S3221.
[0109] In S3219, the accessory control unit 201 sends a data reception notification (ACK) to the camera control unit A101 by controlling SDA to low level for the next SCL clock output after receiving one byte. In S3220, the accessory control unit 201 determines whether SDA has changed to high level (a stop condition has occurred) while SCL was high level. If the accessory control unit 201 determines that a stop condition has been detected (Yes in S3220), it ends this processing. On the other hand, if the accessory control unit 201 does not detect a stop condition (No in S3220), it determines that the camera control unit A101 will continue to send data to the accessory control unit 201, and returns the processing to S3216.
[0110] In this way, the accessory control unit 201 returns the process to S3216, then sequentially increments the address of the data to be received, and receives one byte of data corresponding to each address. By repeatedly receiving one byte of data in this way until a STOP condition is notified in S3220, the accessory control unit 201 receives NE bytes of data from the camera control unit A101.
[0111] The FNC1 signal, FNC2 signal, FNC3 signal, and FNC4 signal connected to contacts TC14, TC15, TC16, and TC17, respectively, are signals (functional signals) whose functions can be changed according to the type of accessory 200. For example, if accessory 200 is a microphone device, the signal communicated via TC15 will be an audio data signal. If accessory 200 is a lighting device (strobe device), the signal communicated via TC14 will be a signal notifying the timing of light emission.
[0112] Note that signals realizing different functions may be communicated via the same contact depending on the type of attached accessory. For example, if accessory 200 is an accessory other than lighting, a synchronization signal for controlling timing different from light emission timing may be communicated via TC14. TC14 to TC17 correspond to function signal contacts. Communication using at least one of the function signal contacts is also referred to as function signal communication.
[0113] Functional signal communication can be performed in parallel with I2C communication or SPI communication at a timing that is independent of I2C communication or SPI communication.
[0114] The accessory types referred to here include the microphone devices, lighting devices, etc. described above. Accessories that achieve the same purpose, such as lighting devices with different performance capabilities, are considered to be of the same type. Accessories that achieve different purpose, such as microphone devices and lighting devices, are considered to be of different types.
[0115] Functional signal communication is performed based on information obtained through I2C or SPI communication.
[0116] Contact TC18, which serves as a second ground contact, is connected to GND and, like contact TC04, which serves as the first ground contact, serves as the reference potential for camera 100 and accessory 200. Contacts TC19 and TC20 are connected to camera control unit B102, with differential signal D2N connected to contact TC19 and differential signal D2P 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 form a pair to perform data communication.
[0117] The contact TC21 as a fourth ground contact is connected to GND and serves not only as a reference potential contact but also as a contact for controlling the wiring impedance of the differential signals D2N and D2P.
[0118] The contacts TC01, TC04, TC06, TC18, and TC21 are connected to, for example, a GND portion of a flexible substrate, and the GND portion of the flexible substrate is fixed with screws or the like to a metallic member that serves as the GND level of the camera 100. The metallic member that serves as the GND level is, for example, an engaging member that engages with the accessory 200 in the accessory shoe portion, or a base plate (not shown) inside the camera 100.
[0119] In this embodiment, the attachment detection contact TC06, to which the accessory attachment detection signal / ACC_DET is connected, is located next to the contact (first clock contact) TC07 that transmits the clock signal SCLK (first clock signal). Generally, noise (clock noise) caused by potential fluctuations in the clock signal is transmitted to contacts adjacent to the clock signal contact, which can cause malfunction. This effect is particularly significant in a configuration with a large number of contacts and a short distance between the contacts, as in this embodiment. Therefore, by locating the attachment detection contact TC06 next to the SCLK contact TC07, the effect of clock noise is suppressed.
[0120] The accessory attachment detection signal / ACC_DET is pulled up before the accessory is attached, but is set to GND potential after the accessory is attached. Meanwhile, the SCLK contact TC07, which transmits the clock signal, does not transmit the clock signal before the accessory is attached, so its potential does not fluctuate. It transmits the clock signal only after the accessory is attached, so its potential fluctuates. When the SCLK contact TC07 transmits the clock signal, the attachment detection contact TC06 is at GND potential. Therefore, even if the attachment detection contact TC06 is subject to clock noise, the potential of the control circuits of the camera 100 and accessory 200 is less likely to fluctuate, preventing malfunctions. Furthermore, clock noise can be prevented from propagating to locations farther away than the attachment detection contact TC06. This eliminates the need for a GND terminal, making it possible to suppress the effects of clock noise without increasing the number of contacts.
[0121] The SCL (second clock signal) is also transmitted as a clock signal to the contact (second clock contact) TC13. However, the SCLK transmitted to the SCLK contact TC07 has a higher frequency than SCL, and more clock noise is generated from the SCLK contact TC07 than from the SCL contact TC13. For this reason, placing the attachment detection contact TC06 next to the SCLK contact TC07 rather than next to the SCL contact TC13 is more effective in preventing malfunctions due to clock noise.
[0122] In addition to the difference in frequency, the SCL transmitted through the SCL contact TC13 is a clock signal conforming to the I2C communication standard, and voltage fluctuations on the signal line are driven by an open-drain connection. On the other hand, the SCLK transmitted through the SCLK contact TC07 is a clock signal conforming to the SPI communication standard, and voltage fluctuations on the signal line are driven by a CMOS output. For this reason, the voltage fluctuation edges of the SCL contact TC13 tend to be gentler than those of the SCLK contact TC07, making it less likely to generate clock noise. Therefore, placing the attachment detection contact TC06 next to the SCLK contact TC07 rather than next to the SCL contact TC13 is more effective in preventing malfunctions caused by clock noise.
[0123] Furthermore, differential signals D1N and D1P may also be transmitted in pairs to the first and second differential signal contacts TC19 and TC20 to transmit clock signals. In this case, a clock signal (third clock signal) with a higher frequency than the SCLK contact TC07 and SCL contact TC13 may be transmitted. However, because the differential signals D1N and D1P are paired signals, they emit less clock noise than the SCLK contact TC07 and SCL contact TC13, which transmit single-ended signals. For this reason, placing the attachment detection contact TC06 next to the SCLK contact TC07 rather than next to the first and second differential signal contacts TC19 and TC20 is more effective in preventing malfunctions due to clock noise.
[0124] The contact (first data contact) TC08, located next to the SCLK contact TC07 on the opposite side of the attachment detection contact TC06, transmits MOSI (first data signal). Because MOSI is a data signal, it appears to be susceptible to clock noise. However, because MOSI is a data signal that conforms to the same SPI communication standard as the clock signal transmitted by the SCLK contact TC07, the timing of the potential fluctuation is synchronized with the clock signal and is therefore less susceptible to clock noise. Therefore, contact TC08 does not need to be fixed to GND potential and can be used as the MOSI contact.
[0125] Next, a description will be given of the electrical configuration of the accessory 200 shown in Fig. 1. The accessory 200 has an accessory control unit 201, an accessory power supply unit 202, a power switch 203, a charging unit 204, a battery 205, a function unit 206, a differential communication unit 207, an external communication IF unit 208, an external connection terminal 209, and a connection detection unit 210. The accessory 200 also has an accessory connection unit 211 and an operation switch 212.
[0126] The accessory control unit 201 is a circuit (control means) that controls the overall operation of the accessory 200, and is configured by a microcomputer with a built-in CPU, etc. The battery 205 supplies power to each unit of the accessory 200. The accessory 200 also receives power from the camera 100 via the camera connection unit 141 and the accessory connection unit 211.
[0127] The accessory power supply unit 202 is composed of a DC-DC converter circuit, an LDO, a charge pump circuit, etc., and generates power to be supplied to each unit of the accessory 200. The accessory control unit 201 is constantly supplied with a voltage of 1.8V generated by the accessory power supply unit 202 as the accessory microcomputer power supply VMCU_A. Note that the voltage generated by the accessory power supply unit 202 may be a value other than 1.8V. The accessory control unit 201 controls the accessory power supply unit 202 to turn on / off the power supply to each unit of the accessory 200.
[0128] The charging unit 204 charges the battery 205 using power supplied from the camera 100. When the accessory control unit 201 determines that sufficient power for the charging operation is being supplied from the camera 100, it controls the charging unit 204 to charge the battery 205. Note that, although the present embodiment deals with a configuration in which the battery 205 can be attached as the accessory 200, the accessory 200 may be one that does not have the battery 205 attached and operates only with power supplied from the camera 100, in which case the charging unit 204 is not necessary.
[0129] The differential communication unit 207 is a circuit for performing differential communication with the camera 100, and can transmit and receive data to and from the camera 100. The external communication IF unit 208 is an interface circuit for performing data communication with an external device (not shown), and is an Ethernet communication IF, a wireless LAN communication IF, a public network communication IF, or the like. The accessory control unit 201 controls the differential communication unit 207 and the external communication IF unit 208 to transmit data received from the camera 100 to the external device, and conversely, to transmit data received from the external device to the camera 100.
[0130] The functional unit 206 has different functions depending on the type of accessory 200. For example, if the accessory 200 is a strobe device, the functional unit 206 is composed of a light emission circuit, a charging circuit, etc. If the accessory 200 is a microphone device, the functional unit 206 is composed of an audio codec circuit, a microphone circuit, etc.
[0131] The external connection terminal 209 is a connector terminal for connecting to an external device, and in this embodiment is a USB TYPE-C connector. The connection detection unit 210 is a circuit that detects that an external device has been connected to the external connection terminal 209. The accessory control unit 201 receives an output signal from the connection detection unit 210 to detect the connection of an external device to the external connection terminal 209.
[0132] The power switch 203 is a switch that turns on / off the main power supply of the accessory 200. The accessory control unit 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 a switch that operates the accessory 200, and is composed of a button, a cross key, a slide switch, a dial switch, or the like. The accessory control unit 201 detects that the operation switch 212 has been operated, and executes a predetermined process according to the detection result.
[0133] The accessory connection unit 211 is a connector for making an electrical connection with the camera 100 via 21 contacts TA01 to TA21 arranged in a row. The contacts TA01 to TA21 are arranged in this order in a row from one end to the other.
[0134] Contact TA01, which serves as a third ground contact of accessory connection unit 211, is connected to GND and serves not only as a reference potential contact but also as a contact for controlling the wiring impedance of differential signals D1N and D1P. Contacts TA02 and TA03 are connected to differential communication unit 207, with differential signal D1N connected to contact TA02 and differential signal D1P connected to contact TA03. Differential signals D1N and D1P are differential data communication signals that form a pair to perform data communication. Contacts TA02, TA03, TA07-TA07, TA09, and TA010 are communication contacts.
[0135] Contact TA04, which serves as a first ground contact, is connected to GND and serves as a reference potential contact for camera 100 and accessory 200. Accessory power supply unit 202 and charging unit 204 are connected to contact TA05, which serves as a power contact, and is connected to accessory power VACC supplied from camera 100. Contact TA04 is arranged further outward than contact TA05 in the arrangement direction of the contacts.
[0136] Contact TA06, which serves as an attachment detection contact, is connected directly to GND so that the accessory attachment detection signal / ACC_DET is set to the GND level (ground potential) as a Lo level when the accessory 200 is attached to the camera 100. This enables the camera 100 to detect the attachment of the accessory 200. SCLK connected to contact TA07, MOSI connected to contact TA08, MISO connected to contact TA09, and CS connected to contact TA10 are signals for the accessory control unit 201 to function as a communication slave and perform SPI communication.
[0137] A communication request signal / WAKE is connected to the contact TA11, which is used by the accessory control unit 201 to request communication from the camera 100. When the accessory control unit 201 determines that communication with the camera 100 (camera control unit A101) is necessary, it outputs the communication request signal / WAKE at Lo level to make a communication request to the camera 100.
[0138] In response to detecting that the accessory 200 is in the attached state, the camera control unit A101 supplies power to the accessory 200 via the TC5. Then, the accessory control unit 201 notifies the camera control unit A101 that it has received power supply by changing the signal level (electric potential) of the communication request signal / WAKE from Hi level to Lo level.
[0139] The accessory control unit 201 can notify the camera 100 that a cause for the accessory 200 to communicate with the camera 100 has occurred by changing the signal level (electric potential) of the communication request signal / WAKE from Hi level to Lo level even without a request from the camera 100. With this configuration, the camera control unit A101 can omit the operation of periodically checking whether a cause for communication has occurred by polling the accessory 200. Furthermore, when a cause for communication has occurred, the accessory 200 can notify the camera 100 of that fact in real time.
[0140] SDA connected to the contact TA12 and SCL connected to the contact TA13 are signals for the accessory control unit 201 to perform I2C communication as a communication slave.
[0141] The FNC1 signal, FNC2 signal, FNC3 signal, and FNC4 signal connected to contact TA14, contact TA15, contact TA16, and contact TA17, respectively, are signals (function signals) whose functions can be changed according to the type of accessory 200. For example, these function signals become audio data signals when accessory 200 is a microphone device, and become signals notifying the timing of light emission when accessory 200 is a lighting device (strobe device).
[0142] Contact TA18, which serves as a second ground contact, is connected to GND and, like contact TA04, which serves as the first ground contact, serves as the reference potential for camera 100 and accessory 200. Contacts TA19 and TA20 are connected to external connection terminal 209, with differential signal D2N connected to contact TA19 and differential signal D2P connected to contact TA20. Differential signals D2N and D2P are data communication signals that form a pair to perform data communication. Contact TA21, which serves as a fourth ground contact, is connected to GND.
[0143] The contacts TA01, TA04, TA06, TA18, and TA21 are connected to, for example, a GND portion of a flexible substrate, and the GND portion of the flexible substrate is fixed with a metal member that serves as the GND level of the accessory 200 using a screw or the like (not shown). The metal member that serves as the GND level is, for example, a shoe mounting leg that engages with the accessory shoe portion of the camera 100, a base plate (not shown) inside the accessory 200, or the like.
[0144] Next, an overview of the processing that is executed when accessory 200 is attached to camera 100 will be described with reference to Fig. 7. Fig. 7 is a sequence diagram showing an example of the processing that is executed when accessory 200 is attached to camera 100.
[0145] When the accessory 200 is attached to the camera 100, the accessory attachment detection signal / ACC_DET becomes GND level, which causes the camera control unit A101 to determine that the accessory 200 is attached to the camera 100. When the camera control unit A101 determines that the accessory 200 is attached, it sets the power supply control signal CNT_VACC1 to Hi level to turn on the output of the accessory power supply unit A131. In response to the power supply control signal CNT_VACC1 becoming Hi level, the accessory power supply unit A131 outputs the accessory power supply VACC to the accessory 200.
[0146] In the accessory 200, when the accessory power supply unit 202 receives the accessory power supply VACC, it generates a power supply VMCU_A for operating the accessory control unit 201, and the accessory control unit 201 receives the power supply VMCU_A and starts up. After starting up, the accessory control unit 201 initializes each block in the accessory 200. Thereafter, when communication with the camera 100 becomes possible, the communication request signal / WAKE (contact TA11) is set to Lo level.
[0147] When the camera control unit A101 in the camera 100 detects that the communication request signal / WAKE (TC11) has become Lo level, it determines that communication with the accessory 200 has been established. Then, the camera control unit A101 requests the accessory 200 (accessory control unit 201) to transmit accessory information via I2C communication.
[0148] FIG. 6 is a diagram showing an example of accessory information that the accessory 200 holds in a non-volatile memory (not shown) of the accessory control unit 201. The accessory information is information that allows the camera 100 to identify the type of accessory 200 and specifications related to communication and operation (function). The accessory information is mapped to a memory space of addresses 0x00 to 0x0F (hereinafter, the "address" will be omitted, such as "address 0x0F"). The camera control unit B102 can read the accessory information from the accessory 200 via I2C communication instead of the accessory control unit 201. In the I2C communication of this embodiment, a checksum for the read data is added as the final data of the I2C communication. Details of the accessory information will be described later.
[0149] In the accessory 200, the accessory control unit 201 transmits the accessory information it holds to the camera control unit A101 in response to a request for accessory information from the camera 100. After transmitting the accessory information to the camera control unit A101, the accessory control unit 201 sets the communication request signal / WAKE to Hi level. In the camera 100, the camera control unit A101 determines whether or not it is possible to control the accessory 200 based on the received accessory information. In addition, the camera control unit A101 turns on the accessory power supply unit B132.
[0150] When the camera control unit A101 completes various settings of the camera 100, it notifies the camera control unit B102 of the accessory information. Based on the accessory information, the camera control unit B102 notifies the accessory 200 of control commands and controls function signals via SPI communication. The accessory control unit 201 performs control in accordance with the control commands and function signals from the camera 100 via SPI communication.
[0151] Next, the accessory information (FIG. 6) held by the accessory 200 will be described. Data D7 to D0 at address 0x00 is information indicating the type of accessory (hereinafter referred to as "accessory type information"). FIG. 8 is a diagram showing an example of accessory type information. For example, number 0x81 indicates that it is a strobe device, and number 0x82 indicates that it is an interface conversion adapter device. Furthermore, number 0x83 indicates that it is a microphone device, and number 0x84 indicates that it is a multi-accessory connection adapter device for attaching multiple accessory devices to the camera 100.
[0152] Here, the adapter device is an intermediate accessory attached between the camera 100 and an accessory such as a flash device or microphone device. The interface conversion adapter device is an adapter device that converts the interface to make the camera 100 and the accessory compatible when the interface of the camera 100 and the interface of the accessory are different. The multi-accessory connection adapter device is an adapter device that can attach multiple accessories.
[0153] The data D7 to D0 at address 0x01 is information indicating the model number (identification number) of the accessory 200. This information, together with the accessory type information, allows the accessory 200 to be uniquely identified. The data D7 to D0 at address 0x02 is information indicating the firmware version of the accessory 200. Note that "ACC" in the columns for addresses 0x01 and 0x02 in FIG. 6 is used here as an abbreviation for "accessory."
[0154] The data D7 to D6 at address 0x03 is information indicating whether or not to request the supply of accessory power VACC to the accessory 200 when the power of the camera 100 is off. The value of this information is '0 (zero)' if power supply is not required, '1' if power supply from the accessory power supply unit A131 is requested, and '2' if power supply from the accessory power supply unit B132 is requested.
[0155] The data D5 to D4 at address 0x03 is information indicating whether or not to request the supply of accessory power VACC to the accessory 200 when the camera 100 is in a power saving mode state due to an auto power off function or the like. The value of this information is '0' when no power supply is required, '1' when power supply from the accessory power supply unit A131 is requested, and '2' when power supply from the accessory power supply unit B132 is requested.
[0156] The D3 to D2 data at address 0x03 is information indicating whether or not the accessory 200 is equipped with a battery 205. The value of this information is '0' if the accessory is not equipped with a battery 205, and '1' if the accessory is equipped with a battery 205. The D1 to D0 data at address 0x03 is information indicating whether or not the accessory 200 is equipped with a charging function for the battery 205. The value of this information is '0' if the accessory is not equipped with a charging function, and '1' if the accessory is equipped with a charging function.
[0157] The data D7 to D0 at address 0x04 is information indicating the power required for the accessory power supply VACC to which the accessory 200 is supplied by the camera 100. For example, the current value indicated is 10 times the value of this information. For example, a value of '10' indicates a current value of 100 mA, and a value of '100' indicates a current value of 1 A.
[0158] To reduce the amount of information, this information may be associated with a predetermined current value. For example, the value of this information may be set to '0' when 100 mA is requested, '1' when 300 mA is requested, '3' when 450 mA is requested, and '4' when 600 mA is requested.
[0159] D7 data at address 0x05 is information indicating whether the accessory 200 is in firmware update mode. The value of this information is '0' if the accessory is not in firmware update mode, and '1' if the accessory is in firmware update mode. D6 data at address 0x05 is information indicating whether the accessory 200 has a firmware update function. The value of this information is '0' if the accessory is not in firmware update mode, and '1' if the accessory is in firmware update mode.
[0160] The D5 to D4 data at address 0x05 is information indicating whether or not operation is permitted when the accessory 200 is attached to the camera 100 via an intermediate connection accessory. The value of this information is '0' if the operation is not permitted, and '1' if the operation is permitted. The D3 to D2 data at address 0x05 is information indicating whether or not the accessory 200 needs to check the attachment status of the intermediate connection accessory when the camera 100 starts up. The value of this information is '0' if check is not required, and '1' if check is required. The D1 to D0 data at address 0x05 is information indicating whether or not the accessory 200 supports command notification via I2C communication. The value of this information is '0' if the accessory does not support command notification, and '1' if the accessory supports command notification.
[0161] The data D5 to D4 at address 0x06 is information indicating a communication method that can notify the camera 100 of the cause of the communication request after the accessory 200 has notified the camera 100 of the communication request signal / WAKE. The value of this information is '0' if I2C communication is supported, '1' if SPI communication is supported, and '2' if both I2C communication and SPI communication are supported.
[0162] The D3 to D0 data at address 0x06 is information indicating whether the accessory 200 has a communication function using the function signals FNC1 signal, FNC2 signal, FNC3 signal, and FNC4 signal. The D0 data corresponds to the FNC1 signal, the D1 data to the FNC2 signal, the D2 data to the FNC3 signal, and the D3 data to the FNC4 signal, and the value of this information is '0' if the accessory does not have a communication function, and '1' if the accessory has a communication function.
[0163] The D7 data at address 0x0A is information indicating whether or not to request startup of the camera 100 when the accessory 200 notifies the camera 100 of the communication request signal / WAKE. The value of this information is '0' when startup is requested, and '1' when startup is not requested.
[0164] The data D6 to D0 at address 0x0A is information indicating the cause of the communication request signal / WAKE notified by the accessory 200 to the camera 100. FIG. 9 is a diagram showing an example of the cause of the communication request signal / WAKE. FIG. 9 illustrates an example of the cause of the communication request signal / WAKE when the accessory 200 is a microphone device, and cause number 0x00 is a number indicating that the menu call switch of the operation switches 212 has been pressed. Also, cause number 0x01 is a number indicating that the accessory 200 has completed output control of the audio signal, and cause number 0x02 is a number indicating that the accessory 200 has completed muting the audio signal. In this way, information regarding the cause of the communication request signal / WAKE can be notified to the camera 100.
[0165] The D1 data at address 0x0C is information indicating the SPI communication protocol supported by the accessory 200. The value of this information is '0' if SPI protocol A is supported, and '1' if SPI protocol B is supported. The D0 data at address 0x0C is information indicating the control logic of the CS signal of the SPI communication supported by the accessory 200. The value of this information is '0' if the CS signal is Lo active logic, and '1' if the CS signal is Hi active logic.
[0166] The data D7 to D0 at address 0x0D is information indicating the time required for a communication byte interval when the accessory 200 communicates using SPI protocol A and is not in firmware update mode (the data D7 at address 0x05 is 0). An example of the time required for a communication byte interval for the data at address 0x0D is shown in FIG. 10(a). The data D7 to D0 at address 0x0E is information indicating the time required for a communication byte interval when the accessory 200 communicates using SPI protocol A and is in firmware update mode (the data D7 at address 0x05 is 1). An example of the time required for a communication byte interval for the data at address 0x0E is shown in FIG. 10(b).
[0167] 11 is a flowchart illustrating the processing by the camera control unit A101 from when the accessory 200 is attached to the camera 100 until the functions of the accessory 200 are enabled. Each processing (step) indicated by an S number in the flowchart in FIG. 11 is realized by the CPU of the camera control unit A101 expanding a program stored in the ROM of the camera control unit A101 into the RAM of the camera control unit A101.
[0168] In S401, the camera control unit A101 monitors the signal level of the accessory attachment detection signal / ACC_DET and determines whether the accessory 200 is attached. Specifically, the camera control unit A101 determines whether the accessory attachment detection signal / ACC_DET is at Lo level or Hi level, and determines that the accessory 200 is attached if it is at Lo level, and determines that the accessory 200 is not attached if it is at Hi level. If the camera control unit A101 determines that / ACC_DET is at Hi level (No in S401), it repeats the determination of S401, and if it determines that / ACC_DET is at Lo level (Yes in S401), it proceeds to S402.
[0169] In S402, the camera control unit A101 controls the power supply control signal CNT_VACC1 to Hi level in order to turn on the output of the accessory power supply unit A131. When the power supply control signal CNT_VACC1 becomes Hi, the accessory power supply unit A131 outputs the accessory power supply VACC.
[0170] In S403, the camera control unit A101 monitors the signal level of the overcurrent detection signal DET_OVC and determines whether an overcurrent is flowing. Specifically, the camera control unit A101 determines that an overcurrent is not flowing when the overcurrent detection signal DET_OVC is at Lo level, and determines that an overcurrent is flowing when the overcurrent detection signal DET_OVC is at Hi level. If the camera control unit A101 determines that DET_OVC is at Lo level (Yes in S403), it proceeds to S404, and if it determines that DET_OVC is at Hi level (No in S403), it ends this process and performs error processing.
[0171] In S404, the camera control unit A101 monitors the signal level of the communication request signal / WAKE transmitted from the accessory 200, and detects whether initialization of the accessory 200 is complete. Specifically, the camera control unit A101 determines that initialization of the accessory 200 is complete when the communication request signal / WAKE is at Lo level, and determines that initialization of the accessory 200 is not complete when the communication request signal / WAKE is at Hi level. If the camera control unit A101 determines that / WAKE is at Hi level (No in S404), it repeats the determination of S404, and if it determines that / WAKE is at Lo level (YES in S404), it proceeds to S405.
[0172] In S405, the camera control unit A101 performs I2C communication with the accessory 200 and reads 15 bytes of accessory information. In S406, the camera control unit A101 determines whether the attached accessory 200 is a device compatible with the camera 100 (hereinafter referred to as a "camera-compatible accessory") based on the accessory information read in S405. If the camera control unit A101 determines that the accessory is not a camera-compatible accessory (No in S406), it ends this processing and performs error processing, and if it determines that the accessory is a camera-compatible accessory (Yes in S406), it proceeds to S407.
[0173] In S407, the camera control unit A101 controls the power supply control signal CNT_VACC2 to Hi level in order to turn on the output of the accessory power supply unit B132. When the power supply control signal CNT_VACC2 becomes Hi level, the accessory power supply unit B132 outputs the accessory power supply VACC. Note that in this embodiment, when both the power supply control signal CNT_VACC1 and the power supply control signal CNT_VACC2 are controlled to Hi level, the output from the accessory power supply unit B132 is output to the accessory power supply VACC. In S408, the camera control unit A101 notifies the camera control unit B102 of the accessory information read out in S405, thereby ending this processing.
[0174] Fig. 12 is a flowchart illustrating the processing by the camera control unit B102 up to enabling the function of the accessory 200 attached to the camera 100. Each processing (step) indicated by an S number in the flowchart of Fig. 12 is realized by the CPU of the camera control unit B102 expanding a program stored in the ROM of the camera control unit B102 into the RAM of the camera control unit B102.
[0175] In S501, the camera control unit B102 determines whether or not accessory information has been notified from the camera control unit A101. If the camera control unit B102 determines that accessory information has not been notified (No in S501), it repeats the determination of S501, and if it determines that accessory information has been notified (Yes in S501), it proceeds to S502.
[0176] In S502, the camera control unit B102 sets the function signals FNC1 to FNC4 based on the accessory information notified from the camera control unit A101. For example, if it is notified that the accessory 200 is a microphone device, the audio data clock signal BCLK is set to FNC1, the audio data channel signal LRCLK is set to FNC2, and the audio data signal SDATA is set to FNC3. As another example, if it is notified that the accessory 200 is a strobe device, the strobe light emission synchronization signal XOUT is set to FNC4. Note that even for function signals that do not require control for the accessory 200, predetermined settings are made so as not to impede the operation of the camera 100 and the accessory 200.
[0177] In S503, the camera control unit B102 sets the control logic of the SPI communication CS signal based on the accessory information notified from the camera control unit A101. In S504, the camera control unit B102 determines whether a predetermined event has occurred for the accessory 200. If the camera control unit B102 determines that an event has not occurred (No in S504), it repeats the determination of S504, and if it determines that an event has occurred (Yes in S504), it proceeds to S505.
[0178] In S505, the camera control unit B102 determines whether or not the event detected in S504 is an event that requires SPI communication with the accessory 200. If the camera control unit B102 determines that the event requires SPI communication (Yes in S505), the process proceeds to S506, and if the camera control unit B102 determines that the event does not require SPI communication (No in S505), the process proceeds to S507.
[0179] In S506, the camera control unit B102 performs SPI communication with the accessory 200. For example, when the accessory 200 is a microphone device, SPI communication can include instruction communications such as switching the microphone operation on / off, switching the microphone's sound collection directionality, and switching the microphone's equalizer function. Furthermore, when the accessory 200 is a flash device, SPI communication can include communications to read setting information of the flash device and communications to notify the flash device of setting information. After S506, the camera control unit B102 returns the process to S504.
[0180] In S507, the camera control unit B102 determines whether or not the event detected in S504 is an event that requires control using a function signal between the camera control unit B102 and the accessory 200. If the camera control unit B102 determines that the event requires control using a function signal (Yes in S507), the process proceeds to S508, and if the camera control unit B102 determines that the event does not require control using a function signal (No in S507), the process proceeds to S509.
[0181] In S508, the camera control unit B102 controls the accessory 200 using the function signal. If the accessory 200 is a microphone device, the control executed in S508 includes control to start outputting the audio data clock signal BCLK of FNC1 and the audio data channel signal LRCLK of FNC2, as well as control to capture the audio data signal SDATA of FNC3. This enables the camera 100 to acquire audio data from the accessory 200. If the accessory 200 is a strobe device, the control executed in S508 includes control to control the strobe light emission synchronization signal XOUT of FNC4 at a predetermined timing. This enables the camera 100 to issue a light emission instruction to the strobe device. After S508, the camera control unit B102 returns the process to S504.
[0182] In S509, the camera control unit B102 performs predetermined in-camera control in response to the event detected in S504. Examples of in-camera control when the accessory 200 is a microphone device include control of starting / ending recording of audio data to the recording memory 126 and control of equalizer processing on the audio data. Examples of in-camera control when the accessory 200 is a strobe device include control of metering light by the image sensor 122 by emitting light from the strobe device and calculation control of the light emission intensity instruction value of the strobe device. After S509, the camera control unit B102 returns the process to S504.
[0183] 11 and 12, the camera 100 is able to control the accessory 200 attached to the camera 100. Note that although the details of the processing by the camera control unit B102 are as described above, the flowchart in Fig. 12 does not include an end process. The series of processes shown in the flowchart in Fig. 12 ends, for example, when an operation is performed on the camera 100 to stop use of the accessory 200, or an operation is performed to turn off the power of the camera 100 or the accessory 200 while the determination in S504 is being repeated.
[0184] 13 is a flowchart illustrating the processing by the accessory control unit 201 from when the accessory 200 is attached to the camera 100 until the functions of the accessory 200 are activated. Each processing (step) indicated by an S number in the flowchart of FIG. 13 is realized by the CPU of the accessory control unit 201 expanding a program stored in the ROM of the accessory control unit 201 into the RAM of the accessory control unit 201.
[0185] In S601, the accessory control unit 201 determines whether or not the supply of the accessory power supply VACC from the camera 100 has started (whether or not the accessory power supply VACC has been turned on). Here, if the accessory 200 does not include a battery 205, power is supplied to the accessory control unit 201, and the accessory control unit 201 itself starts operating, causing the accessory control unit 201 to determine that the accessory power supply VACC has been turned on. On the other hand, if the accessory 200 includes a battery 205, the accessory control unit 201 can detect that the supply of the accessory power supply VACC has started by monitoring the voltage value of the accessory power supply VACC. If the accessory control unit 201 determines that the accessory power supply VACC is not turned on (No in S601), it repeats the determination in S601, and if it determines that the accessory power supply VACC is turned on (Yes in S601), it proceeds to S602.
[0186] In S602, the accessory control unit 201 performs initial settings. For example, these settings include setting the operating frequency of the accessory control unit 201 itself, setting the input / output control ports of the microcomputer, initializing the timer function of the microcomputer, and initializing the interrupt function of the microcomputer. In S603, the accessory control unit 201 controls the communication request signal / WAKE to low level. This causes the accessory control unit 201 to notify the camera 100 that the initial settings in the accessory 200 have been completed. In S604, the accessory control unit 201 responds to the I2C communication from the camera 100 and transmits 15 bytes of accessory information. The accessory information includes various pieces of information shown in FIG. 6. In S605, the accessory control unit 201 controls the communication request signal / WAKE to high level.
[0187] In S606, the accessory control unit 201 determines whether a predetermined event has occurred. If the accessory control unit 201 determines that an event has not occurred (No in S606), it repeats the determination in S606, and if it determines that an event has occurred (Yes in S606), it proceeds to S607.
[0188] In S607, the accessory control unit 201 determines whether the event that has occurred is an event that requires SPI communication with the camera 100. If the accessory control unit 201 determines that the event requires SPI communication (Yes in S607), the process proceeds to S608, and if the accessory control unit 201 determines that the event does not require SPI communication (No in S607), the process proceeds to S609.
[0189] In S608, the accessory control unit 201 performs SPI communication with the camera 100. If the communication request signal / WAKE is at Lo level when the SPI communication is being performed, the accessory control unit 201 switches the communication request signal / WAKE to Hi level after the SPI communication. Examples of SPI communication performed when the accessory 200 is a microphone device include instruction communications such as switching the microphone operation on / off, switching the microphone sound collection directionality, and switching the microphone equalizer function. Examples of SPI communication performed when the accessory 200 is a flash device include communications to read setting information of the flash device and communications to notify the flash device of setting information. After S608, the accessory control unit 201 returns the process to S606.
[0190] In S609, the accessory control unit 201 determines whether the event that has occurred is an event that requires I2C communication with the camera 100. If the accessory control unit 201 determines that the event requires I2C communication (Yes in S609), the process proceeds to S610, and if the accessory control unit 201 determines that the event does not require I2C communication (No in S609), the process proceeds to S611.
[0191] In S610, the accessory control unit 201 performs I2C communication with the camera 100. If the communication request signal / WAKE is at Lo level when SPI communication is being performed, the accessory control unit 201 switches the communication request signal / WAKE to Hi level after SPI communication. Examples of the I2C communication performed in S610 include communication to read out the cause of the communication request in response to a communication request signal / WAKE notification sent from the accessory control unit 201 to the camera 100. After S610, the accessory control unit 201 returns the process to S606.
[0192] In S611, the accessory control unit 201 determines whether the occurred event is an event that requires control using a function signal. If the accessory control unit 201 determines that the event requires control using a function signal (Yes in S611), the process proceeds to S612, and if the accessory control unit 201 determines that the event does not require control using a function signal (No in S611), the process proceeds to S613.
[0193] In S612, the accessory control unit 201 controls the camera 100 using the function signal. The control executed in S612 when the accessory 200 is a microphone device includes the following processing. Specifically, the accessory control unit 201 controls reception of the audio data clock signal BCLK of FNC1 and the audio data channel signal LRCLK of FNC2 output from the camera 100. The accessory control unit 201 then controls output of the audio data signal SDATA of FNC3 in synchronization with the received audio data clock signal BCLK and audio data channel signal LRCLK. Furthermore, the control executed in S612 when the accessory 200 is a strobe device includes control of strobe light emission, which is executed upon receiving the strobe light emission synchronization signal XOUT of FNC4. After S612, the accessory control unit 201 returns the process to S606.
[0194] In S613, the accessory control unit 201 determines whether the occurred event is an event that requires notification to the camera 100 by a communication request signal / WAKE. If the accessory control unit 201 determines that the occurred event is an event that requires notification to the camera 100 by a communication request signal / WAKE (Yes in S613), the processing proceeds to S614. On the other hand, if the accessory control unit 201 determines that the occurred event is not an event that requires notification to the camera 100 by a communication request signal / WAKE (No in S613), the processing proceeds to S615.
[0195] In S614, the accessory control unit 201 stores the cause 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 low level. As explained above with reference to Fig. 9, a unique number is assigned to the cause number of the communication request for each cause. After S614, the accessory control unit 201 returns the process to S606.
[0196] In S615, the accessory control unit 201 performs control within the accessory in response to the event that has occurred. Examples of the control within the accessory that is executed in S615 include control of detecting the remaining battery charge when the accessory 200 has a battery 205, and control of detecting the operation switch 212. After S615, the accessory control unit 201 returns the process to S606.
[0197] The processing according to the flowchart of Fig. 13 allows the accessory 200 to perform a predetermined functional operation after being attached to the camera 100. Note that the series of processing shown in the flowchart of Fig. 13 ends, for example, when an operation to stop the use of the accessory 200 or an operation to turn off the power of the camera 100 or the accessory 200 is performed on the camera 100 while the determination of S606 is being repeated.
[0198] First Embodiment Here, a description will be given of a process in which the camera 100 causes the accessory 200 to execute a predetermined command. Unless otherwise specified, control of communication between the camera 100 and the accessory 200 is controlled by the camera control unit B102 and the accessory control unit 201.
[0199] As described above, in S604 of the flowchart in Fig. 13, the accessory control unit 201 responds to the I2C communication (initial communication) from the camera 100 and transmits 15 bytes of accessory information. Here, the accessory information includes various pieces of information as previously shown in Fig. 6, but the accessory 200 according to the first embodiment has the accessory information shown in Fig. 14 instead of the accessory information shown in Fig. 6.
[0200] FIG. 14 is a diagram showing accessory information held by the accessory 200 according to the first embodiment. The accessory information in FIG. 6 and the accessory information in FIG. 14 differ in information at address 0x0F. Address 0x0F of the accessory information in FIG. 14 functions as an address for holding a checksum when transmitting accessory information, but functions as a command receiving address when receiving and executing a command from the camera 100. An I2C command enable / disable flag indicating whether or not to execute a received command or whether or not to send a command is stored in D1-D0 of address 0x05 of the accessory information. If '1 (execute received command)' is stored in D1-D0 of address 0x05, the accessory 200 performs processing corresponding to the command received from the camera 100.
[0201] Command processing in the accessory 200 and camera 100 will be described with reference to Fig. 15. Fig. 15(a) is a flowchart of processing executed when the accessory 200 having the accessory information of Fig. 14 receives a command from the camera 100. Each processing step indicated by an S number in the flowchart of Fig. 15(a) is realized by the CPU of the accessory control unit 201 expanding a predetermined program stored in its own ROM into its own volatile memory.
[0202] In S701, the accessory control unit 201 receives a command from the camera 100. In S702, the accessory control unit 201 determines whether the I2C command possibility flag set in the D1-D0 data of address 0x05 in the accessory information is '1'. Note that an I2C command possibility flag of '1' indicates that the command is to be executed (executable), and an I2C command possibility flag of '0' indicates that the command is not to be executed (executable). If the I2C command possibility flag is '0' (No in S702), the accessory control unit 201 ends this processing, and if the I2C command possibility flag is '1' (Yes in S702), the processing proceeds to S703.
[0203] In S703, the accessory control unit 201 executes the command received in S701. In S704, the accessory control unit 201 determines whether the execution of the command in S703 was successful. If the accessory control unit 201 determines that the execution of the command was successful (Yes in S704), the process proceeds to S705, and if it determines that the execution of the command was not successful (failed) (No in S704), the process proceeds to S706.
[0204] In S705, the accessory control unit 201 transmits a result indicating that the command execution was successful to the camera 100, and then ends this processing. In S706, the accessory control unit 201 transmits a result indicating that the command execution was unsuccessful to the camera 100, and then ends this processing.
[0205] Fig. 15(b) is a flowchart of the processing executed by the camera 100 when sending a command to the accessory 200 having the accessory information of Fig. 14. Each processing (step) indicated by an S number in the flowchart of Fig. 15(b) is realized by the CPU of the camera control unit B102 loading a predetermined program stored in the ROM of the camera control unit B102 into the RAM of the camera control unit B102.
[0206] In S801, the camera control unit B102 determines whether the I2C command permission flag stored in the D1-D0 data at address 0x05 of the accessory information is 1 (command executable). If the I2C command permission flag is '0' (No in S801), the camera control unit B102 ends this processing, and if the I2C command permission flag is '1' (Yes in S801), the processing proceeds to S802.
[0207] In S802, the camera control unit B102 transmits a command to be executed by the accessory 200 to the accessory 200. In S803, the camera control unit B102 receives the command execution results transmitted by the accessory 200 in S705 and S706, and then terminates this processing. Note that if the command execution results received in S803 indicate that execution of the command has failed, the camera control unit B102 performs processing to re-execute the command (command re-transmission processing) or error processing.
[0208] Second Embodiment Here, a description will be given of communication data via I2C communication between the camera 100 and the accessory 200. Unless otherwise specified, control of communication between the camera 100 and the accessory 200 is controlled by the camera control unit B102 and the accessory control unit 201.
[0209] Fig. 16 is a diagram showing an example of communication content when the camera 100 notifies the accessory 200 of a read via I2C communication in the second embodiment. In Fig. 16, the upper row shows a signal transmitted from the camera 100 to the accessory 200, and the lower row shows a signal transmitted from the accessory 200 to the camera 100. In Fig. 16, 'S' indicates a start condition, 'P' indicates a stop condition, 'W' indicates a write notification bit, and 'R' indicates a read notification bit.
[0210] The camera 100 first transmits the read start address 0x00 to the accessory 200. The accessory information is transmitted as 15 bytes of data from the accessory 200 to the camera 100. Specifically, after a read notification bit, the accessory 200 transmits data (DATA0) from address 0x00 in the first byte, data from address 0x01 in the second byte, and so on. The accessory 200 then transmits CheckSumI2C_A, which is the checksum from the accessory 200, as data (DATA14) from address 0x0E in the 15th byte and data from address 0x0F in the 16th byte. In this case, CheckSumI2C_A is calculated by the accessory control unit 201 using the following equation 4.
[0211]
number
[0212] Fig. 17 is a diagram showing an example of communication content when the camera 100 notifies the accessory 200 of a write via I2C communication in the second embodiment. As in Fig. 16, in Fig. 17, the upper row shows a transmission signal from the camera 100, and the lower row shows a transmission signal from the accessory 200. 'S', 'P', 'W', and 'R' in Fig. 17 have the same meanings as those in Fig. 16, respectively.
[0213] The camera 100 transmits the address and data of the data to be written to the accessory 200. Then, after the accessory 200 has completed writing, the accessory 200 transmits a data reception completion notification to the camera 100. Specifically, the camera 100 first transmits to the accessory 200 the address ADDR_I2C of the data to be written, then transmits the data to be written (DATA), and finally transmits CheckSumI2C_C, which is the checksum of the camera 100. Meanwhile, after the read notification bit, the accessory 200 first writes the data (DATA) to the received data address ADDR_I2C. The accessory 200 then transmits the received data (written data) in the first byte as a write completion notification, and finally transmits CheckSumI2C_A, which is the checksum from the accessory 200. In the example of FIG. 17, one piece of data is shown, but multiple pieces of data may be written together.
[0214] By using CheckSumI2C_C from the camera 100, the accessory 200 can detect communication errors. If an error occurs, the accessory 200 will not write data, thereby preventing incorrect data from being written to the accessory information. In this case, CheckSumI2C_C can be calculated using the following formula 5, and CheckSumI2C_A can be calculated using the following formula 6.
[0215]
number
[0216] Fig. 18 is a diagram showing an example of communication content when a command is notified from the camera 100 to the accessory 200 via I2C communication in the second embodiment. As in Fig. 16, in Fig. 18, the upper row shows a transmission signal from the camera 100, and the lower row shows a transmission signal from the accessory 200. Also, 'S', 'P', 'W', and 'R' in Fig. 18 have the same meanings as those in Fig. 16, respectively.
[0217] Command data and arguments are sent from the camera 100 to the accessory 200, and a return value is notified from the accessory 200 to the camera 100 after execution of the command is complete. Specifically, the camera 100 first sends to the accessory 200 the address 0x0F where the command is stored and the command CMD_I2C. Following this, the camera 100 sends to the accessory 200 the arguments ARGV0 to ARGVm required for the command CMD_I2C, and finally ChecksumI2C_C is sent. In this case, the arguments ARGV0 to ARGVm differ depending on the command CMD_I2C, and there may be no arguments.
[0218] On the other hand, the accessory 200 first executes processing corresponding to the received command CMD_I2C after the read notification bit, and transmits the received command CMD_I2C in the first byte as a command execution completion notification to the camera 100. Next, the accessory 200 transmits RET0 to RETn as return values to the camera 100, and finally transmits ChecksumI2C_A from the accessory 200. In this case, the return values RET0 to RETn differ depending on the command CMD_I2C, and there may be no return value.
[0219] By using CheckSumI2C_C transmitted from camera 100, accessory 200 can detect communication errors. If an error occurs, accessory 200 will not execute the command, thereby preventing the execution of an incorrect command. In this case, CheckSumI2C_C can be calculated using the following formula 7, and CheckSumI2C_A can be calculated using the following formula 8.
[0220] Note that the following formula 8 shows CheckSumI2C_A when the command execution is successful, and CheckSumI2C_A when the command execution fails can be calculated, for example, by the following formula 9. In this way, when the command execution fails, accessory 200 can notify camera 100 that the command execution failed by sending to camera 100 a CheckSumI2C_A with a value different from that when the command execution is successful.
[0221]
number
[0222] Fig. 19 is a diagram showing an example of a command executed in this embodiment. The "number (command number)" shown in Fig. 19 is the number of the command CMD_I2C that the camera 100 transmits to the accessory 200. Furthermore, "argument" is the number of arguments ARGV0 to ARGVm that are set when the command is transmitted, "return value" is the number of return values RET0 to RETn that are returned after the command is executed, and "type" is the content of the processing that the accessory 200 executes.
[0223] For example, when starting charging with accessory 200, the data sent from camera 100 has command CMD_I2C set to 0x03, and the argument is 0 (zero), so there are no arguments ARGV0 to ARGVm, and the last part is ChecksumI2C_C. Upon receiving this data from camera 100, accessory 200 executes the charging indicated by the command, and sends the received command, address 0x03, and calculated ChecksumI2C_A to camera 100 as command execution completion data. Note that since the return value is 0, no return values RET0 to RETn are sent from accessory 200 to camera 100.
[0224] Furthermore, when camera 100 obtains the charging voltage from accessory 200, the data sent from camera 100 has command CMD_I2C set to 0x82, and since the argument is 0, there are no arguments ARGV0 to ARGVm, and the last part is ChecksumI2C_C. Upon receiving this data from camera 100, accessory 200 obtains the charging voltage and sends command execution completion data to camera 100. In this case, the command execution completion data consists of the received command, address 0x82, the return value RET0 as voltage data since the return value is 1, and the calculated ChecksumI2C_A.
[0225] As explained above, writing data to addresses 0x00 to 0x0E in the accessory information allows the data at those addresses to be changed. In contrast, address 0x0F is an area for storing a checksum, and since the accessory control unit 201 calculates ChecksumI2C_A when transmitting data, there is no need for the camera 100 to rewrite this address. In the second embodiment, an address that does not need to be rewritten by instructions from the camera 100 is also used as a command write address, allowing commands to be executed without increasing the area for the accessory information.
[0226] Furthermore, when the camera 100 reads accessory information from the accessory 200, the camera 100 does not add the ChecksumI2C_C data calculated by the camera 100. This is because even if an error occurs, it will not cause malfunctions or other problems. On the other hand, when the camera 100 writes data to the accessory information area of the accessory 200 or executes a predetermined command, even if an error occurs, the error cannot be detected without a checksum. Failure to detect the error can lead to malfunctions or even damage to the accessory. For this reason, when the camera 100 writes data to the accessory information area of the accessory 200 or causes the accessory to execute a predetermined command, the camera 100 transmits the checksum calculated by the camera 100 to the accessory 200.
[0227] Although the above embodiment has been described with a focus on a configuration in which the accessory 200 is directly attached to the camera 100, other configurations are also possible. For example, the camera 100 and the main accessory may communicate via a main accessory corresponding to the accessory 200 and an intermediate accessory such as an adapter device attached to the camera 100. In such a configuration, the intermediate accessory may perform communication control similar to at least a portion of the communication control performed by the accessory 200 and the communication control performed by the camera 100 described in the above embodiment. Alternatively, the intermediate accessory may function as an information transmission path for outputting information corresponding to information input from the camera 100 to the main accessory and outputting information corresponding to information input from the main accessory to the camera 100. As described above, the accessories according to the present invention include various accessories such as microphone devices, lighting devices, and adapter devices. Furthermore, an adapter device may also be included in the electronic device according to the present invention.
[0228] While the present invention has been described in detail above based on preferred embodiments thereof, the present invention is not limited to these specific embodiments, and various forms within the scope of the gist of the present invention are also included in the present invention. Furthermore, each of the above-described embodiments merely represents one embodiment of the present invention, and each embodiment can be combined as appropriate.
[0229] For example, in the above embodiment, an imaging device (digital camera) and an accessory attached thereto are described as an example of an electronic device according to the present invention, but the electronic device and accessory according to the present invention are not limited to this. For example, examples of the electronic device according to the present invention include portable electronic devices such as digital video cameras and smartphones, wearable devices, in-vehicle cameras, and security cameras. Furthermore, the present invention can be applied to various accessories that can be attached to (connected to) these electronic devices.
[0230] The present invention can also be realized by supplying a program that realizes one or more functions of the above-described embodiments to a system or device via a network or a storage medium, and having one or more processors in the computer of the system or device read and execute the program. It can also be realized by a circuit (e.g., ASIC) that realizes one or more functions. [Explanation of symbols]
[0231] 100 cameras A101 Camera control unit B102 Camera control unit 141 Camera connection part 200 Accessories 201 Accessory control unit 211 Accessory connection
Claims
1. An accessory communicatively connected to an electronic device, a storage means for storing accessory information including a flag indicating whether a command can be executed by the accessory, the storage means being readable and writable; a communication means for transmitting the accessory information to the electronic device in response to the accessory being attached to the electronic device; and a control means for, when a predetermined command is received from the electronic device via the communication means, not executing the predetermined command if the flag indicates that the command cannot be executed, and for executing the predetermined command if the flag indicates that the command can be executed.
2. 2. The accessory of claim 1, wherein the control means adds a checksum to communications to the electronic device for the electronic device to read information stored in the storage means from the accessory, and also adds a checksum to communications to the electronic device for the electronic device to write the command to the storage means.
3. The accessory described in claim 2, characterized in that in the storage means, an address at which a checksum added to communication to the electronic device for the electronic device to read information stored in the storage means from the accessory is stored is the same as an address at which commands received from the electronic device are written.
4. The accessory described in any one of claims 1 to 3, characterized in that the control means changes the checksum value included in the notification of the execution result of the command received from the electronic device depending on whether the execution of the command received from the electronic device is successful or unsuccessful.
5. 5. The accessory according to claim 1, wherein the communication means performs I2C communication with the electronic device.
6. An electronic device capable of connecting accessories, communication means for communicating with the accessory; a readout means for reading accessory information including a flag stored in a readable / writable storage means provided in the accessory in response to the accessory being attached to the electronic device; a control means for not sending a command to the accessory when the flag indicates that the accessory cannot execute the command, and for sending a command to the accessory when the flag indicates that the accessory can execute the command; The electronic device is characterized in that the control means does not add a checksum to communication with the accessory for reading the flag from the accessory, and adds a checksum to communication with the accessory for writing the command to the memory means.
7. 7. The electronic device according to claim 6, wherein the communication means performs I2C communication with the accessory.
8. Electronic devices and an accessory communicatively connected to the electronic device, The accessory is a storage means for storing accessory information including a flag indicating whether a command can be executed by the accessory, the storage means being readable and writable; a first control means for, when receiving a predetermined command from the electronic device, not executing the predetermined command if the flag indicates that the command cannot be executed, and for executing the predetermined command if the flag indicates that the command can be executed; The electronic device includes: a readout means for reading out accessory information including the flag in response to the accessory being attached to the electronic device; a second control means for not sending a command to the accessory if the flag indicates that the command cannot be executed by the accessory, and for sending a command to the accessory if the flag indicates that the command can be executed by the accessory.
9. A method for controlling an electronic device to which an accessory can be connected, comprising: establishing communication with the accessory; a step of reading accessory information including a flag stored in a readable / writable storage means provided in the accessory; not sending a command to the accessory if the read flag indicates that the accessory cannot execute the command, and sending a command to the accessory if the read flag indicates that the accessory can execute the command, A method for controlling an electronic device, characterized in that a checksum is not added to communication from the electronic device to the accessory for reading the flag from the accessory, and a checksum is added to communication from the electronic device to the accessory for writing the command to the memory means.
10. A program that causes a computer to function as each of the means of the accessory according to any one of claims 1 to 5.
11. A program that causes a computer to function as each of the means of the electronic device according to claim 6 or 7.
Citation Information
Patent Citations
Check sum writing method for eeprom
JP1993158807A
Communication controller, communication system, and communication method
JP2003319013A
Camera module communicating using i2c communication method
JP2007181202A
Image forming apparatus, image forming method, image forming program, and image forming system
JP2009069948A
Imaging apparatus and imaging system
JP2019140565A