View Full Version : Problem with usb basic stamp1

04-09-2007, 06:45 AM
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
' {$STAMP BS1}
' {$PBASIC 1.0}
SYMBOL· SIn············ = 7
SYMBOL· Baud··········· = N1200
SYMBOL· result········· = W1

· SERIN SIn, Baud, #result
· DEBUG #result, CR
· GOTO Main

Mike Green
04-09-2007, 07:11 AM
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.

04-09-2007, 03:11 PM
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...

04-09-2007, 03:54 PM
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)