Shop OBEX P1 Docs P2 Docs Learn Events
PINK programming problem — Parallax Forums

PINK programming problem

CheetahCheetah Posts: 26
edited 2007-10-10 14:38 in BASIC Stamp
I'm having a problem reading and writing vars to/from the PINK netburner.
I can see the device using the IPsetup program and I can display the web page and change values
and read them back. Everything seems fine.
However, when I run the sample program, PINKTestV1.0, I am unable to successfully read and write to the web variables.
I get the "failure" message because the data read back from the PINK doesn't match the data that is written.
If I read the same variable repeatedly in a loop the data comes back as 255,0,255,0.
(changing from 255 to 0 to 255 on each successive read)

I've tried different pins for RX/TX but no luck. If I disconnect one of the connections
between the stamp (bs2pe) and the PINK module i get a comm error so i know
that i'm connecting it correctly.
Anyone have any ideas as to what's wrong?

Comments

  • DgswanerDgswaner Posts: 795
    edited 2007-10-09 05:26
    I'd check the basics, are you sure you have enough power to the stamp and the pink, are your grounds tided together? make sure you pink is set to 2400 baud (or whatever your code is set to) double check that you are connecting to the right pins on the Pink, for TX and RX, try a different stamp if possible. My bet is that it's a baud rate issue.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    A complex design is the sign of an inferior designer. - Jamie Hyneman, Myth Buster
  • Chris SavageChris Savage Parallax Engineering Posts: 14,406
    edited 2007-10-09 14:41
    Can you attach the exact piece of code you’re using? There are versions for each BASIC Stamp model. Also, are you doing this from a cold start? The PINK should be powered on for >5 seconds before attempting communication with it.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Chris Savage
    Parallax Tech Support
  • CheetahCheetah Posts: 26
    edited 2007-10-09 16:34
    Here is the code I'm using. I'm am waiting at least 5 secs before attempting to communicate.
    TestBytes       DATA    $09, $55, $AA, $FF
    
    Main:
      DEBUG "Testing communication with PINK Module..."
      verify = 1
      FOR index = 0 TO 3                     ' Four Bytes
         SEROUT TX, Baud, [noparse][[/noparse]"!NB0RSI"]
         SERIN RX, Baud, [noparse][[/noparse]STR serStr\16\CLS]
         READ TestBytes + index, nbvar       ' Fetch Next Test Byte
         SEROUT TX, Baud, [noparse][[/noparse]"!NB0W00:", nbvar, CLS] ' Send To PINK GP 00
         SEROUT TX, Baud, [noparse][[/noparse]"!NB0R00"]              ' Send Command To Read Variable
         SERIN  RX, Baud, 2000, Timeout, [noparse][[/noparse]verify]  ' Get One Byte With Timeout
         IF verify <> nbvar THEN Failure     ' Check For Match
      NEXT
      DEBUG "PASSED!"
      END
    
    Failure:
      DEBUG "FAILED!"
      END
    
    Timeout:
      DEBUG "Failed!", CR, "Communication Timeout!"' Serial Timeout
      END
    
  • CheetahCheetah Posts: 26
    edited 2007-10-09 16:48
    Hey everyone,
    I got it to work. The problem was that the ground wire was faulty.
    I replaced it and everything worked fine. Only took me a whole
    day to figure that one out. [noparse]:([/noparse]

    Thanks anyway.
  • DgswanerDgswaner Posts: 795
    edited 2007-10-09 19:19
    Great! you did better than I did! I had my pink disabled in about 5 minutes of getting it. had to send it back to parallax to be fixed. but hey now I can read the manual and say hey! that warning is in there because of me!

    Glad to hear it's up and running! they are a lot of fun!

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    A complex design is the sign of an inferior designer. - Jamie Hyneman, Myth Buster
  • CheetahCheetah Posts: 26
    edited 2007-10-10 03:59
    Got the email up and working too. Fun!
    Thanks everyone.
  • Chris SavageChris Savage Parallax Engineering Posts: 14,406
    edited 2007-10-10 14:38
    Thanks for following up that your problem was solved. This often helps others later. Take care.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Chris Savage
    Parallax Tech Support
Sign In or Register to comment.