Shop OBEX P1 Docs P2 Docs Learn Events
Stamp to AtomPro Serial Problems — Parallax Forums

Stamp to AtomPro Serial Problems

SethPMSethPM Posts: 6
edited 2009-08-14 17:20 in BASIC Stamp
Here is my code.

I simplified everything to the basics and took everything else out just so I could do this.
Note that without using the flow control this worked but I need the flow control for my application.
So any ideas why this doesn't work the people at BasicMicro are at a loss on their end of it.

Stamp Side:

' {$STAMP BS2px}
' {$PBASIC 2.5}
' {$PORT COM3}


BeginFreq VAR Byte

Main:
BeginFreq = 19
SEROUT 8\9,188,[noparse][[/noparse]BeginFreq]
GOTO Main

AtomPro Side:

BeginFreq VAR Byte

Main:
SERIN 6\7,N19200,[noparse][[/noparse]BeginFreq]
DEBUG [noparse][[/noparse]DEC BeginFreq,13]
GOTO Main

I also simplified the circuit to be just the two controllers.

IMG_0279.jpg


Here is my output on the scope the yellow trace is the serial data and the blue trace is the flow control.

IMG_0280.jpg

Comments

  • Mike GreenMike Green Posts: 23,101
    edited 2009-08-12 18:49
    The scope tracing is odd. I would expect a start bit (0) followed by 1 / 1 / 0 / 0 / 1 / 0 / 0 / 0 followed by a stop bit (for the byte value 19). What I see is a start bit followed by 0 / 1 / 0 / 1 / 0 / 0 / 0 / 0 followed by a stop bit. I also see that the handshake signal is short. I would normally expect that it would be active until the stop bit when the character is complete. That may be OK, I just don't know.
  • SethPMSethPM Posts: 6
    edited 2009-08-13 14:14
    Yep I noticed this also the problem is it only does that when I use a flow control pin otherwise the data comes through just fine.
  • SethPMSethPM Posts: 6
    edited 2009-08-14 17:20
    Just FYI I couldn't get it to work no matter what but here is a solution if anyone else ever needs to do this but It seems the serial between the BasicAtom Pro and the BS2px are not compatible with flow control and without it the timing is to unreliable. This is how I did it without using the serial at all....

    Stamp Side

    ' {$STAMP BS2px}
    ' {$PBASIC 2.5}
    ' {$PORT COM3}

    OUTPUT 5
    OUTPUT 9
    INPUT 15

    DataOut VAR Byte
    CountOut VAR Byte

    OUT5 = 0
    OUT9 = 0
    CountOut = 0

    Main:
    DataOut = 100
    PAUSE 1000
    OUT9 = 0
    OUT5 = 1
    PAUSE 2
    FOR CountOut = 1 TO DataOut STEP 1
    OUT9 = 1
    OUT9 = 0
    NEXT
    OUT5 = 0
    CountOut = 0
    GOTO WaitLoop

    WaitLoop:
    IF IN15=1 THEN
    GOTO Main
    ELSE
    GOTO Main
    ENDIF
    GOTO Main

    AtomPro Side

    INPUT 0
    INPUT 6
    OUTPUT 7

    DataIn VAR BYTE

    LOW 7

    Main:
    DataIn = 0
    IF IN0 = 0 THEN
    GOTO Main
    ELSE
    GOTO CountLoop
    ENDIF
    GOTO Main


    CountLoop:
    COUNT P6,40,DataIn
    HIGH 7
    PAUSE 100
    LOW 7
    GOTO Data

    Data:
    IF DataIn = 100 THEN
    HIGH 1
    PAUSE 1000
    GOTO Main
    ELSE
    LOW 1
    GOTO Main
    ENDIF
    GOTO Main
Sign In or Register to comment.