[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Problems setting up SSC
Kevin Millar <kmillar@ihug.co.nz> wrote:
> Thanks for pointing that out. (Ooops).
>
> Unfortunately, it hasn't fixed the problem. I am still getting the MSB set
> all the time. I have tried the SW2-7, and I played around with the SW1-5,6,7
> as well, but no luck.
The reason you are always getting the MSB set is that Applesoft BASIC
always outputs characters with bit 7 set when you using the PRINT
command.
If you want to be able to send unmodified 8-bit data, you will have to
use a small machine code routine to output a character. There are
various ways of doing this, but a simple method that is reasonably
portable (to other serial cards) is to continue to use the PR#2 command,
but rather than PRINTing each character to be output, POKE it into a
memory location, then CALL a machine code routine to output the
character.
For example:
The following subroutine (all in one line) POKEs in a small machine code
routine at memory location $0300 which outputs a character to the active
output device (set with PR#n). The character to be output is POKEd
directly into the program.
2000 FOR I = 768 TO 772: READ J: POKE I,J: NEXT: RETURN:
DATA 169, 0, 76, 237, 253
To output a single character after this routine has been set up, you
use:
POKE 769,ASC(CH$)
CALL 768
This will output the first character in CH$, with the most significant
bit clear. If you want to send a raw binary value, just POKE it
directly.
One other problem you are likely to encounter is the Super Serial Card's
automatic formatting and some command interpretation. Assuming it is
set for communication mode, it will regard anything starting with Ctrl-A
(character 1) as a command to the firmware rather than data to be
transmitted.
To turn this off, you need to send Ctrl-A followed by 'Z' (for ZAP). No
subsequent commands will be recognised, and all data is sent unmodified.
(I haven't used the SSC for a while, and I'm not sure whether the ZAP
command also turns off line wrapping, carriage return/line feed
handling, etc.)
--
David Empson
dempson@actrix.gen.nz
Snail mail: P.O. Box 27-103, Wellington, New Zealand