Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!tut.cis.ohio-state.edu!ucbvax!hoptoad!tim From: tim@hoptoad.uucp (Tim Maroney) Newsgroups: comp.sys.mac.programmer Subject: Re: Serial Driver Query Message-ID: <6500@hoptoad.uucp> Date: 12 Feb 89 10:25:41 GMT References: <2411@masada.cs.swarthmore.edu> Reply-To: tim@hoptoad.UUCP (Tim Maroney) Distribution: na Organization: Eclectic Software, San Francisco Lines: 37 In article <2411@masada.cs.swarthmore.edu> jackiw@swatsun.UUCP () writes: >I don't know diddly about asynch serial I/O, but recently I've been >requested to write a simple throughput program which reads commands from >a Sperry animation system (at its maximum speed, 9600baud), translates >them, and spits them out to a Sony BVU 950 video editing deck (at its >minimum speed, 38400 baud). Currently, we have a PC whose SOLE PURPOSE >is to do this task, and I can free that up by doing a Mac version as a >background (hook'd, not multifinder) task on our File Server mac, which is >on all the time. Hmm, good luck on doing it in the background; that's a lot of work for an 8MHz 68000 with its 16-bit data bus to handle. 9600 baud seems to push the Mac to its limits. Of course, you won't be drawing to the screen, which will help, but still, you might want to do a "proof of concept" before spending your time on the whole program. You might wind up slowing things down so much that it might as well be a foreground task. >I've taken a glimpse through IM II-249, and it seems like a piece of cake, >but I thought I'd ask if anyone can foresee complications right off the bat. >Specifically, I notice that the serConfig constants include baud9600 and >baud19200 and baud57600, but no baud38400. MY QUESTION IS: If I use the >csCode=13 csParam=38400 to set the baud rate manually, will it give me >38400 baud or will it bump my requested 38400 to its nearest serConfig >(i. e. 19200 or 57600)? You can find out very easily with a ten line or so program. IM says: "The closest baud rate that the Serial Driver will generate is returned in csParam." So try the control call you've suggested and check the csParam return value. My guess is it'll get bumped to 19.2 Kbaud or 57.6 Kbaud; there's probably an internal switch on the constants listed under SerReset; but don't take my word for it. -- Tim Maroney, Consultant, Eclectic Software, sun!hoptoad!tim "I wouldn't work for Dukakis if my life depended on it. I've worked for Greeks and I know just how filthy and stinking they can be." -- Caller, KGO-AM, 8 Nov 88