Magic Lantern Forum

Developing Magic Lantern => Reverse Engineering => Topic started by: jplxpto on December 08, 2012, 02:42:44 AM

Title: Canon EF lens mount - Communication protocol
Post by: jplxpto on December 08, 2012, 02:42:44 AM

"
The communication protocol between the camera is 8-data-bit, 1-stop-bit SPI (mode 3). The pins, from right to left on the lens, are:

Canon EF mount pins[2][17]
Name   Function   Notes
VBat   +6 volts to power internal lens focus motors   
Present on all EOS bodies and lenses

P-Gnd   Power ground
P-Gnd
VDD   +5.5 volts Digital logic power
DCL   Data from camera to the lens (MOSI)
DLC   Data from the lens to the camera (MISO)
LCLK   Camera body generated clock signal (SCLK, CPOL=1)
D-GND   Digital logic ground
COM1   Teleconverter common[18][19][20]   
Only on most L-series and some macro lenses

EXT0   Short to COM1 for 'Life Size Converter' and x1.4 teleconverter
EXT1   Short to COM1 for x2 and x1.4 teleconverter
"

http://en.wikipedia.org/wiki/Canon_EF_lens_mount#Stepping_motor
Title: Re: Canon EF lens mount - Communication protocol
Post by: a1ex on December 08, 2012, 06:16:47 AM
http://kzar.net/wiki/Photo/CanonEFProtocol

if it doesn't work, here's a mirror (http://a1ex.magiclantern.fm/bleeding-edge/kzar-ef-lens-protocol.zip) (hope it's fair use)

http://birger.us/downloads.htm (scroll down)

http://www.dslr-forum.de/showthread.php?t=649529&page=12

http://pickandplace.wordpress.com/2011/10/05/canon-ef-s-protocol-and-electronic-follow-focus/
Title: Re: Canon EF lens mount - Communication protocol
Post by: SDX on December 08, 2012, 11:27:47 AM
Some thoughts about this. You'll have to read a bit though.
http://www.magiclantern.fm/forum/index.php?topic=1749.25
Title: Re: Canon EF lens mount - Communication protocol
Post by: jplxpto on December 08, 2012, 03:24:54 PM
Quote from: a1ex on December 08, 2012, 06:16:47 AM
http://kzar.net/wiki/Photo/CanonEFProtocol

if it doesn't work, here's a mirror (http://a1ex.magiclantern.fm/bleeding-edge/kzar-ef-lens-protocol.zip) (hope it's fair use)

http://birger.us/downloads.htm (scroll down)

http://www.dslr-forum.de/showthread.php?t=649529&page=12

http://pickandplace.wordpress.com/2011/10/05/canon-ef-s-protocol-and-electronic-follow-focus/

Thank you

One day I'll still play with it.
I just let the link to get registered and to which others have access to this information if they wish.
I liked this:
http://pickandplace.wordpress.com/2011/10/05/canon-ef-s-protocol-and-electronic-follow-focus/
Title: Re: Canon EF lens mount - Communication protocol
Post by: eos-dacious on February 28, 2016, 06:28:43 PM
Is there a way to intercept the raw data that is sent or received over the electrical connection pins in the EF-Mount from within ML ?
Are there any adressess that are constantly changing while there is communication going on with lens?

Btw.: the probably currently best compilation of the Canon EOS EF-mount protocol can be found in this post: www.dslr-forum.de/showpost.php?p=12221153&postcount=554
Title: Re: Canon EF lens mount - Communication protocol
Post by: a1ex on February 28, 2016, 07:34:02 PM
This happens on another processor, which we don't really understand yet.

To get the code running on that processor, see https://bitbucket.org/hudson/magic-lantern/branch/mpu

If you have about 1-2 years of spare time, and some low-level programming knowledge, you could try to modify a Tx19A emulator (such as NikonHacker's) and have fun understanding that code.

Looking inside an EOS M3 might be interesting: from strings, it appears to have 3 secondary CPUs: MechaCpuA, MechaCpuB, SubCPU. I have no idea what's there yet, but at least the implementation seems different than on current DSLRs.

In other words, I think it's much easier to intercept it at hardware level.
Title: Re: Canon EF lens mount - Communication protocol
Post by: nikfreak on February 29, 2016, 04:28:51 PM
You could modify the following setup and treat it as PoC for debugging the cam hardware if you extend it:

http://web.media.mit.edu/~bandy/invariant/move_lens.pdf

What I was planning to do is: