From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 11691 invoked by alias); 11 Sep 2003 06:47:54 -0000 Mailing-List: contact ecos-discuss-help@sources.redhat.com; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: ecos-discuss-owner@sources.redhat.com Received: (qmail 11684 invoked from network); 11 Sep 2003 06:47:53 -0000 Received: from unknown (HELO londo.lunn.ch) (80.238.139.98) by sources.redhat.com with SMTP; 11 Sep 2003 06:47:53 -0000 Received: from lunn by londo.lunn.ch with local (Exim 3.35 #1 (Debian)) id 19xLFA-0006Bh-00; Thu, 11 Sep 2003 08:47:52 +0200 Date: Thu, 11 Sep 2003 13:37:00 -0000 To: eibach@gdsys.de Cc: ecos-discuss@sources.redhat.com Message-ID: <20030911064752.GK1295@londo.lunn.ch> Mail-Followup-To: eibach@gdsys.de, ecos-discuss@sources.redhat.com References: Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.3.28i From: Andrew Lunn Subject: Re: [ECOS] Timing considerations X-SW-Source: 2003-09/txt/msg00213.txt.bz2 On Thu, Sep 11, 2003 at 06:02:46AM +0000, eibach@gdsys.de wrote: > Hello, > > one of the things my eCos application has to do is to serve a serial port. Platform is an Atmel EB40A. > > The device connected to the serial port needs answers to its requests within 1 ms to work properly. > > My idea was the following: > - use the EB40A hardware driver for the serial port > - poll the driver every 1 ms using the cyg_io_read command (non-blocking) > - polling could be triggered by an alarm > - that would require a clock with a timing faster than 10 ms between ticks (which is the standard) > - so i use CYGNUM_KERNEL_COUNTERS_CLOCK_OVERRIDE_... options to set the ticks to 100 us > - then i can trigger the alarm every 10 ticks That's not the way i would do it. eCos is a soft RTOS. Make your thread doing the read from the serial port the highest priority. Let it do blocking reads. As soon as the data becomes available, the thread will be awoken, it can do its work imeadiately and respond with the answer. So long as your CPU is fast enough, it should be able to respond within 1ms. We have a system with a 233MHz StrongArm. It has to respond to an interrupt, do a lot of processing and be finished within 0.8ms. It does with 100% of the time, even when the CPU is fully loaded with other tasks. The eCos scheduler does a good job of getting higher priority threads run when they have stuff to do. Andrew -- Before posting, please read the FAQ: http://sources.redhat.com/fom/ecos and search the list archive: http://sources.redhat.com/ml/ecos-discuss