Problem interfacing a BS2sx with Birger ef232 lens controller
Bob Gruen
Posts: 1
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 ]
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
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
·
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.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Problems are the "roads" of life,
solutions are only "onramps" to the next problem
············································· "Brad Smith"
·