Date: Wed, 16 Aug 2000 10:50:04 +0300 (IDT) From: Eli Zaretskii X-Sender: eliz AT is To: Florent cc: djgpp AT delorie DOT com Subject: Re: read a character string from a serial port ...... In-Reply-To: <8ncd7g$18p$1@nets3.rz.RWTH-Aachen.DE> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Reply-To: djgpp AT delorie DOT com Errors-To: nobody AT delorie DOT com X-Mailing-List: djgpp AT delorie DOT com X-Unsubscribes-To: listserv AT delorie DOT com Precedence: bulk On Tue, 15 Aug 2000, Florent wrote: > while (inportb(b+STATUS) & 1) { > inportb(b+STATUS); > string[i] = inportb (b); > i++; > string[i]=NULL; > delay(1); > }; Why are you delaying the execution for 55 milliseconds (1 clock tick)? That's a very long time, and will surely cause you lose characters for any baudrate above 180. The default baudrate is 9600, which is *way* higher. Instead of calling `delay', simply make the program loop until a character arrives (there's a certain bit in the UART that tells that).