Stamp to AtomPro Serial Problems
SethPM
Posts: 6
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.
Here is my output on the scope the yellow trace is the serial data and the blue trace is the flow control.
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.
Here is my output on the scope the yellow trace is the serial data and the blue trace is the flow control.
Comments
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