Shop OBEX P1 Docs P2 Docs Learn Events
for the serout command, i need max 232 ??? — Parallax Forums

for the serout command, i need max 232 ???

DemoncleanerDemoncleaner Posts: 17
edited 2006-05-25 01:44 in BASIC Stamp
Hi all,


I use a BASIC Stamp board (2001) with PIC 16C57C, and i am trying to send "hello" on my hyper terminal. To programm my board i need to connect it with the serial port (COM).
So, to send "hello" to hyper terminal i used an example from the BASIC Stamp editor database, "SERIN_SEROUT1.BS2". The default pin of this example is PIN 1. Should i make a board with max 232 or should i use another pin for the serout command???

Comments

  • Chris SavageChris Savage Parallax Engineering Posts: 14,406
    edited 2006-05-24 22:38
    Since you're already connected to the computer through the serial cable why not use the programming port?· Set your PIN number to 16, which refers to the Programming Port.· You only needa MAX232 or other RS-232 driver if you're using one of the main 16 I/O pins.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Chris Savage
    Parallax Tech Support
    csavage@parallax.com
  • DemoncleanerDemoncleaner Posts: 17
    edited 2006-05-24 22:46
    I am trying to use the PIN 16 but i get the error "Pin number must be 0 to 15".
    Is there another pin that could i use for this command??
  • Chris SavageChris Savage Parallax Engineering Posts: 14,406
    edited 2006-05-24 23:55
    Please post your code...At least the line that is giving you the error.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Chris Savage
    Parallax Tech Support
    csavage@parallax.com
  • DemoncleanerDemoncleaner Posts: 17
    edited 2006-05-25 00:05
    SO PIN 16 ' serial output
    FC PIN 0 ' flow control pin
    Main:
    DO
    SEROUT SO\FC, Baud, [noparse][[/noparse]"Hello!", CR] ' send the greeting
    PAUSE 2500 ' wait 2.5 seconds
    LOOP ' repeat forever
    END

    But the error said that i couldn't use the pin 16...as you told me before [noparse]:([/noparse]
    The baud rate is set at 38k4.
  • Chris SavageChris Savage Parallax Engineering Posts: 14,406
    edited 2006-05-25 00:35
    That's because you're trying to define a Flow Control pin and you cannot do that on the programming port.· If you require that you will need to use general I/O pins and a level shifter/driver such as the MAX232.· Just to communicate back and forth between Hyperterminal you don't need flow control.


    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Chris Savage
    Parallax Tech Support
    csavage@parallax.com
  • DemoncleanerDemoncleaner Posts: 17
    edited 2006-05-25 00:53
    SO PIN 16 ' serial output
    Main:
    DO
    SEROUT SO, Baud, [noparse][[/noparse]"Hello!", CR] ' send the greeting
    PAUSE 2500 ' wait 2.5 seconds
    LOOP ' repeat forever
    END

    i tried this and i get the same error....are you sure that i could use the programming port to send ascii to my hyper terminal, WITHOUT max 232??
    I only need to send "hello" on my hyperterminal...nothing else. I should use shifter/driver such as the MAX232, or should i do it from the programming port???
    And if i could use the programming port please just send me an example because i 'm trying 3 hours now with no results
  • SSteveSSteve Posts: 808
    edited 2006-05-25 01:06
    "SO PIN 16" is an invalid statement. The BS2 only has 16 I/O pins numbered 0 to 15.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    OS-X: because making Unix user-friendly was easier than debugging Windows
  • DemoncleanerDemoncleaner Posts: 17
    edited 2006-05-25 01:11
    i know...but witch is the programming port then?
  • allanlane5allanlane5 Posts: 3,815
    edited 2006-05-25 01:29
    SEROUT 16, 16384, [noparse][[/noparse]"Hi!", CR] ' Is a valid statement

    SerPin CON 16

    SEROUT SerPin, 16384, [noparse][[/noparse]"Hi!", CR] ' Is Also a valid statement

    So, using '16' in a SEROUT statement, is a kind of 'pseudo-pin'. True, it's in the place where you'd normally put a 'pin' number indicator. However, since the BS2 doesn't actually have a pin '16', this 'pseudo-pin' in this location of a SEROUT tells the BS2 to use the 'programming port'. But it MUST be a 'number' (aka CON), not a 'PIN'.

    But, since it doesn't actually have a pin 16, declaring
    MyPin PIN 16

    Doesn't make sense to the BS2.
  • Chris SavageChris Savage Parallax Engineering Posts: 14,406
    edited 2006-05-25 01:36
    Allan is correct...I focused on the fact that you had the flow control in there and not that you were trying to use a constant for it.· I originally thought you were getting the error on the SEROUT statement, not in the pin declarations.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Chris Savage
    Parallax Tech Support
    csavage@parallax.com
  • DemoncleanerDemoncleaner Posts: 17
    edited 2006-05-25 01:44
    Man thank you very mach it works correct.....thanks thanks...
    i didn't know how to do it....
Sign In or Register to comment.