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

PINK problem

dberkstresserdberkstresser Posts: 5
edited 2008-11-08 21:41 in Propeller 1
I am having trouble setting web variables via the serial connection. I have a very simple test program that attempts to set two variables on the webserver but nothing happens. When I log into the PINK via telnet it shows a bunch of <CLS> and then some random characters when I run the program. I have p3 connected to TX on the PINK and p2 connected to RX.

Any help would be appreciated.

Thanks,

Dan

CON
CLS = 0

OBJ
Serial : "Extended_FDSerial"

PUB Main | Temp
Serial.start(3,2,0,9600) ' Rx,Tx, Mode, Baud
Serial.Str(string("!NB0W00:400")) 'Assign Pink Variable 00
Serial.tx(CLS)
Serial.Str(string("!NB0W01:200")) 'Assign Pink Variable 01
Serial.tx(CLS)

Here is the output from the telnet session.
Received from stamp:[noparse][[/noparse]<CLS>]
Received from stamp:[noparse][[/noparse]<CLS>]
Received from stamp:[noparse][[/noparse]<CLS>]
Received from stamp:[noparse][[/noparse]<CLS>]
Received from stamp:[noparse][[/noparse]<CLS>]
Received from stamp:[noparse][[/noparse]<CLS>]
Received from stamp:[noparse][[/noparse]<CLS>]
Received from stamp:[noparse][[/noparse]<CLS>]
Received from stamp:[noparse][[/noparse]<CLS>]
Received from stamp:[noparse][[/noparse]<CLS>]
Received from stamp:[noparse][[/noparse]<CLS>]
Received from stamp:
Received from stamp:[noparse][[/noparse]a]
Received from stamp:[noparse][[/noparse]

Comments

  • P!-RoP!-Ro Posts: 1,189
    edited 2008-11-08 21:36
    All I know is I've had the same problem myself. One variable is correct, and all the rest are random letters/symbols/digits that I didn't actually put there.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Pi Guy
  • Harrison.Harrison. Posts: 484
    edited 2008-11-08 21:41
    You must define your clock speed. If you don't then the prop will default to the internal RC clock, which is too inaccurate for reliable serial communications.

    Add the following to the top of your program (assuming you have a 5MHz xtal):
    CON
      _clkmode = xtal1+pll16x
      _xinfreq = 5_000_000
    



    You will probably also need a resistor (~1K) between the PINK TX and the Propeller RX. Otherwise the 5V logic from the PINK could overstress the Propeller and cause problems.
Sign In or Register to comment.