Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!mnetor!seismo!rochester!cornell!batcomputer!dyon From: dyon@batcomputer.TN.CORNELL.EDU (Dyon Anniballi) Newsgroups: net.micro.amiga Subject: Sending multiple chars out serial port Message-ID: <915@batcomputer.TN.CORNELL.EDU> Date: Wed, 20-Aug-86 22:37:59 EDT Article-I.D.: batcompu.915 Posted: Wed Aug 20 22:37:59 1986 Date-Received: Thu, 21-Aug-86 04:45:13 EDT Reply-To: dyon@batcomputer.UUCP (Dyon Anniballi) Organization: Theory Center, Cornell University, Ithaca NY Lines: 45 From dyon Wed Aug 20 22:35:49 EDT 1986 (sorry if you are getting this twice, but I think it didn't make it out the first time) Hello again, As readers here might have noticed, we (hsgj and I) have detected some "irregularities" with the Amiga Kernel while writing our applications. This time, the trouble is with writing to the serial port. First, for your enjoyment, some code right from the RKM: WriteSer(io,data,length) struct IOExtSer *io; char *data; int length; { io->IOSer.io_Data = (APTR)data; /* Abridged version */ io->IOSer.io_Length = length; /* to speed typing */ io->IOSer.io_Command = CMD_WRITE; return(DoIO(io)); } Ok, this function works perfectly if "length = 1", ie if you are only writing one character out the port. However, if we are writing a known length string out the port, say "char data[5] = {'h','e','l','l','o'} " and we give data = &data[0] and length = 5, then we get maybe the first two characters received by the serial listener fine, but the rest is random garbage chars. By the way, this occurs at Baud rates as slow as 300, and with parity, stop bits, write bits identical on both ends of the serial port. At first I thought it was overwriting an output buffer, but I guess "data" points to the output buffer. So we can't figure out why we can't send the string. Our temporary solution has been to do a for loop and just send each individual char out with length = 1; this works fine. But this is not very nice at high bauds, so if anyone has any clues as to our problem, it would be appreciated. Note that this symptom appeared in Workbench v1.1. We upgraded to V1.2 beta 4 recently, but the problem still persists. Thanks much, -- JR UUCP: ihnp4!cornell!batcomputer!dyon ARPA: dyon%batcomputer@cu-arpa.ccs.cornell.edu