Battery third (temp) terminal as multipurpose analogue input - page 17 - Hotwire! Hardware Mods, Accessories and Insights - CHDK Forum supplierdeeply

Battery third (temp) terminal as multipurpose analogue input

  • 199 Replies
  • 35419 Views
Re: Battery third (temp) terminal as multipurpose analogue input
« Reply #160 on: 15 / March / 2014, 17:14:01 »
Advertisements
That's just because the 6 meter circle doesn't fit in the room. I have them like that only to be able to see the screens.
Doh!   Thanks for that.   

Can't wait to see your video of the first real shooting day!
Ported :   A1200    SD940   G10    Powershot N    G16

Re: Battery third (temp) terminal as multipurpose analogue input
« Reply #161 on: 15 / March / 2014, 21:04:25 »
So i read somewhere that the a1400 does not have a batter sensor in it.

can anyone confirm this?


*

Offline reyalp

  • ******
  • 12111
Re: Battery third (temp) terminal as multipurpose analogue input
« Reply #162 on: 15 / March / 2014, 21:39:48 »
So i read somewhere that the a1400 does not have a batter sensor in it.
That is almost certainly correct. a1400 uses AA batteries. The battery sensor only exists on the lithium ion batteries.
Don't forget what the H stands for.

Re: Battery third (temp) terminal as multipurpose analogue input
« Reply #163 on: 19 / April / 2014, 16:01:29 »
A tested patch file that fully implements this functionality, suitable for inclusion in the 1.3.0 trunk, is attached below.  Only the SD940 and SX200 are currently enabled in their platform_camera.h files as these are the only cameras that have been tested.  Others can be enabled as required.

I followed srsa_4c's notes from here for VxWorks vs DryOS cameras :  http://chdk.setepontos.com/index.php?topic=10385.msg109353#msg109353  but was not able to fully test as I don't have a VxWorks camera that takes a LiPo battery (my A560 uses AA cells).  Also, for the exception cameras noted, the GetAdChValue(int channel) wrapper is implements as "weak" so that it can be overridden on an individual camera basis in their lib.c or kbd.c files (for example).

Tested on my sd940 after some delicate surgery on the dummy battery that came with my cheap Chinese power supply.   

As an FYI,  the NB-7L used in the G10 and several other cameras has four terminals rather that three.   I did a little sleuthing with the DVM that shows me this :
  • 7.8V
  • 10K thermistor (other side connected to terminal 4)
  • 3.7V (i.e. half way up the battery stack)
  • Common (or ground)
Note : numbered from the edge of the battery in.

@philmoz : I think I got the menu additions correct but I would appreciate if you would take a look - the last couple of times I've thought that I've been wrong.
« Last Edit: 19 / April / 2014, 16:05:57 by waterwingz »
Ported :   A1200    SD940   G10    Powershot N    G16


Re: Battery third (temp) terminal as multipurpose analogue input
« Reply #164 on: 21 / April / 2014, 12:16:43 »
Hi waterwingz,

thanks for your effort and providing the patch!
Since I am not familiar (right now) with TortoiseSVN I think it would be too much work to insert all the changes manually. Do you think your changes / patch will go into trunk?

I have some question on your patch:

1. Do I have to change some hardware address to read the middle terminal value from my S110?

2. Do you have a (simple) lua script where it is shown how to read the middle terminal value using th HP timer?

Thanks for helping again!

During the easter days started to develop my circuit which creates the different resistor values for the middle battery terminal. What I did so far is to create a dummy battery:

dummy battery



I also started to get my ATtiny working on my Atmel STK-600 board and started development for the R2R network and/or PWM to create different resistor values.

Unfortunately I had no luck with my new oscilloscope I bought a few days ago (Voltcraft MSO-5102B).
It often crashes on different settings I made. Remote software freezes and so on. Firmware update is not available from my supplier in Germany.
So I sent back and ordered a Hameg 1022 (Rhode & Schwarz) including 8 port logic channel probe HO 3508. Those will arrive in a few days and hopefully I can continue measurements.

Meanwhile I will learn more about TortoiseSVN may there is a possibility to use it in combination with my Eclipse development environment.

So step by step it goes ahead, not so fast as I wish but at least it goes ahead ;-).

Happy easter monday!

@waterwingz: I uploaded the image to imgur.com and embedded the link using 'insert image' but as you can see it only appears a small icon with question mark - the image is missing  :-[
« Last Edit: 21 / April / 2014, 12:24:47 by mr.burns »
2 x IXUS 860IS 100c
2 x Powershot S110 103a

Re: Battery third (temp) terminal as multipurpose analogue input
« Reply #165 on: 21 / April / 2014, 12:56:40 »
Since I am not familiar (right now) with TortoiseSVN I think it would be too much work to insert all the changes manually.
It's really not hard and if you are going to be doing a lot of coding, well worth learning so that you can build and maintain your own patch files.  I even use it for my script files.

Quote
Do you think your changes / patch will go into trunk?
Most probably - although initially only as a "build option" not included in the autobuild releases.

Quote
1. Do I have to change some hardware address to read the middle terminal value from my S110?
I don't think so - all the cameras tested so far use the sixth A/D channel (numbered from zero - so index=5).  There is a test script here you can use to watch the various channels : http://chdk.setepontos.com/index.php?topic=10385.msg108752#msg108752

Quote
2. Do you have a (simple) lua script where it is shown how to read the middle terminal value using the HP timer?
Not sure why you'd want to do that - they are independent patches.

Quote
Meanwhile I will learn more about TortoiseSVN may there is a possibility to use it in combination with my Eclipse development environment.
I'd be surprised if there is not some sort of SVN integration available - TortoiseSVN is just a Windows client that implements the svn stadard for accessing an SVN source code repository.  There are others.  Take a look at this for example :  https://www.eclipse.org/subversive/

Quote
@waterwingz: I uploaded the image to imgur.com and embedded the link using 'insert image' but as you can see it only appears a small icon with question mark - the image is missing  :-[
Hmmm ... you mean like this :


The link you posted was missing the .JPG extension that the forum rendering engine looks for.
Ported :   A1200    SD940   G10    Powershot N    G16

Re: Battery third (temp) terminal as multipurpose analogue input
« Reply #166 on: 21 / April / 2014, 13:11:45 »
Hi waterwingz,

Quote
Not sure why you'd want to do that - they are independent patches.

Sorry - you're right - I think I mixed up two things.

What do you think how fast a change of the resistor value (by my microcontroller) can be detected by the S110 and your patch?

2 x IXUS 860IS 100c
2 x Powershot S110 103a

Re: Battery third (temp) terminal as multipurpose analogue input
« Reply #167 on: 21 / April / 2014, 15:02:10 »
What do you think how fast a change of the resistor value (by my microcontroller) can be detected by the S110 and your patch?
My guess would be somewhere in the order of about 1mSec so you'd want to enable the HP timer mode & the A/D channel options in your build if you want to try and go that fast.   But I have not tested it so you'll have to experiment a bit.
Ported :   A1200    SD940   G10    Powershot N    G16


Re: Battery third (temp) terminal as multipurpose analogue input
« Reply #168 on: 25 / April / 2014, 07:56:40 »
Hi waterwingz,

on coming weekend I want to read/learn/try your usb_ad5_r12.patch.

Can I patch it into the latest trunk (Revision 3423)? Are there any other preconditions to consider?

What about the HP timer patches are they included in 3423 aleady or do I have to add a patch also?
If I have to patch also what I have to patch first?

Thanks for guiding me...
2 x IXUS 860IS 100c
2 x Powershot S110 103a

Re: Battery third (temp) terminal as multipurpose analogue input
« Reply #169 on: 25 / April / 2014, 09:19:01 »
Can I patch it into the latest trunk (Revision 3423)? Are there any other preconditions to consider?
The patch file will not longer apply cleanly - the latest update conflicts.  I'll do a newer version today that will work that you can use.  I'lll likely also submit it for inclusion in the autobuild/svn.

Edit : the patch file is fine - I just checked and it does not conflict with the latest changes.

Quote
What about the HP timer patches are they included in 3423 aleady or do I have to add a patch also?
If I have to patch also what I have to patch first?
It's already in the 1.3.0 build - you just have to enable it for your camera model.
« Last Edit: 25 / April / 2014, 09:52:54 by waterwingz »
Ported :   A1200    SD940   G10    Powershot N    G16

 

Related Topics