I have setup my SSC on an appleII+ (clone), played a bit with terminal login and so on. The physical switches are set to 9600 bps, 8N1. It works well, however I decided to take it a bit further and catch some json coming from the other end of the SCC. I have troubles integrating the serial data in a BASIC program. Let's assume the following string which is passed over serial:
and the following BASIC code to read this string over serial on the AppleII side:
10 print chr$(4);"IN#2"
20 GET A$
50 print j$
60 goto 20
The above code works as expected on the virtual][ when sending the string over file pipe and prints the full j$ string, however, when I run this on real hardware some bizzare things happen - only curly bracket comma and numbers appear and only fraction of the input chars show(e.g. not all numbers appear). No letters are shown at all. The sending hardware is set to 9600pbs, 8N1 just like the apple2 end.
As per Applesoft Basic manual, It might be the collon ":" in the string which breaks the GET. Same thing about the colon is stated for INPUT command. If I replace the GET with INPUT, then, the whole string appears, however INPUT requires CR at the end, hence INPUT is useless in automated data sending. If I press CR manually, the collon breaks the var (same as with GET).
So my questions is, how do I accept the full string in BASIC?
It's worth mentioning other things which I noticed. If I switch manually to Terminal mode (Ctrl-A T) the string appears fine, but it's not automated process, also BASIC can't read in terminal mode?
It seems sending chr$(1);"T" to enable Terminal mode with BASIC doesn't work. The cursor is not changing to flashing underscore.
I tried PEEK-ing the char register $27 with peek(39), as per SSC manual to get the char in the buffer, but either I'm not doing it right or it's not the way to get the chars from SCC.
I'll appreciate any help on this as it's driving me crazy for a week now :)