USB / power auto switch ON??? - page 2 - General Discussion and Assistance - CHDK Forum supplierdeeply

USB / power auto switch ON???

  • 11 Replies
  • 6149 Views
*

Offline ahull

  • *****
  • 634
Re: USB / power auto switch ON???
« Reply #10 on: 28 / January / 2013, 03:19:47 »
Advertisements
For the record,  it seems from a quick examination of the few available circuit schematics, that although both the S3 and Ixus 60/65 series cameras have circuitry to detect the connection of the USB cable, the way this has been designed is subtly different.

In the case of the S3 IS it is reported that the camera powers on when the USB cable is connected, the Ixus 60/65 does not.

According to the schematics, the cameras in question detect the application of power to USB Pin 1 VCC (+5 V) the Canon diagrams refer to this as VBUS (Pin 1) and the layout diagrams refer to the signal as USB_VBUS.

Rather obviously therefore if the USB host does not provide power or the USB cable does not have pin 1 connected, then the camera will not detect the cable in this way (it *may* still detect USB if the host sends data through the cable, I didn't test this theory though, and the camera would already have to be powered up for this to work, so not very interesting from this perspective).

In the S3 IS, this signal is propagated through an inverter/level shifter where it emerges as /USB_DET which in turn is connected to P15/IRQ1 (active low) on the CPU (strictly speaking on the sub-cpu IC1305 SUB CPU D33694P03FYV ) which is presumably used to send an interrupt (to the possibly sleeping) main DIGIC II processor (and potentially wake it up, if it is asleep/powered down) which will then be serviced in a suitable manner. 

I imagine that once serviced, this interrupt is then masked, to stop any further interrupts till the pin goes high once more, indicating that the USB cable has been disconnected. This is conjecture on my part as I have no easy way to check this.

In the case of the Ixus 60 and 65, there is a similar arrangement, however the signal is fed instead to a GPIO pin on the main DIGIC II processor ((IC1008 (3/3) DIGIC II 166MOD)  - GPIO_P33 in the case of the Ixus 65) which presumably means that this signal can only be polled by a processor which is already "awake" i.e. powered on, and therefore no matter what we do in CHDK, there would be no way to force the camera to wakeup from this particular signal.

I could of course be wrong, if we discover the Digic processors will allow interrupts from GPIO pins, AND those interrupts can be used to wake the processor AND the circuit design of later IXUS cameras follows a similar pattern.

A big if... therefore the simplest method of waking the camera is to operate the power button, either mechanically, or if you are not afraid of a bit of surgery, by modifying the circuitry of the camera to allow external triggering of this button.

The power button on the IXUS 60/65 cameras operates by switching VBATT (there is no additional DC power input on this camera, so this signal comes directly from the +ve battery voltage) to the CTL signal of the voltage regulator controller (referred to as C601 SW REG CONTROL MB39C303PVK-G-EFE1 in the case of the Ixus 60/65) the regulator controller in turn powers up the CPU (and the rest of the camera).

This may explain one of the reasons why some cameras are more fussy about the input voltage from external home brew power sources than others. If the VBATT signal does not lie within the correct voltage window, then the DC regulation controller may fail to operate, and the camera will fail to power up. The input on AA cell powered cameras is regulated by the 3.3V regulator *before* it hits any other circuitry, and therefore the only limiting factor is the robustness of the 3.3V regulator. Typically low voltage regulators of this sort are fairly tolerant of a wide range of input voltage.... but I digress... back to the Ixus 60/65 power up details.

The Digic II CPU keeps the CTL signal high (using GPIO_P16, ORed with a couple of diodes with the power button signal) once the power button is released, and will continue to do so until it detects a problem, or the battery voltage drops too low, or it detects a further press of the power button (via a level shifted copy of the power button signal on GPIO_P34)

Any "surgery" therefore for the Ixus 60/65 would have to consist of a pair of switch contacts in parallel with the power switch. These could be anything, from a small reed relay hidden inside the camera body, and operated with an external magnet, to a pair of wires connected externally to the switch of your choice. Operation of such a switch would most probably have to take the form of a short pulse (around the 1s mark) in a manner similar to pressing the power button.   

Naturally, the S3 IS operates in a different manner. In this case, the VBATT voltage is fed through a 3.3 V regulator and is always present in the camera, it constantly powers the "sub CPU", which is presumably in sleep mode. In the diagram there is also a reset circuit on the output of the voltage regulator attached to the /RES pin of the sub cpu (again this is IC1305 SUB CPU D33694P03FYV rather than the main DIGIC II processor).

Most probably, therefore adding a fresh set of batteries will trigger the reset pin on the camera, this may cause the camera to call some housekeeping routine.

The power button on the S3 IS cameras generates a signal called PWR_OFF from VDD0-3.3 (the output of the 3.3V regulator) when pressed, and this signal is fed (indirectly, it is ORed with the REC signal from the REC button) to P50/WKP0 on the sub cpu. Therefore the S3 probably slowly drains the batteries even when powered off,  and the IXUS 60/65 by comparison probably draws almost zero power when powered off. (This could easily be verified with a sensitive current meter, sadly I don't have that, or an S3 to hand)

In summary the S3 will power on from interrupts (including the USB cable), and there is a high degree of probability that cameras of a similar age and design (i.e. using AA Cells, rather than a LiPo battery) operate in a similar manner.
 
The Ixus 60/65 will power on only from the power switch, probably most LiPo battery cameras follow a similar design to this.

The usual caveats apply here. All of the above applies only to the S3 IS and the Ixus 60/65, and may or may not apply to other cameras. If you wish to risk frying your precious Canon as a result of relying on the above, you do so entirely at your own risk.
« Last Edit: 28 / January / 2013, 07:51:27 by ahull »

*

Offline srsa_4c

  • ******
  • 4285
Re: USB / power auto switch ON???
« Reply #11 on: 28 / January / 2013, 07:11:56 »
@ahull
A small addition to the above:
The following models are known to have the "sub cpu" design:
S1IS, S2IS, S3IS, S80
All these models have a built-in "intervalometer" in the Canon menu. As the DIGIC probably doesn't have a low power operating mode, the sub cpu is used to power up and down the DIGIC.

 

Related Topics