Powershot N Porting Thread - page 16 - DryOS Development - CHDK Forum
supplierdeeply

Powershot N Porting Thread

  • 212 Replies
  • 66077 Views
Re: Powershot N Porting Thread
« Reply #150 on: 07 / September / 2014, 18:01:00 »
Advertisements
@waterwingz

Thanks for reply. I think this will explain that high signal from any processor port is not recognized as high level on USB+ contact. I will try to use an MOSFET driver to match the higher amont of current. I will post my results later on.

Regards, Andreas.

Re: Powershot N Porting Thread
« Reply #151 on: 10 / September / 2014, 10:20:41 »
I have measured the current drained  by USB port in high state.
It is about 80 mA!.
Now I will use a small power MosFET driven by microcontroller port to match this "high" current.
I hope this will allow "normal" function of USB remote control.
But I do not know if it is possible to allow PWM function witch is used in scripts for different "USB Commands"...
I will post my results tomorrow evening.

Regards, Andreas.

Re: Powershot N Porting Thread
« Reply #152 on: 10 / September / 2014, 11:07:51 »
I would expect that all USB remote functionality will work properly as long as you can source enough current.
Ported :   A1200    SD940   G10    Powershot N    G16

Re: Powershot N Porting Thread
« Reply #153 on: 11 / September / 2014, 14:41:07 »
Now I could successfully activate USB remote by camera itself.
Remote cable circuit provides 80 mA of current.
Setting Switch Type to OnePush and Control Mode to Normal.

Unfortunately the PWM mode used by scripts [get_usb_power()] does not work.
The reason is that signal rise is very flat like charging a capacitor.
So there is no sharp rising edge in Signal form, if the pulses have 20ms interval, mostly used by RC Servo Output. I have testet it with oscilloscope (transit from high to low is very sharp edged).
Script function [get_usb_power(1)] should work but I have not tested it yet.

regards Andreas.






*

Offline srsa_4c

  • ******
  • 4430
Re: Powershot N Porting Thread
« Reply #154 on: 11 / September / 2014, 16:16:03 »
Some questions.

- What is the lowest voltage that the cam considers as "USB is connected"?
- Is the current draw software controlled? Does it make a difference when the USB sense bit is overridden in the keyboard task?
- Does the current draw depend on the voltage?

Re: Powershot N Porting Thread
« Reply #155 on: 11 / September / 2014, 16:50:29 »
Unfortunately the PWM mode used by scripts [get_usb_power()] does not work. The reason is that signal rise is very flat like charging a capacitor. So there is no sharp rising edge in Signal form, if the pulses have 20ms interval, mostly used by RC Servo Output.
The camera and script function do not care about how sharp the rising edge is.  It makes absolutely no difference.

What does matter is how long the pulse voltage stays above the high voltage level threshold.  The signal is sampled in software on average every 10 mSecs.  So if a high level is held for less than 10 mSec then it may not be noticed. And in shooting mode,  the 10 mSec sampling period will sometimes be even slower than that.

This is a problem with all CHDK implementations - not just the Powershot N.   But fortunately,  CHDK now has a solution - Script High Perfomance Timer Mode
Ported :   A1200    SD940   G10    Powershot N    G16

Can the Powershot N do this?
« Reply #156 on: 12 / September / 2014, 00:14:09 »
I would like to use an N under CHDK to shoot 240FPS or 120FPS (at 640x480 or 320x240) video under control of a Lua script... does that work? Is it possible to exceed the 30s record time limit for those modes using CHDK? I'd love to get is a low-res raw stream at >100FPS, but does anyone know how to get such data as opposed to filling the full-res raw buffer and sampling it out in software? Also, can I get the N's 1080 video at higher than about 24FPS using CHDK?

What I'd really like to do is use USB-tethered control to trigger multiple Ns so that their high-speed video is captured with precisely known relative timing properties and can be temporally correlated and combined in postprocessing. Ideally, it would be great if I could also use the WiFi support to feed the image data back to a computer while capturing video, thus keeping the USB interface free for camera control. Anybody ever do something like this with an N under CHDK?

I've been using CHDK for many years, often running my own pure C code inside to do computational photography things, so I'm not afraid of coding -- or having my students code -- but I want to know more about what's possible before I buy a bunch of Ns. I already have fleets of A4000 and ELPH115, but they don't have what it takes for high-framerate video....

Thanks.

Re: Can the Powershot N do this?
« Reply #157 on: 12 / September / 2014, 09:30:25 »
I've been using CHDK for many years, often running my own pure C code inside to do computational photography things, so I'm not afraid of coding -- or having my students code -- but I want to know more about what's possible before I buy a bunch of Ns.
Welcome back!   Must be the start of another school year?  ;)

Do your student projects that use CHDK in some manner ever get published somewhere ?

Quote
Anybody ever do something like this with an N under CHDK?
My current guess would be that there are only a couple of people even using CHDK with the "N" and only one person who has actually done any CHDK porting / coding for it. It's just not that popular a camera even though it's a lot of fun to use and has some unique features and abilities.

Quote
I already have fleets of A4000 and ELPH115, but they don't have what it takes for high-framerate video....
The N uses the same DIGIC chips and electronics as the other Powershots - likely including the ones you already have.   Is there something that makes you think it might be more capable of "high end" video functions?

FWIW, there are a few posts on this forum about poking video register to get higher frame rates but it barely even qualifies as "experimental" at this point.  Extending beyond 30 minutes should be possible - I just haven't gotten around to it.   And feeding streaming video over wifi and/or RAW video seems like really cool stuff but it's almost completely a "green field" project - I'm not sure I'd want that assignment if it was going to count as part of my GPA.

Perhaps srsa_4c or reyalp will offer thoughts on some of the other details you've mentioned.
Ported :   A1200    SD940   G10    Powershot N    G16


Re: Can the Powershot N do this?
« Reply #158 on: 12 / September / 2014, 11:17:12 »
Welcome back!   Must be the start of another school year?  ;)

Yup.  Also start of an NSF grant....

Quote
Do your student projects that use CHDK in some manner ever get published somewhere ?

I've cited things like the depthmap capture and 360-degree-panorama-off-a-shiny-ball things my students have done, but they weren't "new" enough ideas for research publication by themselves.  Several things from my "Cameras as Computer Systems" course are in the works now.

Quote
Is there something that makes you think it might be more capable of "high end" video functions?

The N is one of the HS Canons that use a CMOS sensor instead of a CCD and hence officially support 320x240 video at 240FPS, and it is only $180. Unfortunately, the N seems to be the only one currently supported by CHDK. The 802.11 wireless is also absent from the 7 or so other flavors of CHDK PowerShots I have.  Thus, the question....

Re: Powershot N Porting Thread
« Reply #159 on: 12 / September / 2014, 19:45:07 »
What is the lowest voltage that the cam considers as "USB is connected"?
"USB connect" toggles between 4.1 and 4.2 volts.  There does not appear to be any hysteresis.

Quote
Is the current draw software controlled? Does it make a difference when the USB sense bit is overridden in the keyboard task?
With just the remote 5V and ground connected,  the camera draws about 4 mA when USB remote is disabled and 1.7 mA when it is enabled.  There is a slight ( 1/2 second ) delay after USB remote is disabled before the current goes back to 4 mA.

Quote
Does the current draw depend on the voltage?
Not on the tests done so far - changing between 4V & 5V does not change the current draw.

Note that the camera will not start charging (regardless of being on or off) when 5V is applied across the USB power pins. There appears to be some signalling needed - probably resistors arranged across the D+ and D- lines the way the Apple chargers work  ( or simply a few hundred ohms between D+ and D- for Samsung and other devices).

I have yet to figure out what it takes to get the camera to go into charging mode.  But at one point in my experimenting it did ( yellow charge led on ) and drew about 40 mA in that state.

Edit : I also appear to have something wrong in the boot.c code.  Powershot N power management is likely different than other cameras - it won't start in (or go onto) shooting mode if USB power is connected.  The camera starts normally (without CHDK enabled) while the USB charger is plugged in.  When attempting to autoboot (SD card door open) with the charger connected, the boot strap LED flash sequence occurs but CHDK does not start.   Trying a firmware update in this mode also fails to start. 

Also, the USB charge light on the camera never comes on when the N is plugged into my Linux box.  I have the USB configured to ignore the N so that chdkptp can grab it.  Perhaps the camera notices that and won't go into high current charging mode.
« Last Edit: 12 / September / 2014, 20:12:48 by waterwingz »
Ported :   A1200    SD940   G10    Powershot N    G16

 

Related Topics