Shop OBEX P1 Docs P2 Docs Learn Events
Pass data through BASIC stamps? — Parallax Forums

Pass data through BASIC stamps?

ArchiverArchiver Posts: 46,084
edited 2004-03-25 15:18 in General Discussion
I got the idea the other day to try and design a robotic camera
system to track moving targets, and even pick up new targets while
panning. I decided early that the only feasible way to process the
image was to do it on a computer, and send the image data along a
serial port back to the computer. I originally planned to use the
2nd version of the CMU cam, which I could use todump frames along a
serial line at 115.2k baud. The problem is that I wanted the camera
to connect to the computer using only a single serial cable, with a
BASIC stamp as the sole serial connection to the computer. (I want
to expand on this in the future, so the BASIC stamp needs to be able
to receive and send data on the serial port as well, thinking that
the computer would just send the stamp a command, which would tell it
to request a frame from the camera, then send it to the computer.)

The main problem is to send the camera's frame data back to the
computer through the BASIC stamp. I don't have much experience
programming them, so I don't know if there is a command I'm missing
or something. I originally figured that I would just have to somehow
constantly send the data from the input lines from the camera to the
output lines on the serial port. I thought that at first, I could
just store the frame data in the RAM available, but soon discovered
that there is only a handful of bytes of RAM available. Instead, I
thought maybe to store it in ROM, but noticing that the ROM can only
survive 100,000 -1,000,000 writes, worth only a rough 9-90 hours of
lifetime without having to be replaced, at only 5fps, assuming that
the ROM can even be written to that fast.

Has anyone ever used this camera with a BASIC stamp and found a
way to pass the data to the computer efficiently? Sorry if this
seems trivial / pointless, but I am still new to this whole deal.

Comments

  • ArchiverArchiver Posts: 46,084
    edited 2004-03-25 15:00
    I thought the CMU-Cam would interface with the
    PC directly. Thus, if you use 2 serial ports,
    one can feed the PC from the camera at high speed,
    while the other issues commands to the BS2.
    (Note you can add USB-to-Serial adapters that
    'look' like local PC-ports to the PC).

    The BS2 is strictly a single-tasking beast.
    While it recieves it can't transmit, and vice-versa.
    There ARE several solutions to providing a
    separate buffered reciever chip, which then
    dumps to the BS2 when it's ready. However,
    with the CMU-cam you're talking a LOT of
    data, sent often, which means it's a lot
    of load on the BS2 (or ANY small processor)
    just to relay data. A direct connect to
    the PC would be MUCH better.


    --- In basicstamps@yahoogroups.com, "gravychicken" <JBMBLB@d...>
    wrote:
    > I got the idea the other day to try and design a robotic camera
    > system to track moving targets, and even pick up new targets while
    > panning. I decided early that the only feasible way to process the
    > image was to do it on a computer, and send the image data along a
    > serial port back to the computer. I originally planned to use the
    > 2nd version of the CMU cam, which I could use todump frames along a
    > serial line at 115.2k baud. The problem is that I wanted the
    camera
    > to connect to the computer using only a single serial cable, with a
    > BASIC stamp as the sole serial connection to the computer. (I want
    > to expand on this in the future, so the BASIC stamp needs to be
    able
    > to receive and send data on the serial port as well, thinking that
    > the computer would just send the stamp a command, which would tell
    it
    > to request a frame from the camera, then send it to the computer.)
    >
    > The main problem is to send the camera's frame data back to the
    > computer through the BASIC stamp. I don't have much experience
    > programming them, so I don't know if there is a command I'm missing
    > or something. I originally figured that I would just have to
    somehow
    > constantly send the data from the input lines from the camera to
    the
    > output lines on the serial port. I thought that at first, I could
    > just store the frame data in the RAM available, but soon discovered
    > that there is only a handful of bytes of RAM available. Instead, I
    > thought maybe to store it in ROM, but noticing that the ROM can
    only
    > survive 100,000 -1,000,000 writes, worth only a rough 9-90 hours of
    > lifetime without having to be replaced, at only 5fps, assuming that
    > the ROM can even be written to that fast.
    >
    > Has anyone ever used this camera with a BASIC stamp and found a
    > way to pass the data to the computer efficiently? Sorry if this
    > seems trivial / pointless, but I am still new to this whole deal.
  • ArchiverArchiver Posts: 46,084
    edited 2004-03-25 15:05
    BTW, it occurred to me that you 'really' only
    need 5 wires -- BS2_TX, BS2_RX, CMU_TX, CMU_RX,
    and GND. You could use a single cable to send
    both the CMU data AND the BS2 data. You'd have
    to wire custom DB-9's at both ends, but you'd
    wind up with one cable in the middle.

    --- In basicstamps@yahoogroups.com, "Allan Lane" <allan.lane@h...>
    wrote:
    > I thought the CMU-Cam would interface with the
    > PC directly. Thus, if you use 2 serial ports,
    > one can feed the PC from the camera at high speed,
    > while the other issues commands to the BS2.
    > (Note you can add USB-to-Serial adapters that
    > 'look' like local PC-ports to the PC).
    >
    > The BS2 is strictly a single-tasking beast.
    > While it recieves it can't transmit, and vice-versa.
    > There ARE several solutions to providing a
    > separate buffered reciever chip, which then
    > dumps to the BS2 when it's ready. However,
    > with the CMU-cam you're talking a LOT of
    > data, sent often, which means it's a lot
    > of load on the BS2 (or ANY small processor)
    > just to relay data. A direct connect to
    > the PC would be MUCH better.
    >
    >
    > --- In basicstamps@yahoogroups.com, "gravychicken" <JBMBLB@d...>
    > wrote:
    > > I got the idea the other day to try and design a robotic
    camera
    > > system to track moving targets, and even pick up new targets
    while
    > > panning. I decided early that the only feasible way to process
    the
    > > image was to do it on a computer, and send the image data along a
    > > serial port back to the computer. I originally planned to use
    the
    > > 2nd version of the CMU cam, which I could use todump frames along
    a
    > > serial line at 115.2k baud. The problem is that I wanted the
    > camera
    > > to connect to the computer using only a single serial cable, with
    a
    > > BASIC stamp as the sole serial connection to the computer. (I
    want
    > > to expand on this in the future, so the BASIC stamp needs to be
    > able
    > > to receive and send data on the serial port as well, thinking
    that
    > > the computer would just send the stamp a command, which would
    tell
    > it
    > > to request a frame from the camera, then send it to the computer.)
    > >
    > > The main problem is to send the camera's frame data back to
    the
    > > computer through the BASIC stamp. I don't have much experience
    > > programming them, so I don't know if there is a command I'm
    missing
    > > or something. I originally figured that I would just have to
    > somehow
    > > constantly send the data from the input lines from the camera to
    > the
    > > output lines on the serial port. I thought that at first, I
    could
    > > just store the frame data in the RAM available, but soon
    discovered
    > > that there is only a handful of bytes of RAM available. Instead,
    I
    > > thought maybe to store it in ROM, but noticing that the ROM can
    > only
    > > survive 100,000 -1,000,000 writes, worth only a rough 9-90 hours
    of
    > > lifetime without having to be replaced, at only 5fps, assuming
    that
    > > the ROM can even be written to that fast.
    > >
    > > Has anyone ever used this camera with a BASIC stamp and found
    a
    > > way to pass the data to the computer efficiently? Sorry if this
    > > seems trivial / pointless, but I am still new to this whole deal.
  • ArchiverArchiver Posts: 46,084
    edited 2004-03-25 15:18
    Using your Stamp to relay large amounts of high-speed serial data is
    just not likely to work. Assuming the data from the cam is a nearly
    continuous stream while being transmitted, your Stamp will almost
    immediately fall behind, lose sync, lose data, etc.

    I'd look at a PC-->Stamp command scheme where your Stamp then
    controls what the cam does via serial commands to the cam. The Stamp
    would also control external switching logic to determine who talks to
    the PC serial input--the Stamp or the cam.

    Regards,

    Steve
Sign In or Register to comment.