Approve the Cookies
This website uses cookies to improve your user experience. By using this site, you agree to our use of cookies. Read More.
OK
Index  •   • New posts  •   • RTAT  •   • 'Best of'  •   • Gallery  •   • Gear  •   • Reviews
New posts  •   • RTAT  •   • 'Best of'  •   • Gallery  •   • Gear  •   • Reviews
Register to forums    Log in

 
FORUMS Canon Cameras, Lenses & Accessories Canon EF and EF-S Lenses
Thread started 11 Dec 2010 (Saturday) 17:22
Prev/next
sponsored links
(this ad will go away when you log in as registered member)

Reverse-engineering Canon EF lens protocol

 
astronomerroyal
Hatchling
9 posts
Joined Mar 2009
Dec 11, 2010 17:22 |  #1

A few months ago I had reason to reverse-engineer the Canon EF lens communication protocol. Eventually I was able to remotely control the lens aperture, which was my goal. I know there's a low-level interest in this sort of thing, and I'm hoping I can make contact with people who are able to fill in some of the gaps.

Obviously Sigma, Tamron, Tokina etc. have reverse-engineered the protocol, but also niche companies such as Redrock Micro (external link) and Birger (external link). Since the protocol is over 20 years old I was surprised to find little detailed information online.

I've attached an example of my experimental set-up, one that accesses the lens pins via a modified extension tube. The microcontroller based circuit controls the lens by passing serial command/requests - essentially replacing the camera body. The data displayed on the LCD came from the lens.

For those interested, here's Canon's official statement regarding third-party lenses. It provides some insight as to why Sigma and friends sometimes get it wrong,

http://media.onecall.c​om .../Canon/3rdPartyLens​es.pdf (external link)

I've written up my findings in a pdf. As a courtesy to Canon I asked them to what extent I can publish this 'proprietary intellectual information' online. Sadly, after 1 month, their `Legal Team' has not returned the courtesy. I won't be posting full details until I hear their opinion. I am, however, keen to hear your ideas and discuss applications.

HOSTED PHOTO
please log in to view hosted photos in full size.



LOG IN TO REPLY
sponsored links
(this ad will go away when you log in as registered member)
JeffreyG
"my bits and pieces are all hard"
JeffreyG's Avatar
15,187 posts
Gallery: 34 photos
Joined Jan 2007
Detroit, MI
Dec 11, 2010 17:26 |  #2

You do not have any 'proprietary intellectual information' so far as I can tell. You have the results of your own experimentation. I don't see what Canon can do to you if you publish it.


My personal stuff:http://www.flickr.com/​photos/jngirbach/sets/ (external link)
I use a Canon 5DIII

LOG IN TO REPLY
Jigglypuff
Member
101 posts
Joined Oct 2009
Dec 11, 2010 17:45 |  #3

Care to share the info!?! I'd love to build a similar controller with some Labview hardware I have laying around




LOG IN TO REPLY
TeamSpeed
01010100 01010011
TeamSpeed's Avatar
32,391 posts
Gallery: 63 photos
Joined May 2002
Northern Indiana
Dec 11, 2010 17:47 |  #4

You would have an issue if you took documentation from Canon on their lens design, however you figured out the messaging protocols on your own, and there isn't anything wrong with that.


Past Equipment | My Gallery (external link)

LOG IN TO REPLY
astronomerroyal
THREAD ­ STARTER
Hatchling
9 posts
Joined Mar 2009
Dec 11, 2010 17:51 |  #5

JeffreyG wrote in post #11435345external link
You do not have any 'proprietary intellectual information' so far as I can tell. You have the results of your own experimentation. I don't see what Canon can do to you if you publish it.

In my initial communications with Canon they described the EF protocol as 'proprietary intellectual information.' I'm not an expert in these matters. I just googled that term and this thread (the one we're on right now) was the 7th result.

The protocol is not extremely difficult to reverse engineer. The wikipedia entry for 'EF mount' even states that the bus is quite similar to SPI and gives pin assignments. The actual meaning of the bytes of data is not significantly encrypted/codified. The protocol is the sort of thing that, today, you could quite easily (and independently) re-invent. That said, reverse-engineering it still requires a considerable amount of data-logging and meticulous record-keeping; many evenings were spent lying in bed staring at 1s and 0s. There were also a few surprises, which added some complexity to the proceedings.




LOG IN TO REPLY
phreeky
Goldmember
3,471 posts
Joined Oct 2007
Australia
Dec 11, 2010 17:57 |  #6

I would love protocol details, if/when you decide to share.

So are you saying the pins could be wired straight to a serial port, plus a couple for power?




LOG IN TO REPLY
Green_Tea
POTN Poet
Green_Tea's Avatar
645 posts
Joined Dec 2008
Columbus, IN
Dec 11, 2010 18:08 |  #7

As an engineering student, I am both interested and impressed. But as far as applications... the most obvious ones that come to mind are the ones you reference in your post (third party lenses and mounting an EF lens on another type of body and maintaining control) Both of which have obviously been done.

The only other application i can think of would be for people who reverse mount lenses for macro work. The current procedure is to mount the lens on the body, stop down, and hold the DOF preview button while un-mounting. This freezes the aperture in stopped down position. Then the lens is reverse mounted. It is a pain not only due to the fact that it is time consuming to change settings but also because the small aperture makes for a dark viewfinder and difficulty focusing. It might be fun to design a device to sit on the exposed contacts of the reverse mounted lens and allows the user to control the aperture more easily. It wouldn't make you rich. Depending on the price there would be an extremely small to possibly non-existent market for it, but if you just need someplace to take the project next it might work for you.


6D|7D| Sigma 50mm 1.4 EX| Canon 100mm L IS macro| Canon 24-70 II L| Canon MP-E 65| 600 EX-RT| MT-24EX

LOG IN TO REPLY
macroimage
Goldmember
2,169 posts
Joined Aug 2007
Dec 11, 2010 20:01 |  #8

Green_Tea wrote in post #11435539external link
The only other application i can think of would be for people who reverse mount lenses for macro work. The current procedure is to mount the lens on the body, stop down, and hold the DOF preview button while un-mounting. This freezes the aperture in stopped down position. Then the lens is reverse mounted. It is a pain not only due to the fact that it is time consuming to change settings but also because the small aperture makes for a dark viewfinder and difficulty focusing. It might be fun to design a device to sit on the exposed contacts of the reverse mounted lens and allows the user to control the aperture more easily. It wouldn't make you rich. Depending on the price there would be an extremely small to possibly non-existent market for it, but if you just need someplace to take the project next it might work for you.

This device already exists from Novoflex:
http://www.bhphotovide​o.com ...EG/Novoflex_EOSRETR​O.htmlexternal link

It has a reverse mount for the camera and a cable to the collar to put on the "front" of your reversed lens that passes the camera contact connections to the reversed lens. This gives full in camera control as the camera thinks the lens is on normally. The Novoflex device is expensive so maybe there is a market for a simple battery operated aperture control that clips onto the end of the lens.


Photo Gear

LOG IN TO REPLY
monty28428
Cream of the Crop
monty28428's Avatar
9,931 posts
Gallery: 1 photo
Joined Jul 2007
Carolina Beach
Dec 11, 2010 20:10 |  #9

Very cool stuff astro!




LOG IN TO REPLY
Johnsoir
Senior Member
416 posts
Joined Sep 2007
Dartmouth, NS
Dec 11, 2010 20:16 |  #10

Great job, I wish I could understand any of this though!

Another use for this might be a focus motor controller for use in video modes. Possibly a remote focus controller, or even a no contact follow focus.


5D MKII w/Grip, 40D w/ Grip, 400D w/ Grip, EFs 18-55mm, 17-40 F4L, 70-200 2.8 ISL, EF 75-300 III USM, EF 50mm 1.8, EF 100mm 2.8 Macro, Pentacon Six 45mm Tilt, Composer Lens Baby, 430EX, 580EXII,....and big dreams.

LOG IN TO REPLY
phreeky
Goldmember
3,471 posts
Joined Oct 2007
Australia
Dec 11, 2010 21:23 |  #11

Johnsoir wrote in post #11436042external link
Great job, I wish I could understand any of this though!

Another use for this might be a focus motor controller for use in video modes. Possibly a remote focus controller, or even a no contact follow focus.

Yep an electronic follow focus would be kind of cool. Though it depends on whether the motor in the lens can be controlled appropriately, no good if it jitters with each adjustment.




LOG IN TO REPLY
skater911
Goldmember
skater911's Avatar
1,277 posts
Joined Dec 2006
Dec 11, 2010 22:03 |  #12

astronomerroyal wrote in post #11435322external link
A few months ago I had reason to reverse-engineer the Canon EF lens communication protocol. Eventually I was able to remotely control the lens aperture, which was my goal. I know there's a low-level interest in this sort of thing, and I'm hoping I can make contact with people who are able to fill in some of the gaps.

Obviously Sigma, Tamron, Tokina etc. have reverse-engineered the protocol, but also niche companies such as Redrock Microexternal link and Birgerexternal link. Since the protocol is over 20 years old I was surprised to find little detailed information online.

I've attached an example of my experimental set-up, one that accesses the lens pins via a modified extension tube. The microcontroller based circuit controls the lens by passing serial command/requests - essentially replacing the camera body. The data displayed on the LCD came from the lens.

For those interested, here's Canon's official statement regarding third-party lenses. It provides some insight as to why Sigma and friends sometimes get it wrong,

http://media.onecall.c​om .../Canon/3rdPartyLens​es.pdfexternal link

I've written up my findings in a pdf. As a courtesy to Canon I asked them to what extent I can publish this 'proprietary intellectual information' online. Sadly, after 1 month, their `Legal Team' has not returned the courtesy. I won't be posting full details until I hear their opinion. I am, however, keen to hear your ideas and discuss applications.


Bread board looks good, but one of my professors would have failed you. :) All wires had to be short straight lines and no bends. This reminds me of college, ahh do I miss it. Sadly no. From a electronics nerd, awesome job.


Nikon D810 l Nikon 24-120 F4 l Nikon 50 1.8 g l Fuji XT-10 l Fuji 18-55 l

LOG IN TO REPLY
rx7speed
Goldmember
1,204 posts
Joined Jun 2008
Dec 11, 2010 23:48 |  #13

lol my breadboards when I was dealing with some audio stuff would of really made you cringe. I was lazy and so had wires long dangling and all over the place. it's too much work for me to trim them nice and short and as long as it worked I was happy.


digital: 7d 70-200L 2.8 IS MKII, 17-55 2.8 IS

LOG IN TO REPLY
themadman
Cream of the Crop
themadman's Avatar
18,871 posts
Joined Nov 2009
Northern California
Dec 12, 2010 00:20 |  #14

Wow... I have a BS in EE and I never thought to try such a thing... too cool. When you publish your findings (which I doubt Canon can do much about, but I can ask about that if you want, feel free to PM or email me, I am in law school currently) I want to be first in line to read them!


Will | WilliamLiuPhotography.​comexternal link | Gear List and Feedback | CPS Member | Have you Pre-Ordered Your 3Dx Yet? | HorusBennu Discussion | In honor of Uncle Steve, thanks for everything! 10-5-2011

LOG IN TO REPLY
Erik_L
Goldmember
3,160 posts
Joined Oct 2009
Minnesota
Dec 12, 2010 01:06 |  #15

+1 for the electronic follow focus. Also, the reverse mounting macro-ma-bob requires no engineering at all, it just connects the pins to wires and then re-connects them to another set of pins. That price is stupid - high for how simple it is.


Canon EOS 1D III
Manfrotto 190X Pro B w/324RC2 "Action Head" | Canon 580EX II
Sigma 20 f/1.8 | Canon 35 f/1.4 L | Sigma 50 f/1.4 | Sigma 85 f/1.4 | Canon 135 f/2 L
Flickexternal linkr

LOG IN TO REPLY
sponsored links
(this ad will go away when you log in as registered member)

49,364 views & 0 likes for this thread
Reverse-engineering Canon EF lens protocol
FORUMS Canon Cameras, Lenses & Accessories Canon EF and EF-S Lenses


Not a member yet? Click here to register to the forums.
Registered members get all the features: search, following threads, own gear list and ratings, likes, more forums, private messaging, thread follow, notifications, own gallery, settings, view hosted photos, own reviews and more...


AAA

Send feedback to staff    •   Jump to forum...    •   Rules    •   Index    •   New posts    •   RTAT    •   'Best of'    •   Gallery    •   Gear    •   Reviews    •   Polls

COOKIES DISCLAIMER: This website uses cookies to improve your user experience. By using this site, you agree to our use of cookies. Privacy policy and cookie usage info.

POWERED BY AMASS 1.4version 1.4
made in Finland
by Pekka Saarinen
for photography-on-the.net
Spent 0.0038 for 4 database queries.
PAGE COMPLETED IN 0.03s
Latest registered member is Switchgear
857 guests, 461 members online
Simultaneous users record so far is 6430, that happened on Dec 03, 2017