Bob Gruen
02-06-2007, 07:12 PM
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, [ 109, 105, 13 ]
SEROUT TxD, SBaud, [ 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, [ DEC LoopNum, CR]
SEROUT ProgP, Baud192, [ CR ]
SEROUT ProgP, Baud192, [ "id", CR ]
SERIN ProgP, Baud192, 10000, FindLens, [ WAIT("OK"), DEC LSize ]
SERIN ProgP, Baud192, [WAIT("f"), DEC LFStp ]
SEROUT LCD, Baud96, [ 254, 66, 1 ]··· 'Backlight On for 1 Minute
SEROUT LCD, Baud96, [ "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, [ 109, 105, 13 ]
SEROUT TxD, SBaud, [ 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, [ DEC LoopNum, CR]
SEROUT ProgP, Baud192, [ CR ]
SEROUT ProgP, Baud192, [ "id", CR ]
SERIN ProgP, Baud192, 10000, FindLens, [ WAIT("OK"), DEC LSize ]
SERIN ProgP, Baud192, [WAIT("f"), DEC LFStp ]
SEROUT LCD, Baud96, [ 254, 66, 1 ]··· 'Backlight On for 1 Minute
SEROUT LCD, Baud96, [ "Lens=", DEC LSize, "mm,f", DEC LFStp ]