Path: utzoo!utgpu!news-server.csri.toronto.edu!bonnie.concordia.ca!uunet!wuarchive!julius.cs.uiuc.edu!apple!uokmax!munnari.oz.au!mel.dit.csiro.au!yarra!bacchus!toby!don From: don@bacchus.esa.oz.au (Don Isdale) Newsgroups: comp.sys.apollo Subject: Re: Problems using /lib/spe_pio_lib Keywords: spe library pio parallel Message-ID: Date: 31 Jan 91 07:58:51 GMT References: <1101@bacchus.esa.oz.au> Sender: news@bacchus.esa.oz.au Lines: 76 I've made some progress since my last posting, which I'll summarise because I seem to have narrowed in on one last problem :-), which may be familiar to someone. First, I want to contribute what I have learned about the SPE board, because I'm sure other people must find it tricky to use. The release notes state that above 4800bd, characters may be dropped in the sio input. I worked around this by having a separate input process for each sio; the input process waits on input, reading blocks of characters instead of single characters (to reduce overhead). Each input process pipes its output to the main process. I used TIOCSTART when starting the input process, in case flow was blocked during the previous run. The main process sometimes read null characters from the pipe (lots of fun when you null-terminate strings); I excised these and all worked fine. Occasionally the ddf of an sio becomes corrupted and emt can't open the sio; this is solved by deleting the ddf (eg /dev/spe_sio1_ddf), and remaking it with crddf. Opening the SIO-s would often block because pin 8 was floating low; opening with O_NDELAY solved this. The problems I described with pio_test appear to have been fixed by moving the SPE board adjacent to the other boards (I had installed it in the half-slot at the far end of the bus). As per the documentation, bind and inlib are not needed - dynamic loading works fine. This can be monitored by doing "crddf /dev/pio -debug", which will cause loading information to be displayed when the port is opened. The problem is this: My program, which uses the PIO to drive a character printer and /systest/spe/pio_test now run, but characters are lost and the high bit is always set. pio_test sends an alphabetic sequence, and it arrives on the printer output with every second or third character missing. My colleague, Matt, converted the example program /domain_examples/spe_pio.pas to C; two problems here: firstly, the following causes a segmentation violation at line 182 of spe_$pio_status(). { status_$t status; spe_$pio_status(&status); } The other problem is that the the following doesn't work, unless the ios_$write_opt is changed to ios_$no_open_options or ios_$no_read_opt, which are useless because I want to output. st_id2 = ios_$open ( "/dev/pio", strlen("/dev/pio"), ios_$write_opt, &status ); This returns a non-zero status, and error_$std_format() outputs : "status E610D2A (DOMAIN Diagnostics)" I am using version 2.1 of the SPE software, running under 10.2 on a DN3000. Thanks for your help, Don Isdale. -- INTERNET: don@bacchus.esa.oz.au UUCP: uunet!bacchus.esa.oz.au!don Phone : (+61) (3) 819 4554 Fax : 819 5580