Shop OBEX P1 Docs P2 Docs Learn Events
AW: [basicstamps] Re: serial communication — Parallax Forums

AW: [basicstamps] Re: serial communication

ArchiverArchiver Posts: 46,084
edited 2002-11-21 10:13 in General Discussion
Hi Helpers,

thanks very much, I thinbk I have to explain more clearly: the CMU cam is a
videocam that processes data by itself and gives out serial information
about the RGB deviation and so on. I am not cramming whole images into the
stamp.

I tried to use the bsx but the result is almost the same.

Some more misteries:

When I send a command, the cmu answers with "ACK". I never get this respond
when I read in the serial data. BUT when I use the stamp's WAIT command in
the serin command it passes on so there must be a ACK comming but I cannot
see it.

Another question: when I read serial data into an array, for example

INDATA VAR BYTE (10)

by using a command like

serin 2,baud,[noparse][[/noparse]str indata\4]

shouldn't I get four BYTE from the incoming stream?
Instead I get only 8 digits, so when the camera sends

23,211,8,45

I will recieve

23,2

Does this make sense to you?

Thanks for further help,

Uli



Urspr

Comments

  • ArchiverArchiver Posts: 46,084
    edited 2002-11-21 09:49
    At 10:39 AM 11/21/02 +0100, you wrote:
    >Hi Helpers,
    >
    >thanks very much, I thinbk I have to explain more clearly: the CMU cam is a
    >videocam that processes data by itself and gives out serial information
    >about the RGB deviation and so on. I am not cramming whole images into the
    >stamp.
    >
    >I tried to use the bsx but the result is almost the same.
    >
    >Some more misteries:
    >
    >When I send a command, the cmu answers with "ACK". I never get this respond
    >when I read in the serial data. BUT when I use the stamp's WAIT command in
    >the serin command it passes on so there must be a ACK comming but I cannot
    >see it.
    >
    >Another question: when I read serial data into an array, for example
    >
    >INDATA VAR BYTE (10)
    >
    > by using a command like
    >
    >serin 2,baud,[noparse][[/noparse]str indata\4]
    >
    >shouldn't I get four BYTE from the incoming stream?
    >Instead I get only 8 digits, so when the camera sends
    >
    >23,211,8,45
    >
    >I will recieve
    >
    >23,2
    >
    >Does this make sense to you?
    Sure - You asked for four characters, and you got four - where's the surprise ?
    This presumes the commas are embedded in the data. Is that the case ? You may
    want to read the data in using the DEC3 modifier. I believe that the
    appropriate one to use.

    >Thanks for further help,
    >
    >Uli

    Bruce
  • ArchiverArchiver Posts: 46,084
    edited 2002-11-21 10:13
    About your second question: If I understand you right you expect your cam
    to send:

    ASCII(23),ASCII(211),ASCII(8),ASCII(45) (string of 4 chars)

    but it sends

    "23,211,8,45" (a string of 11 chars)

    thus the first 4 characters result in "23,2" which is what you get

    did this help?
    regards
Sign In or Register to comment.