Shop OBEX P1 Docs P2 Docs Learn Events
pin assignment — Parallax Forums

pin assignment

ArchiverArchiver Posts: 46,084
edited 2003-05-21 16:43 in General Discussion
Pretty much a newbie. Working on a project where I am learning from
pouring over the code of someone's project that is pretty similar.

He defines his pins using the CON constants. No problem there. But
he does this:

'****************************
'* BS2 Pin Definitions *
'****************************
' con 0 '
TNC_Out con 1 'data to TNC
TNC_In con 2 'data from TNC
GPS_In con 3 'data from GPS
GPS_Out con 4 'data to GPS
RH con 5 'data from relative humidity
Servo con 6 'data to servo controller
Stretch con 7 'data to stretcher
' con 10 '
GM con 11 'count from GM
CLK con 14 'clock line
DATA_IO con 15 'data line
RS232_Port con 16 'RS232 line


Here he is defining the pins as in p0-p15, correct? But he has a pin
16. How is that?

Like I say... I am a newbie. Thanks.

Comments

  • ArchiverArchiver Posts: 46,084
    edited 2003-05-21 15:50
    Pin 16 is the serial port you talk to the PC with during programming and
    with debug windows.

    Original Message

    > Pretty much a newbie. Working on a project where I am learning from
    > pouring over the code of someone's project that is pretty similar.
    >
    > He defines his pins using the CON constants. No problem there. But
    > he does this:

    > RS232_Port con 16 'RS232 line
    >
    >
    > Here he is defining the pins as in p0-p15, correct? But he has a pin
    > 16. How is that?
  • ArchiverArchiver Posts: 46,084
    edited 2003-05-21 15:54
    In a message dated 5/21/2003 10:52:19 AM Eastern Daylight Time,
    kingfm@y... writes:

    > Here he is defining the pins as in p0-p15, correct? But he has a pin
    > 16. How is that?
    >

    Pin 16 should not be defined. This is the hardware pin for debugging or
    serin/serouting to the debug screen.

    Sid


    [noparse][[/noparse]Non-text portions of this message have been removed]
  • ArchiverArchiver Posts: 46,084
    edited 2003-05-21 16:43
    He is most likely defining that in order to use it for serial communications
    to a PC or what ever serial device the program maybe running. Even though
    it's the pin used for programming the stamp allows you to use it as well...
    but you can only use it for RS232 serial communications.

    I'd recommend you check out the stamp manual page 273 and 293 (or according
    to acrobat page 275 and 295) read the TPin and FPin parts of the serin and
    serout sections.
    http://www.parallax.com/Downloads/Documentation/bs/BASIC_Stamp_Manual_v2-0.p
    df

    If you specify pin 16 in either serin or serout the stamp will use it's
    dedicated serial pins (physical pin 1 and 2).

    Chris Shuster

    Original Message
    From: "Bryan" <kingfm@y...>
    To: <basicstamps@yahoogroups.com>
    Sent: Wednesday, May 21, 2003 10:49 PM
    Subject: [noparse][[/noparse]basicstamps] pin assignment


    > Pretty much a newbie. Working on a project where I am learning from
    > pouring over the code of someone's project that is pretty similar.
    >
    > He defines his pins using the CON constants. No problem there. But
    > he does this:
    >
    > '****************************
    > '* BS2 Pin Definitions *
    > '****************************
    > ' con 0 '
    > TNC_Out con 1 'data to TNC
    > TNC_In con 2 'data from TNC
    > GPS_In con 3 'data from GPS
    > GPS_Out con 4 'data to GPS
    > RH con 5 'data from relative humidity
    > Servo con 6 'data to servo controller
    > Stretch con 7 'data to stretcher
    > ' con 10 '
    > GM con 11 'count from GM
    > CLK con 14 'clock line
    > DATA_IO con 15 'data line
    > RS232_Port con 16 'RS232 line
    >
    >
    > Here he is defining the pins as in p0-p15, correct? But he has a pin
    > 16. How is that?
    >
    > Like I say... I am a newbie. Thanks.
    >
    >
    > To UNSUBSCRIBE, just send mail to:
    > basicstamps-unsubscribe@yahoogroups.com
    > from the same email address that you subscribed. Text in the Subject and
    Body of the message will be ignored.
    >
    >
    > Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/
    >
    >
    >
Sign In or Register to comment.