Shop OBEX P1 Docs P2 Docs Learn Events
Problem with usb basic stamp1 — Parallax Forums

Problem with usb basic stamp1

ErnestoErnesto Posts: 1
edited 2007-04-09 08:54 in BASIC Stamp
Hello there!
I have a problem with my usb basic stamp1. I'm using SERIN to receive a serial communication at 1200 bauds.· The problem is that when I receive something I put it in a variable and when I Debug it the result is not what I transmit to it.
·I'm trying to make a wireless communication with RF transmitters and one RF receiver. The RF receiver is now connected with the usb basic stamp1. The transmitter is connected with a PIC which makes the serial output.
When I use a simple serial connection to the computer I obtain perfect characters into the HyperTerminal, so I think that the Transmitter is transmitting very well.

The code I'm using is this
' SERIN.BS1
' {$STAMP BS1}
' {$PBASIC 1.0}
SYMBOL· SIn············ = 7
SYMBOL· Baud··········· = N1200
SYMBOL· result········· = W1

Main:
· SERIN SIn, Baud, #result
· DEBUG #result, CR
· GOTO Main
· END
THANKS!!!
SORRY FOR MY BAD ENGLISH

Comments

  • Mike GreenMike Green Posts: 23,101
    edited 2007-04-09 00:11
    It looks like you are trying to receive a continuous stream of characters and the BS1 can't do that. The BS1 (and BS2) only "listen" to the input pin while they are actually executing the SERIN statement. Once the SERIN is finished and the BS1 goes on to do the DEBUG and GOTO, it is not paying any attention to the input pin and any received characters will be ignored. There is no buffering. If you put a pause in between characters you will find that your program works. Since you are using the "#" formatter, you will find that the first value probably works because the BS1 is handling the digits all within the same statement. Once a non-digit is received, the SERIN statement finishes and the next several characters are ignored as the BS1 does the DEBUG and GOTO statements. Since the SERIN starts up again possibly in the middle of a character, it may get confused there as well and begin receiving incorrectly.
  • vikramdobalvikramdobal Posts: 2
    edited 2007-04-09 08:11
    what is the difference between the max232 and max232N???
    and what about max232CPE?
    Are thel all same ??
    can we use them as a substitute of one-another?
    plzz inform me about opinion......
    i will be very much thankful...
    ·
  • LarryLarry Posts: 212
    edited 2007-04-09 08:54
    vikramdobal said...
    what is the difference between the max232 and max232N???
    and what about max232CPE?

    The specs for different numbers and from different manufacturers are slightly different, but any Iv'e ever used have all worked.
    the main performance difference is Maximum data rate, but even the ones with the lowest specs are fast enough for a Stamp.
    E and N parts seem to have enhanced ESD protection for harsh environments, like in automobiles.


    The main "gotcha" is the size of the caps you need to use with each variant. Even then, I've used the wrong caps and the things still worked.(probably degraded the max data rate)

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Sign In or Register to comment.