Shop OBEX P1 Docs P2 Docs Learn Events
Problem interfacing a BS2sx with Birger ef232 lens controller — Parallax Forums

Problem interfacing a BS2sx with Birger ef232 lens controller

Bob GruenBob Gruen Posts: 1
edited 2007-02-06 16:35 in BASIC Stamp
I am trying to interface a BS2sx with Birger Engineering's ef-232 lens controller to drive a Canon lens.

http://www.birger.com/Merchant2/merchant.mvc?Screen=ef232_home

Currently, I can communicate between the BS2sx and a Hyperterm session, the lens controller and a Hyperterm session, but when I plug the lens controller into the stamp I get nothing.· I have used the programming port as well as a pair of pins as directed by the manual (w/ 22k ohm resistor)

I·also added a second DB9 connector to the programming port to snoop what was happening.· While snooping, I can see the commands being sent from the stamp to the controller, but there is no acknowledgement.· If I type the same commands into the hyperterm window the lens controller responds, but the stamp does not pick·up the reply.

Is there any type of initialization sequence for serial communication?· Is Hyperterm doing something I don't know about?

It may be a serial frame alignment issue; I do not believe the lens controller has a UART.· I turned the com speed down to 2400 to test this but·the problem persists.· I also·tried using straight decimal·numbers instead of formatted variables to try to minimise the overhead while communicating.·Several blocks of my code appear below.· These blocks of code all function if I emulate the lens controller using Hyperterm.· (Although I used Baud192 as a baudrate var, I did turn it down to 2400.)

Is adding a UART my answer?· I think I understand how I can load the outbound ascii characters and 'fire them' as a group, but Im not sure about the recieving method.· The Lens controller only uses 3 wires, Tx Rx and ground; no flow control seems to be provided.

Any suggestions would be appreciated as Birger Engineering is currently relocating offices and is unreachable.

··· Thanks for helping a newbie

······ Bob

Move Focus to Infinity

PAUSE 2000· ' send "mi", CR
SEROUT LCD, Baud96, [noparse][[/noparse] 109, 105, 13 ]
SEROUT TxD, SBaud, [noparse][[/noparse] 109, 105, 13 ]

End

Identify the size and f-stop of lens
-
- Controller response to 'id' should be:
- OK
- 50mm,f14
-

FindLens
LoopNum = Loopnum + 1
SEROUT LCD, Baud96, [noparse][[/noparse] DEC LoopNum, CR]

SEROUT ProgP, Baud192, [noparse][[/noparse] CR ]
SEROUT ProgP, Baud192, [noparse][[/noparse] "id", CR ]

SERIN ProgP, Baud192, 10000, FindLens, [noparse][[/noparse] WAIT("OK"), DEC LSize ]
SERIN ProgP, Baud192, [noparse][[/noparse]WAIT("f"), DEC LFStp ]
SEROUT LCD, Baud96, [noparse][[/noparse] 254, 66, 1 ]··· 'Backlight On for 1 Minute
SEROUT LCD, Baud96, [noparse][[/noparse] "Lens=", DEC LSize, "mm,f", DEC LFStp ]

Comments

  • stamptrolstamptrol Posts: 1,731
    edited 2007-02-06 13:07
    Bob,

    I suspect you will have to have pins 2 and 3 "cross-over" in your serial cable when the stamp is talking to the lens controller. If I understand your description, Hyperterminal is OK, both receiving and transmitting. The lens controller is OK and the stamp is OK.

    By "cross-over" I mean pin 2 on one end of the cable goes to pin 3 on the other end, and vice versa. Pin 5 goes straight through as per normal.You can make up cable or use a "null-modem" adapter to do the same thing.

    Cheers,

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Tom Sisk

    http://www.siskconsult.com
    ·
  • allanlane5allanlane5 Posts: 3,815
    edited 2007-02-06 14:17
    http://forums.parallax.com/showthread.php?p=620891

    See the above for the "DTE" vs "DCE" discussion. Bottom line -- yes, you need a DB-9 cable with 2 crossed to 3, 3 crossed to 2, and 5 to 5.
  • WarrlokWarrlok Posts: 77
    edited 2007-02-06 16:35
    those pinhole cams can be real dark i have 1 and 1 like this (mine r 800mw and 200 mw ) this kind has alot better picture http://cgi.ebay.com/2-4G-Wireless-NIGHT-VISION-Color-SPY-Camera-WATERPROOF_W0QQitemZ180082539151QQihZ008QQcategoryZ48632QQrdZ1QQcmdZViewItem·its only good for 100m (mine r good for 300m and 1000m)but mine where more expensive well then there the new usb host controller you could use ur webcam ,,,and a laser·mouse and a printer (?) ohhh the possibilities ...http://www.vinculum.com/prd_vnc1l.html·heres one of the chips havent been able to find a appmod or dongle yet let me know if u do

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Problems are the "roads" of life,
    solutions are only "onramps" to the next problem



    ············································· "Brad Smith"
    ·
Sign In or Register to comment.