Shop OBEX P1 Docs P2 Docs Learn Events
"Bridging" pins in software... Noob question — Parallax Forums

"Bridging" pins in software... Noob question

ReiserificKReiserificK Posts: 24
edited 2009-03-18 01:49 in Propeller 1
Hi everyone, I am trying to hook a CMUcam2+ up to a computer to focus it with the supplied java application. I would like to use the built in USB-Serial adapter on my Proto Board USB (pins 30 and 31) to talk to the computer. Is there a way to send the input supplied to one pin out another in software? If not, can I just connect the CMUcam serial pins to 30 and 31? This doesn't need to be a software solution, but that would be easiest for me. I thought I remembered reading something about this kind of task in the manual, but I can't find anything now that I've looked again. Also, I made an attempt at a serial proxy program using the FullDuplexSerial object, but it didn't seem to work. I'd be happy to post it if anyone wants to see it. I appreciate any advice/comments.

Thanks in advance,
ReiserificK

Comments

  • Mike GreenMike Green Posts: 23,101
    edited 2009-03-18 01:01
    You need two copies of FullDuplexSerial, one for pins 30 and 31 and the other for the pins you connect to the CMUcam.· Your program would initialize both copies of FullDuplexSerial, then use rxcheck to read from the camera like this (one object is called PC and the other is called Cam).[noparse][[/noparse]code]
    repeat
    ·· if (a := Cam.rxcheck) <> -1
    ····· PC.tx(a)
    ·· if (a := PC.rxcheck) <> -1
    ····· Cam.tx(a)[noparse][[/noparse]/code]

    If you need to interrupt this for some reason, you can add that logic to the repeat statement.

    This assumes that the Java application will need to send data back to the CMUcam.
  • ReiserificKReiserificK Posts: 24
    edited 2009-03-18 01:40
    Thanks, for the input. I tried something just like that but got a constant stream of characters that look like a y with a dot over them. Would messing up the baud rate to and from the CMUcam cause this?
  • Mike GreenMike Green Posts: 23,101
    edited 2009-03-18 01:49
    Yes.· You might have an inverted signal.· Basically, make sure that FullDuplexSerial is configured for what the CMUcam needs.
    ·
Sign In or Register to comment.