PINK Comunication Problems (with AtomPro)
-Jp-
Posts: 2
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 buad rates but no success... Do I have a bad module or am I missing something? Why does it say "Received from stamp:[data]" repeated back to me?
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):
' -----[ 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
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 buad rates but no success... Do I have a bad module or am I missing something? Why does it say "Received from stamp:[data]" repeated back to me?
Comments
I hate when people never follow up with the solution to their problem so here it is:
I had 2 problems:
1. I am very new to micro controllers and electronics so my first problem was that I didn't ground both modules together (common ground). Rookie mistake.
AtomPro/Bot Board II ---> +/- 9v battery
PINK unit ---> +/- 5v power supply
Needed common ground between power sources.
This is the reason why it would spit out the following in the troubleshoot screen:
Received from stamp:[1]
Received from stamp:[5]
Received from stamp:[0]
Received from stamp:[<CLS>]
Once both modules shared a common ground it would only spit out one line:
Received from stamp:[150<CLS>]
2. For whatever reason I had to drop the baud rate all the way down to 2400 for my AtomPro. While Steve Norris (www.norrislabs.com) had no problem running it at 9600.
Well I hope this helps!
-Jp-2