PINK Communication Problems (with AtomPro)
Posted: Fri Dec 17, 2010 9:27 am
All,
I am currently trying to interface the PINK Parallax NetBurner (#30013) module with my AtomPro. I was able to set up and configure the module with little to no effort (via Ethernet). Then I connected it to my AtomPro and had no problems sending it commands: SEROUT TX, Baud, ["!NB0W01:",dec3 150,0]
The only thing I could never get working was the AtomPro to receive anything from the PINK module.
Below is my code (sample code):
The PINK has its own power supply 5V while the AtomPro has a fresh 9V battery. I would assume everything is hooked up like it should (seeing as I am able to send commands). When I run the code in debug mode it will hang up on the "SERIN" command and never continue on (unless I add the timeout bit to it or use baud of N9600 but no data gets recieved).
Now I am able to monitor the communication via telnet and this is what I see:
Diagnostic display of Stamp to Netburner I/O
type logout to exit the monitoring session
Received from stamp:[!NB0W01:150<CLS>]
Set Var [01 to [150]]
Received from stamp:[!NB0R01]
Read Var [01] value is [150]
Send to Stamp:[150<CLS>]]
Received from stamp:[1]
Received from stamp:[5]
Received from stamp:[0]
Received from stamp:[<CLS>]
I have tried I9600 and I2400 baud rates but no success... I even tried alternate pins (P12 and P13 instead of P14 and P15) on the AtomPro board but still no luck. Do I have a bad module or am I missing something? Why does it say "Received from stamp:[data]" repeated back to me?
Any help would be much appreciated!
Thanks,
-Jp-
I am currently trying to interface the PINK Parallax NetBurner (#30013) module with my AtomPro. I was able to set up and configure the module with little to no effort (via Ethernet). Then I connected it to my AtomPro and had no problems sending it commands: SEROUT TX, Baud, ["!NB0W01:",dec3 150,0]
The only thing I could never get working was the AtomPro to receive anything from the PINK module.
Below is my code (sample code):
Code: Select all
' -----[ I/O Definitions ]-------------------------------------------------
RX CON P14 ' Serial Receive Pin --> PINK.TX
TX CON P15 ' Serial Transmit Pin --> PINK.RX
' -----[ Constants ]-------------------------------------------------------
Baud CON I2400 ' 2400 bps (BS2)
' -----[ Variables ]-------------------------------------------------------
index VAR Byte ' Index Variable
nbvar VAR Byte(16) ' PINK Data Variable Array
' -----[ Program Code ]----------------------------------------------------
Main:
SEROUT TX, Baud, ["!NB0W01:",dec3 150,0] ' Command To Read Variable 04
GOSUB ReadString ' Read PINK String Data
' serout S_OUT,i9600,[STR nbvar\15]
DEBUG [STR nbvar\15]
SEROUT TX, Baud, ["!NB0R05"] ' Command To Write Variable 05
GOSUB ReadString ' Read PINK String Data
' serout S_OUT,i9600,[STR nbvar\15]
DEBUG [STR nbvar\15]
SEROUT TX, Baud, ["!NB0R06"] ' Command To Write Variable 06
GOSUB ReadString ' Read PINK String Data
' serout S_OUT,i9600,[STR nbvar\15]
DEBUG [STR nbvar\15]
END
' -----[ Subroutines ]-----------------------------------------------------
ReadString:
nbvar=0
' SERIN RX, Baud, 100000, Timeout, [STR nbvar\20\0]' Get Data With Timeout
SEROUT TX, Baud, ["!NB0R01"]
SERIN RX, Baud,[DEC2 nbvar,STR nbvar\20\0]' Get Data With Timeout
SEROUT S_OUT,i9600, [STR nbvar\20]
RETURN
Timeout:
DEBUG ["Communication Timeout!"] ' Serial Timeout
END
Now I am able to monitor the communication via telnet and this is what I see:
Diagnostic display of Stamp to Netburner I/O
type logout to exit the monitoring session
Received from stamp:[!NB0W01:150<CLS>]
Set Var [01 to [150]]
Received from stamp:[!NB0R01]
Read Var [01] value is [150]
Send to Stamp:[150<CLS>]]
Received from stamp:[1]
Received from stamp:[5]
Received from stamp:[0]
Received from stamp:[<CLS>]
I have tried I9600 and I2400 baud rates but no success... I even tried alternate pins (P12 and P13 instead of P14 and P15) on the AtomPro board but still no luck. Do I have a bad module or am I missing something? Why does it say "Received from stamp:[data]" repeated back to me?
Any help would be much appreciated!
Thanks,
-Jp-