Problem with SERIN command
charler
Posts: 8
First· I use Basic Stamp 2SX. I connected P0 to my computer RX (pin 2 in DB9 female connector)· and P1 to my computer TX (pin 3 in DB9 female connector). And wired pin 5 in DB9 female to basic stamp GND.
after that
I writing a little program to send "Hello World" to computer (using Hyper Terminal). It's work fine.
the problem is·I want to send some character from my computer but nothing happend.
this is my code ( i wrote with led blinking)
I don't know how to make SERIN work. I will correct hardware or something else or not?
sorry for my bad english.
ps. I try every way·I try such as making VB and C try to sending one charactor but It's not working. The result is the same SEROUT is work but SERIN is not.
after that
I writing a little program to send "Hello World" to computer (using Hyper Terminal). It's work fine.
the problem is·I want to send some character from my computer but nothing happend.
this is my code ( i wrote with led blinking)
'{$STAMP BS2sx} '{$PORT COM1} tmpOUTL var Byte dummyByte var Byte ch var Byte DIRH = %11111111 OUTH = %00000001 baudmode con 17405 ch = "-" tmpOUTL = OUTH Main : tmpOUTL = tmpOUTL << 1 if tmpOUTL = 0 THEN Refresh BUTTON 7,1,255,250,dummyByte,1,SENDRS SERIN 0,baudmode,1000,LED_OUT,[noparse][[/noparse]ch] LED_OUT: OUTH = tmpOUTL goto Main Refresh : tmpOUTL = 1 GOTO LED_OUT SENDRS: OUTH = %11111111 SEROUT 1,baudmode,10,[noparse][[/noparse]"Basic Stamp Said : Hello World > ",ch,10,13] Goto Main
I don't know how to make SERIN work. I will correct hardware or something else or not?
sorry for my bad english.
ps. I try every way·I try such as making VB and C try to sending one charactor but It's not working. The result is the same SEROUT is work but SERIN is not.
Comments
I can see at least one path through your program which may eventuate in no read (SERIN) being done by the Stamp. May I suggest that you cut the program down tothe bare essentials, and then go from there:
DEBUG "Program Initiating"
READ:
Serin IPin, Baudmode, Timeout, [noparse][[/noparse]databyte]
SEROUT OPin, Baudmode, [noparse][[/noparse]"Stamp received ", databyte]
END
Timeout:
DEBUG "Timeout occurred"
GOTO READ
END
Or something like that.
Regards,
Bruce Bates
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
<!--StartFragment -->
ummmmm My programming skill need a lot of improve.
I use a simple code as you said.
O.K. and a little help can you explain my previous code is not usable please.
Thank you, Very much.