Shop OBEX P1 Docs P2 Docs Learn Events
SERIN Help — Parallax Forums

SERIN Help

izulustudiosizulustudios Posts: 6
edited 2011-04-19 05:06 in BASIC Stamp
Hello all.
I am trying to get my Stamp to talk to an appliance that is controlled by 232 via a standard serial cable.
It states that the com settings should be:
Baud: 19200
Data Bits: 8
Parity: None
Stop Bits 1
Flow Control: None

I have been able to control it no problem using ascii commands trough a Hyperterminal in Windows using those settings, however I have been so far unable to control the thing with the stamp.
I'm hoping to use SEROUT Pin 16 (ie pin 1 of the stamp) as I have a previously made harness with an MAX 232 ic and caps etc, wired in to output 232 through the Sout, Sin, ATTN and vss pins.
My command reads something like:

IF (IN0=1) THEN

SEROUT 16, 32, ["ascii-blah-blah-blah"]

ENDIF


I arrived at Baudmode 32 by using the BS2 Baudmode calculation in my command and Syntax Refernce manual.
I have also tried Baudmode 16416, with no success.
Am I calculating the Baudmode incorrectly?
Am I not accounting for Stop Bits or some other Variable?

HAve I got completely the wrong end of the stick with what I'm doing?
Any further help appreciated.

Thanks again.

Comments

  • stamptrolstamptrol Posts: 1,731
    edited 2011-04-19 05:06
    I see the current Helpfile table doesn't go to 19200 baud, but your calculation of 32 sounds about right. You could check that by feeding the serial signal into Hyperterminal.

    Use pin 16, do not use the MAX232 ic as pin 16 already has the level shifting. However, if your appliance does not have a full implementation of RS232, the Stamp may not be getting the negative voltage it needs from the appliance serial port.

    If that proves to be the case, use the MAX232 and select two other pins to be the Tx and Rx. Also, be aware that it is common to have to interchange the Tx and Rx pins to get Tx at one device to line up with Rx at other, and vice versa.

    Also note that the Stamp may be able to transmit at 19.2 K baud, but receiving at that speed will be iffy.
Sign In or Register to comment.