Shop OBEX P1 Docs P2 Docs Learn Events
serial communication — Parallax Forums

serial communication

readersreaders Posts: 10
edited 2008-10-17 01:17 in BASIC Stamp
I'm having troubles with the serial·communication from a stamp1 to· a desk top computor. Is there anyone out
there that has done this before. It seems like no data is being sent or recieved. any help would be helpfull
readers

Comments

  • Bruce BatesBruce Bates Posts: 3,045
    edited 2008-10-15 07:50
    readers -

    If you are trying to use the programming port for input and output as you can on a BS-2, that won't work on a BS-1. See the following note from the PBASIC Help file, or PBASIC Reference manual, regarding SERIN and SEROUT:

    "NOTE: ... The range of the Tpin argument on the BS1 is 0 - 7."

    You MUST use one of the regular pin ports (0-7) for I/O. You can use the programming port for DEBUG output, but please be aware that the format of the DEBUG output is also different between the BS-1 and BS-2. DEBUGIN is NOT supported for the BS-1.

    Regards,

    Bruce Bates

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    When all else fails, try inserting a new battery.

    Post Edited (Bruce Bates) : 10/15/2008 8:18:52 AM GMT
  • readersreaders Posts: 10
    edited 2008-10-15 14:08
    Bruce
    I found out about the programming port. I'm useing pin 7 as serial in and pin 6 as serial out. I'm useing Vbasic as the program that talks to the stamp1 and as pf now no communication betwen them. Dose Vbasic need the hand shake?
    Thank you
    readers
  • readersreaders Posts: 10
    edited 2008-10-15 22:53
    Bruce

    ·No i'm not useing programming port as serial port. I used pin 6 as serout and pin 7 as serin with no luck.

    ·I used Vbasic as the program to talk to the stamp1.

    Any ideas would be helpfull.

    Thank You

    readers
  • Mike GreenMike Green Posts: 23,101
    edited 2008-10-15 23:04
    What are you using between the BS1 and the PC? For many PCs, but not all, you can use a resistor (22K) between the BS1 input pin and the PC's output pin and a low value resistor (like 1K) between the BS1 output pin and the PC's input pin. Theoretically you could do without this latter resistor, but the 1K resistor protects the Stamp from errors on your part where you might connect the BS1 to the wrong PC pin. Look at the Stamp Basic Manual for examples.

    You'll have to post your VBasic program to get any specific suggestions. Systems like VBasic don't normally require the hand shaking lines because they're not always present. It all depends on how your program references the serial I/O routines in VBasic.
  • readersreaders Posts: 10
    edited 2008-10-17 01:17
    Dear Mike,

    This is the visual basic code I am using for serial communication to the bs1. Please let me know if this should work, or if I need more code.

    ·MSComm1.CommPort = 1
    ·MSComm1.PortOpen = True
    ·MSComm1.Settings = "2400,n,8,1"
    ·MSComm1.Output = "0"
    ·MSComm1.PortOpen = False


    Thank you,
    readers
Sign In or Register to comment.