PINK Communication Problems (with AtomPro)

Community forum for discussion and support of the PINK product and development kit
Post Reply
-Jp-2
Posts: 3
Joined: Fri Dec 17, 2010 9:19 am

PINK Communication Problems (with AtomPro)

Post by -Jp-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):

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
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-
nbPink
Posts: 3
Joined: Wed Nov 24, 2010 10:44 am

Re: PINK Communication Problems (with AtomPro)

Post by nbPink »

Hello,

The telnet session is a debugging tool. From the output you provided:

- The "Received from stamp: [data]" is verification the pink received serial data. This is not a reproduction of data, it is simply the debugging tool telling you what was received.

- The "Send to Stamp:[data]" is verification serial data was sent to your device.

Based on the debugging information, it would seem the pink is sending data to your atom, but for some reason your atom is not receiving it properly. Could be wiring, coding on the atom or settings. I am not familiar with the atom, so I can't provide much guidance with the coding required to receive serial data. Is there some other device or a PC serial connection you can use to verify the atom's serial receive capability is working properly?
-Jp-2
Posts: 3
Joined: Fri Dec 17, 2010 9:19 am

Re: PINK Communication Problems (with AtomPro)

Post by -Jp-2 »

Thanks for the reply!

I will play with it this weekend and hopefully figure it out.

On another note, why does the PINK troubleshooting screen say:

Received from stamp:[1]
Received from stamp:[5]
Received from stamp:[0]
Received from stamp:[<CLS>]

To me this says that the "stamp" is sending back the info? Or is it just verbiage that should read "Stamp received:[1]....."?

Thanks,
-Jp-
-Jp-2
Posts: 3
Joined: Fri Dec 17, 2010 9:19 am

Re: PINK Communication Problems (with AtomPro)

Post by -Jp-2 »

I FINALLY GOT IT TO WORK!!! WAHOOO!

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
Post Reply