Shop OBEX P1 Docs P2 Docs Learn Events
Using a bs2 to control a hitachi block camera — Parallax Forums

Using a bs2 to control a hitachi block camera

KennyRKennyR Posts: 15
edited 2008-10-06 18:17 in BASIC Stamp
Im trying to get the bs2 to send a command to a·hitachi block camera
to get it to zoom. The hitachi block camera specs: 4800bps baud rate, 8 data
bits,1 stop bit,·even parity. The cameras communication data·consists of 8 ascii characters(8bytes)·The command im trying to send to the camera is :WFCBB99. I found the corresponding numbers for each of the ascii characters. When i·DEBUG 58, 87, 70, 67, 66, 66, 57, 57··· in the debug window i see :WFCBB99, which is what i want to send to the camera. But when i SEROUT 1, 8380, [noparse][[/noparse]58, 87, 70, 67, 66, 66, 57, 57] my camera doesnt zoom. I've tried a number of different ways and a number of different baud rates and nothing seems to work.


' {$STAMP BS2}
' {$PBASIC 2.5}



Main:

SEROUT 1,8380,[noparse][[/noparse]58,87,70,67,66,66,57,57]

Comments

  • Mike GreenMike Green Posts: 23,101
    edited 2008-10-03 18:07
    The information you've posted looks correct. There must be something about the camera's needs that you're missing.
    You'll need to provide a manual or some kind of detailed datasheet that describes how to talk to the camera.

    By the way, you can also write your statement as: SEROUT 1,8380,[noparse][[/noparse]":WFCBB99"]
  • KennyRKennyR Posts: 15
    edited 2008-10-03 18:57
    is my baud rate correct??? i used the baud rate for 7bit, even parity, 4800bps...... but the camera is 8bit, even parity, 4800bps
  • Mike GreenMike Green Posts: 23,101
    edited 2008-10-03 19:43
    It's very unusual to have a device with 8 data bits and a parity bit (for 9 bits total). They exist, but they're very rare. Most likely what they mean is a total of 8 bits per data frame of which one is an even parity bit and 7 are data bits. If you really have a 9 bit data frame, you won't be able to control it directly with a Stamp.

    Please delete your duplicate message. Use the X icon in the right hand corner of the message window.
  • Phil Pilgrim (PhiPi)Phil Pilgrim (PhiPi) Posts: 23,514
    edited 2008-10-03 19:56
    If the camera is RS232 compatible, the data will be inverted. You could try adding 16384 to your baud rate to invert the bits.

    -Phil
  • Chris SavageChris Savage Parallax Engineering Posts: 14,406
    edited 2008-10-06 18:17
    Kenny,

    Your duplicate thread on this subject was removed. Please post messages on a subject only once in the forums.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Chris Savage
    Parallax Engineering
Sign In or Register to comment.