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

Battery third (temp) terminal as multipurpose analogue input

  • 199 Replies
  • 77473 Views
Re: Battery third (temp) terminal as multipurpose analogue input
« Reply #140 on: 26 / February / 2014, 08:22:14 »
Advertisements
Hi Recyclojunk64,

thanks, sounds not too bad ;-). I will order now a few resistors (for r2r network) and also an 8Bit DAC to get started somehow. Where inside CHDK I can read the value of the temperature?
I mean since I want to detect quickly if the resistor value changes I need some place in the source code to read that value and trigger an action (e.g. zoom in / out). Best would be an interrupt of course but I doubt that there exists one for the temperature sensor. So I think I have to poll in certain intervalls is that correct? Where should I place the code exactly?
How do I read the temperature value for my S110? Is there already a function available?

Thanks again for any help!
You might want to get started by actually reading through this thread?  Most of your questions are already discussed here and there are patch files with tested code and a lot of other information you will probably find useful.
Ported :   A1200    SD940   G10    Powershot N    G16

Re: Battery third (temp) terminal as multipurpose analogue input
« Reply #141 on: 26 / February / 2014, 08:32:41 »
Hi waterwingz,

I thought that there is maybe something in the trunk already.
I read this thread from page 1 to 14, but was not sure if this is the latest information regarding the middle terminal. You tell me now that the code is inside this thread so I will take a look back and try that first.

If I face some problems hopefully someone can assist here?




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

Re: Battery third (temp) terminal as multipurpose analogue input
« Reply #142 on: 26 / February / 2014, 09:30:38 »
Some more info and code can probably be found in the thread where I'm triggering my D20 rig with hall sensors connected to the temp input:

http://chdk.setepontos.com/index.php?topic=11058.0

Seems the easiest way to read the value is to read it directly from the appropriate MMIO which I believe is 0xc090004a. Or you can use the GetAdChValue native call which appears to involve alot more mucking about to set up.

So to read it, you can use *(short*)0xc090004a. Not sure where you would put the code to be executed constantly, maybe you could get away with putting it in usb_remote.c where it'll get called every 10 milliseconds but I'm sure there's a more logical place to put it though.


On a completely unrelated note, I have a question for the CHDK experts. Is it possible to use CHDK to communicate with an external flash via the hot-shoe? I'm pretty sure that those 4 pins on the hot-shoe are used to communicate data such as brightness and other stuff with the flash right? Well could that be used to communicate data between two cameras with hot-shoes?

Re: Battery third (temp) terminal as multipurpose analogue input
« Reply #143 on: 26 / February / 2014, 10:23:20 »
I thought that there is maybe something in the trunk already.
It's on my "to do" and "roundtuit" list.

Quote
You tell me now that the code is inside this thread so I will take a look back and try that first.
http://chdk.setepontos.com/index.php?topic=10385.msg109316#msg109316

Quote
If I face some problems hopefully someone can assist here?
As always ... and that's mostly why I post links in response to your questions.  Much of the information you need is already here.  Its just sometime hard to find and spread across multiple threads.  ;)
Ported :   A1200    SD940   G10    Powershot N    G16


Re: Battery third (temp) terminal as multipurpose analogue input
« Reply #144 on: 26 / February / 2014, 10:58:15 »
And here's few more links you might want to study :

Script that manages 20 mSec pulse for communication with CA-1 remote :   http://chdk.setepontos.com/index.php?topic=11232.msg110333#msg110333

Getting higher resolution timing :  http://chdk.setepontos.com/index.php?topic=10114.msg109695#msg109695

This whole thread is good - but you can start here :  http://chdk.setepontos.com/index.php?topic=7127.140

Ported :   A1200    SD940   G10    Powershot N    G16

*

Offline reyalp

  • ******
  • 14082
Re: Battery third (temp) terminal as multipurpose analogue input
« Reply #145 on: 27 / February / 2014, 00:09:24 »
Seems the easiest way to read the value is to read it directly from the appropriate MMIO which I believe is 0xc090004a.
I would caution that in that MMIO addresses are likely to vary between camera models. Some may be consistent across a wide range of models, but in general it's not safe to assume they are.

Quote
On a completely unrelated note, I have a question for the CHDK experts. Is it possible to use CHDK to communicate with an external flash via the hot-shoe? I'm pretty sure that those 4 pins on the hot-shoe are used to communicate data such as brightness and other stuff with the flash right? Well could that be used to communicate data between two cameras with hot-shoes?
I'm not aware of any work done on this, but it certainly seems like something that should be possible to reverse engineer.
You might not be able to do two way communication with just the hot shoe, but it should be possible to use it as a controllable output.
Don't forget what the H stands for.

Re: Battery third (temp) terminal as multipurpose analogue input
« Reply #146 on: 27 / February / 2014, 01:33:24 »
Quote
I'm not aware of any work done on this, but it certainly seems like something that should be possible to reverse engineer.
You might not be able to do two way communication with just the hot shoe, but it should be possible to use it as a controllable output.

Do you think the input could be read from an MMIO or would it be handled differently? Might there be a native function that would read it? If it could be read from an MMIO would it be possible to just read a heap of different addresses and see which ones change when there's an input change on the pins?

By a controllable output you mean the larger output that actually fires the flash right? Any idea of the address needed to fire it?

IIRC when repairing the SX40 there was a mosfet labled K2715 near the hot shoe.

Well since I already have the input with the battery temp sense terminal, I could use those together I guess (maybe with a micro-controller in the middle). At least the hotshoe output would beat using AF lamp.

*

Offline ahull

  • *****
  • 634
Re: Battery third (temp) terminal as multipurpose analogue input
« Reply #147 on: 27 / February / 2014, 05:23:59 »
I'm not sure if this is related to your requirements, or indeed if the hot-shoe in question talks this particular protocol, but perhaps this is worth a look. 


Re: Battery third (temp) terminal as multipurpose analogue input
« Reply #148 on: 27 / February / 2014, 08:15:00 »
Quote
I'm not sure if this is related to your requirements, or indeed if the hot-shoe in question talks this particular protocol, but perhaps this is worth a look. 

Thanks! It also took me to here which also has a fairly comprehensive list of commands and a pinout.

So if I could trick the camera into sending out standard (or non-standard) commands to the hot-shoe that might work quite well. Anyone have any idea how this could be done?

Re: Battery third (temp) terminal as multipurpose analogue input
« Reply #149 on: 27 / February / 2014, 08:41:36 »
Thanks! It also took me to here which also has a fairly comprehensive list of commands and a pinout.
From the linked article : "D1 is driven by the flash and D2 by the camera"

Sounds like you could probably poke D1 with a 5V signal and see if any bits in the three word kbd array change.  Although there might be a dedicated UART for something like that.

Quote
So if I could trick the camera into sending out standard (or non-standard) commands to the hot-shoe that might work quite well. Anyone have any idea how this could be done?
As far as other next steps,  I think you need to get down to some serious reverse engineering & dissassembly.  Not for the faint of heart.
Ported :   A1200    SD940   G10    Powershot N    G16

 

Related Topics