Shop OBEX P1 Docs P2 Docs Learn Events
Where is the Pin 16 in the BS2? For Serial communication — Parallax Forums

Where is the Pin 16 in the BS2? For Serial communication

Luis_PLuis_P Posts: 246
edited 2010-09-08 10:05 in BASIC Stamp
I know my question will sounds dawn for most of you, but why everybody use pin 16 for Serout in the BS2 if the Bs2 only have P0 ~ P15 ? where is the mysterious pin 16? I don’t see it?

Gracias!

Comments

  • Mike GreenMike Green Posts: 23,101
    edited 2010-09-07 17:30
    Pin 16 is a special case that refers to the pins used for downloading programs from your PC and for debugging using your PC and the Stamp Editor (SIN and SOUT). This serial connection can be used by your program using pin 16 in the SERIN and SEROUT statements or by using the DEBUG and DEBUGIN statements. Because of the way these are wired, anything sent to the Stamp from the PC will be echoed back to the PC.
  • Martin_HMartin_H Posts: 4,051
    edited 2010-09-07 17:34
    Besides the 16 general purpose pins the basic stamp has two pins dedicated to serial communication over the programming cable. I tend to use debug and debugin to address those pins rather than their number. But I checked the manual and it is indeed pin 16.

    Update: I finally though I beat Mike Green to the punch, but I stopped and check the manual. Oh well.
  • Luis_PLuis_P Posts: 246
    edited 2010-09-07 21:55
    OK, now I know what it does, but when I do the connections BS2-PCport I need to use pin 16 as a serout?. WHERE IS THE PIN 16!!!! the bs2 has only pin0 to pin15. I'm getting into frustration. I better go sleep.
    Don't get too fancy with response please! just tell me where is the pin 16 to connect a wire to the PC.

    Gracias again.
  • Mike GreenMike Green Posts: 23,101
    edited 2010-09-07 22:13
    There is no pin 16. When you specify 16 as the pin number in a SEROUT statement or use the DEBUG statement, the serial data appears on the Stamp pin labelled SOUT. When you specify 16 as the pin number in a SERIN statement or use a DEBUGIN statement, you must supply serial data to the Stamp pin labelled SIN. In addition, SOUT and SIN use inverted data and are designed to be used with RS232 voltage levels. See the schematic for the Stamp module for the details of the interface circuit involved.

    DEBUG and DEBUGIN assume an inverted 8-bit 9600 Baud signal on SOUT and SIN. You don't have to specify any of that.
  • Luis_PLuis_P Posts: 246
    edited 2010-09-08 10:05
    Got it !
    Thats more clear. So I will say the Pin 16 means to send data connected to Sout/Sin pins in the Bs2. Good to know.

    Gratzie tutti
Sign In or Register to comment.