[Search for users] [Overall Top Noters] [List of all Conferences] [Download this site]

Conference 7.286::atarist

Title:Atari ST, TT, & Falcon
Notice:Please read note 1.0 and its replies before posting!
Moderator:FUNYET::ANDERSON
Created:Mon Apr 04 1988
Last Modified:Tue May 06 1997
Last Successful Update:Fri Jun 06 1997
Number of topics:1433
Total number of notes:10312

488.0. "Serial printers How do they work?" by UKCSSE::KEANE () Mon May 22 1989 08:51

    Hi, 
    
    Last week I bought a really cheap!, I mean cheeeeap printer/plotter from a
    small add. I now realise why it was so cheap, (anyone seen any 15 inch
    wide sprocket holed roll paper?)
    However thats another problem, I can always rebuild the mechanics to
    take friction fed cut sheet, a job for the dark evenings.
    
    I tried to test it using standard paper hooked onto one side of the
    roller. The self test ran well, so I sat down and lashed up a cable.
    
    This plotter uses serial communication, with RTS as the handshake. No
    problems I thought!. I connected up, loaded in the VT52 ACC, to set the
    baud rate to 9600, and set the printer to serial using install printer.
    Loaded up STbasic, did a llist, Nothing. switched on usual parallel
    printer, did a LList - o/p still goes to parallel. funny I thought, did
    a print screen, plotter goes beserk trying to print in bitmap!
    
    This is getting serious, I sat and pondered. O.K. I thought lets be
    scientific, Using GFA I opened  the serial port as AUX and did a
    print,number1 "BLAH". great!, the plotter printed it. Right!, I
    thought, now print the "change mode to plot code", and lets draw some 
    lines. So in direct mode I drew boxes and circles and lines. My heart
    was full of joy!. Until, I decide to write a little routine to draw an
    X, Y, ordinate and graph a sine function. When I ran this the plotter
    went Ape. It ran ok one command at a time, it was obviously being 
    overrun with the print statements, there being no test routine to see if
    the plotter was ready.
    
    So I had a look through the GFA manual, the only thing I can find is an
    I/O function :- OUT?(n).
    Expln. This function returns 0 (<>0) if a character can be output. 
    
    So I stuck this in the print loop, to do a wait until ready, Still no good. 
    ran straight through the test (0 always 0)
    My questions are:-
    
    What does the OUT? test?
    
    Does anyone know how to test the CTS bit in the serial port, at a high
    level? 
    
    If I have to, is the only way, to insert a m/c code call to the Bdos? 
    
    Thanks for any advice 
    
    Pat K.
T.RTitleUserPersonal
Name
DateLines
488.1PRNSYS::LOMICKAJJeff LomickaMon May 22 1989 12:0115
Obviously the restraint flow control isn't working.

Try the following:

	- Double check the CTS/RTS connection between the printer and
	the Atari.

	- Use VT52 or other means to select baud rate AND CTS/RTS flow
	control.  Do not select XON/XOFF.

	- Without rebooting, try your basic program.

The print SET-UP frame doesn't apply to arbitrary programs, only those
programs that check the printer parameters, like PRINT-SCREEN.

488.2How does CTS control the flow?UKCSSE::KEANEMon May 22 1989 12:4923
    Hi Jeff,
    "Obviously" I had already tried all this. The Flow control was set to
    CTS/RTS, If I called the VT52 emulator ACC mode anything I typed
    on the ST keyboard was echoed on the Plotter (in printer mode). In
    printer mode it is limited to 10CPS. If I held the key down on the
    ATARI keyboard, it seemed to print OK, I dont know the rep rate of the
    keyboard, whether or not the printer was OFFing the data flow, I need a
    breakout box to check. (I ohm metered the cable several times , but I
    havnt got a scope at present)
    What I was really asking is what is the hardware/firmware arrangement of
    the CTS signals in the ST. Is there a purely hardware flow control?
    When I look at the internals book for the Atari, it appears that CTS
    and the other signals are presented as bits in the SIO status register,
    and I assume you have to monitor them in a wait for ready or interupt
    routine. 
    I know there is a BDOS call that looks at the "readiness" of the serial
    port. DOES the Atari Rom have a routine that does CTS/RTS flow control
    if you click on the relevant button on the Comms set up menu, I thought
    that the set up menu was for the VT52 emulator. How does BASIC grab
    CTS to suspend  the program, or is it done in firmware or "TOS"  
    You are the guru on Comms (WHACK) so you must have looked at this
    before.  
    
488.3ROM bug?MOVIES::FORSTERMon May 22 1989 13:067
    Wasn't there something about a ROM bug such that flow
    control on the serial port didn't work ? I think I remember this from
    "ST World" - there was also a patch to rectify problem. I will look out
    article tonight.
    
    Dave.
    
488.4Sounds like you are on the right pathPRNSYS::LOMICKAJJeff LomickaMon May 22 1989 15:3412
Well, all I do in Whack is use the Rsconf() routine to set the flow
control choice and baud rate.  I depend on the operating system to do
the actual flow control.  I have never tried using a CTS/RTS restraint
type of device, but I KNOW that XON/XOFF works.  I do all my AUX port
output with the Bios routine Bconout().

The rumor I heard was that it broke if you enabled both at the same
time. 

Also, the RTS/CTS method is not well standardized.  I have heard stories
about some company's devices using the opposite polarity than standard.

488.5ST? where is my ST?UKCSSE::KEANETue May 23 1989 04:2913
    thanks for the responses.
    
    I am borrowing a breakout box tonight and a scope at the weekend if all
    else fails. 
    I did not get round to using the m/c at all last night. After tea my
    children rushed off and "did" their homework, and when I got to the ST
    they were playing Populous again! So I nodded off in an armchair
    waiting for them to finish, I woke up in complete darkness, went to bed
    and couldnt sleep.
    If the queing goes on, I think I shall have to look for a second hand
    second machine!
    Regards
    Pat.
488.6<CTS bug>MOVIES::FORSTERTue May 23 1989 06:1714
    The OS RS232 bug should apparently lead to your ST locking-up so
    perhaps it's not what you're seeing. The bug  goes something
    like this :
    
    in CTS interrupt routine :
    
    poll: copy TransmitterStatusRegister to X
    loop: check X for 'transmit done' bit
    	  goto loop (**should be goto poll )
    
    The fix was to load in fixed routine at boot time (from AUTO) as
    a terminate-stay-resident and point the CTS interrupt vector at it.
    
    
488.7Half way there!UKCSSE::KEANEThu May 25 1989 05:4243
    
    Hi all,
    
    I put a break out box on the output socket at the back of the ST last
    night.
    If I send the plotter a string, after the plotter buffer fills RTS from
    the plotter goes away just as its supposed to!
    This now leaves two areas of investigation.
    1) The CTS input of the receiver or the multifunction chip is
    defective.
    2) The ST TOS dont handle the CTS properly.
    
    I still have a major conceptual problem with the organisation of the
    handshake. 
    Let me state what I think should happen. Please would someone comment
    on the following:
    
    a) There are three layers to this operation:-
    
    1) Physical layer. RD out from St to plotter
    		       RTS from plotter to ST, RTS is linked to CTS in
    		       cable, CTS is negated when plotter buffer full. 
    		       MFP chip has to be set up so as to allow interrupt
    		       at level 2, when CTS changes. (Configuration
    		       includes change to CTS/RTS restraint mode)
    		       		
    2) O/S level       Rom O/S has interrupt routine, (this has bug in it!)
                       Routine returns SIO status under BDOS (C_AUXOS? $13)
    		
    3) APP level (BASIC) 
    Basic outputs to Serial Port. Question, does Basic automatically wait
    for port ready on a PRINT number1,"data" statement?, (perhaps using
    routine above)
    Or do I have to test for port ready :- PORT?()
    
    Advice gratefully received.
    
    Pat Keane
    
    
    
    
     		       	
488.8DEC does it serialJGO::MEHIGHENDTue May 30 1989 11:5538
    hallo,
    
    I just stumbled over your note and I got some experience with serial
    communication using the ST.
    
    First a little request to all other ST users. If you want to talk
    about the ROM operating software please include machine rev, serial
    number or purchase date. There are many versions of the ST roms
    and it can be very confusing.
    I bought my machine in april last year and I am one rev below the
    currently shipped rev.
    
    
    I tried two serial line printer being the LA75 and the HP3660A
    (being the new Paintjet).
    
    If you set-up the control panel to RTS etc the LA75 works 
    perfectly even when doing a graphic screen dump.
    The HP has it's own graphic language and could only be put
    to work using WORDplus and modifying the printer driver as
    described in the Wordplus manual.
    Most software, especially the drawing packages, are programmed
    for the normal printer port and seem to override the CONTROL
    Panel settings.
    The out () statement in basic works oke too.
    The cable to use is as far as I can see a standard modem cable
    having a twist in 2 and 3 and 6 and 20 (connect 5and 6 together).
    Pin 7 is ground. 
    You can make a very nice cable by using a H8571-D, a H8571-A and
    a DC16A-10 cable. Only thing you have to do is cut the cable, turn
    on end of the cable 180 degrees and reconnect the loose ends (ground
    is in the middle.
    By the way, there are more versions of CONTROL.ACC available.
    
    GdJ
    
    
    
488.9THIS WEEKS EPISODEUKCSSE::KEANEMon Jun 05 1989 11:3634
    Thanks for all the preceding advice.
    
    Experimenting with the  Atari, print file resident Tos routine, (clicking
    on a text file), with the modem set up to cts/RTS and no Xon/xoff and
    printer set to serial showed some peculiar results.
    
    1) the printer starts to print at its max of 10 cps (this is a pen
    plotter drawing charcaters).
    
    2) It prints 1 and a half lines, then stops, the busy bee symbol remains
    on the screen for ever, (or until reset).
    Great, I say, this is the infamous CTS bug. So I type in the assember
    proggy from ST world. ( a new interrupt routine at vector 2). Put this
    in the Auto folder and boot up. 
    
    3) Repeat the test. Same result!!!  HUNG!!
    
    4) I put a little rude print routine in the new Interupt routine, (to see
    if the system was interupting to my new CTS/RTS handler), Nothing
    appeared on the screen except the BUZy bee when the system hung up.
    So it looks as if I am not getting a level 2 interupt to my new
    routine, or my new routine is not being used, because the new address of
    the interrupt routine is being wiped out of the MFP register, before I
    get a chance to use it. OR SOMETHING.
    
    This weeks question, gentlemen, is HOW do you trouble shoot a low level
    program that sits in the AUto folder.? How do I get a debug/trace on
    the program to watch it work (or fail)??
    
    All advice gratefully received.
    
     Anybody want a cheep printer/plotter?
    
    Pat K.
488.10MY ROM IS 1985?UKCSSE::KEANEMon Jun 05 1989 11:405
    RE .8 AND .9
    
    THE REVISION OF ROM IN MY ST IS SUCH THAT IF I BOOT UP WITHOUT SETTING
    THE DATE IT SHOWS 1985