Page 1 of 1

Serial i/o

PostPosted: November 6th, 2014, 10:15 am
by ke6mji
How would one go about using serial port 2 and basic to talk to an external serial device, i.e. basic stamp picaxe etc? I assume the basic commands out and inp are used for this? Has anyone documented the procedure for this? Do I need to turn off hardware handshaking?

When I hooked my “o” scope to the data line of serial port 2 (addresses 006,007 2400 baud) and send data using “out” in basic, there is no data output, just ambient noise.
Obviously I am not an expert in using serial i/o!
Thanks in in advance for any insight.

Re: Serial i/o

PostPosted: November 6th, 2014, 6:55 pm
by AltairClone
You could do something like this:
Code: Select all
10 PRINT "Enter string to echo";
20 INPUT ECHO$
30 LECHO=LEN(ECHO$)
40 IF LECHO=0 THEN END
50 FOR I=1 TO LECHO
60 WAIT 6,128,255
70 OUT 7,ASC(MID$(ECHO$,I,1))
80 NEXT I
90 ECHO$=""
100 GOTO 10


This assumes the SIO board at I/O address 6/7 like you mentioned. If instead you wanted to write through the second port on a 2SIO board, for example, replace 60 with "WAIT 18,2" and on line 70 use "OUT 19..."

Mike

Re: Serial i/o

PostPosted: November 7th, 2014, 8:50 am
by ke6mji
Thanks Mike, I'll give that a try and let you know how this works out.
Thanks again.

Re: Serial i/o

PostPosted: November 10th, 2014, 9:52 am
by ke6mji
Got it working... images/icons/smile/mrgreen.gif

Thanks again!