Shop OBEX P1 Docs P2 Docs Learn Events
Problems getting PINK and BS2 to talk to each other — Parallax Forums

Problems getting PINK and BS2 to talk to each other

FiredogbmeFiredogbme Posts: 6
edited 2005-11-17 07:18 in BASIC Stamp
I've run into a brick wall with the new PINK module and I am hoping·someone in here can help me out.· I am a relative newbie·in the·"Stamp Family", but I have been learning·fast and have been having a lot of fun in·the process.· Here is my problem:

The·PINK and the BS2 don't want to communicate with each other at all.· I am using a simple 4 wire·circuit between my USB-BOE and the PINK module, but no matter·what I have tried, I can't get the Stamp to·read from (or write to) the PINK.

The PINK talks to the ethernet just fine, and I can update and change settings and variables with no problems, although I haven't been able to send an email message yet (I'm not too worried about that yet).

The BOE/Stamp works·fine as well.· For example, it will talk to a serial LCD·using the same pins and wires as I am using with the PINK with no problems.· At this point, I·am satisfied that·the BOE/Stamp is functioning 100%.

My connections are as follows (is this correct?):

Pin 7 on BOE (SERIN) to pin 3 (TX1) on PINK
Pin 8 on BOE (SEROUT) to Pin 4 (RX1) on PINK
VSS on BOE to Pin 1 on PINK
VCC on BOE to Pin 9 on PINK

I have tried just about every baudmode setting with no luck.· Also, I just get a black screen when I try to telnet the connection, although I am not sure I am using that correctly.· My next step will be probing the serial line with a scope to see if there are indeed signals present.· Does anyone have any ideas I have missed?· I think the PINK is a great device and I am anxious to use it, but I am beginning to wonder if I have a defective device.

Thanks in advance for any advice or help you can offer, I do appreciate it.· If anyone needs more detailed info, let me know!

Comments

  • Peter VerkaikPeter Verkaik Posts: 3,956
    edited 2005-11-12 05:26
    You have access to the pink via ethernet.
    Go to the configuration page and set serial port
    parameters to 2400 baud, 8 databits, no parity, 1 stopbit
    click on submit new settings.

    In your stamp program use 2400 baud, 8bit no parity, true mode.
    Depending on your stamp type you select from the following tables

    · attachment.php?attachmentid=74051* The BASIC Stamp 2 and BASIC Stamp 2e may have trouble synchronizing with the incoming serial stream at this rate and higher due to the lack of a hardware input buffer. Use only simple variables and no formatters to try to solve this problem.

    [img]mk:@MSITStore:C:\Program%20Files\Parallax%20Inc\Stamp%20Editor%20v2.1\PBASIC.chm::/graphics/bsxp_inline.gif[/img]

    attachment.php?attachmentid=74052* The BASIC Stamp 2sx and BASIC Stamp 2p may have trouble synchronizing with the incoming serial stream at this rate and higher due to the lack of a hardware input buffer. Use only simple variables and no formatters to try to solve this problem.



    At least you have the baudrate then correct.

    regards peter
    402 x 326 - 7K
    402 x 268 - 6K
  • FiredogbmeFiredogbme Posts: 6
    edited 2005-11-13 16:38
    Thanks, Peter, I'll double check the settings to make sure they are correct.· I finally have a little time this afternoon to play with this some more, hopefully I can make some progress!

    I'll post my results (If I have any. . .shakehead.gif )



    Thanks again!
  • FiredogbmeFiredogbme Posts: 6
    edited 2005-11-14 05:29
    OK, I've made some progress, but I'm still having problems. . .

    I double checked the baudmode settings, and checked the settings on the PINK using the HTML page.· Everything is set properly.· I even downloaded the BS2 sourcecode samples from the website, just in case I made a mistake entering the code.· The code downloads to the BS2 with no probs, but the debug window opens and stays blank.

    Using the telnet function, I have determined that the BS2 is sending commands, the PINK is receiving them, and the PINK is sending a reply.· The BS2, however, is not responding.· I have not actually probed the pins to determine if the data is actually being sent; I am seeing these messages on the telnet terminal.· This seems to jive with what the debug screen is showing:· the BS2 program is "hanging" on the SERIN statment and waiting for a response from the PINK.

    Also, according to telnet and the html config page, the BS2 is successfully modifying variables on the PINK, but again the message is not getting back to the BS2.

    Is there anything I am missing here?· I have set up my system exactly like the diagram shown on the instruction doc, but do I need to include pull up/down resistors, and/or need flow control circuitry?· I'm kind of grasping at straws here, trying to figure this out.· Also, I have tried changing pins on the BS2 in order to rule out problems in the BS2 itself, but no change.

    If anyone out there has any ideas I can try, I would appreciate it very much.· I think I may have a problem PINK device, but I'd like to try everything before I send it back for a replacement (especially since they are backordered for a while!).

    Thanks!!

    Bruce
  • Peter VerkaikPeter Verkaik Posts: 3,956
    edited 2005-11-14 06:51
    I think your pink is working fine.

    Telnet tells you the pink receives commands and sends replies.

    Only the BS2 does not receive those replies. Try changing the BS2 pin

    that is used·for receive (pin7) to some other pin. It may be that

    the BS2 pin7 is damaged (also check that connection and the connection wire).

    regards peter
  • Peter VerkaikPeter Verkaik Posts: 3,956
    edited 2005-11-14 07:20
    Sorry, I missed that line where you say you already changed the BS2 pins
    without success. Do check that connection wire. It may be faulted.
    Last option would be to check the pink TX pin with a scope. That should
    show wether there is any data transmitted by the pink.
    regards peter

    ·
  • Tracy AllenTracy Allen Posts: 6,658
    edited 2005-11-14 07:22
    What variable contents are being sent to the Stamp? Maybe SERIN is expecting more data than it is receiving. Here is a modified version of a test program, set to fill a variable and then repeatedly read it. I put a 2 second timeout on the SERIN so that it won't just sit there if there is a failure.


    NBVAR VAR BYTE(16)
    tick    VAR WORD
    top:
    DO
      tick=tick+1
      SEROUT 8,396,[noparse][[/noparse]"!NB0W06:Working? ",DEC tick,CLS]  ' write the variable #6
      PAUSE 500
     
      SEROUT 8,396,[noparse][[/noparse]"!NB0R06"]   ' read variable #6
      SERIN  7,396,2000,timeout,[noparse][[/noparse]STR NBVAR\16\CLS]  ' up to 16 char or CLS, with timeout
    
      DEBUG STR NBVAR,CR
      PAUSE 2000
      tick=tick+1
    LOOP
    
    timeout:
      DEBUG "timeout error", CR
      GOTO top
    
    END
    



    Be sure the SERIN command immediately follows the SEROUT [noparse][[/noparse]!NB0R06]. Be sure there is numeral zero, not letter "O" in the command NB0R. There is certainly not a pullup resistor called for on the PINK docs. It is kind of like the Parallax Appmod protocol, but the send and receive are on two different lines. If you have a 'scope, it might be useful to probe the data line from the PINK back to the Stamp.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Tracy Allen
    www.emesystems.com
  • Ryan ClarkeRyan Clarke Posts: 738
    edited 2005-11-14 16:03
    Here is a close-up of the wiring on the PINK end:

    http://forums.parallax.com/attachment.php?attachmentid=39417

    If you are still having problems please call tech support, we'll get you an RMA if necessary.

    Ryan

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Ryan Clarke
    Parallax Tech Support

    RClarke@Parallax.com
    502 x 381 - 52K
  • FiredogbmeFiredogbme Posts: 6
    edited 2005-11-15 07:05
    First, THANKS for the responses, I appreciate the feedback!

    Peter: even though I mentioned swapping BS2 pins earlier, I double checked the pins AND the wires after your reply.· I plan to probe with a scope tomorrow morning just to be sure signals are where they belong.

    Tracy: I'll try out your program in the am as well.· I hadn't thought of including the "time out" modifier; it makes perfect sense and should help with the trouble shooting.

    Ryan: thanks for the·close-up pic.· I think I may have had the serial lines backward in the beginning, but I'm pretty sure I have them correct now.· I'll double check in the am.

    I will try a few more tricks in the morning, including 'scoping the lines, and I'll post the results back here, just in case anyone else is having similar problems.· If all else fails, I'll RMA this one and work with a new one.

    Regards!

    Bruce
  • FiredogbmeFiredogbme Posts: 6
    edited 2005-11-17 07:18
    I've finally found some time to try some of the suggestions listed here, and we've decided that we have a bad PINK module shakehead.gif

    On probing the PINK serial data lines with a scope, we have found·some strange behavior on the transmit·pin.· No matter what the stamp or the·PINK is doing, we see a constant frequency at the TX pin.· The stamp·sends a good looking data stream, and according to telnet, the PINK is responding to the requests, but the TX pin never changes at all.

    The sad part is·everything else on the PINK seems to work just fine.· I can telnet, ftp,·and access and modify settings·with the html interface.· The only other problem I've encountered is with·sending emails, and I·think it is due to my email server requiring·username and password.· So far, I haven't·found a way to send that with the PINL, but I am going to post that in another thread.

    Anyway, I·just wanted to follow up with the results, and to·say "Thanks!" to everyone who posted helpful tips and such.· I'll contact support and figure out how to RMA this thing tomorrow.

    Thanks again!

    Bruce
Sign In or Register to comment.