ts-7000
[Top] [All Lists]

[ts-7000] Re: Reading the DIO ports on TS-7800

To:
Subject: [ts-7000] Re: Reading the DIO ports on TS-7800
From: "charliem_1216" <>
Date: Fri, 08 Aug 2008 17:31:26 -0000
Hi Eric -

--- In  "Eric Robishaw" <> wrote:
>
> Charlie,
> 
> Now I'm a little confused.
> W/o the usleep I can read 20*k*hz easily.  I was expecting a maximum of

Yes, with the CPU in a tight loop.

> 100hz.  So as I understand it then, the "10ms for the process to become
> runnable again" refers to a system delay that is caused only by issuing
> sleep that evidently doesn't occur otherwise...

Here http://marc.info/?l=linux-arm-kernel&m=118789182024254&w=2 is an
attempt to explain this not-very-intuitive behaviour.  Remember that a
100 Hz clock (w/o HRT) means the scheduler only wakes runnable threads
or processes every 10 mS.

> 
> But of-course w/o a sleep, the cpu use goes way up!
> 
> *Is there any other way you know of to effectively sleep w/o killing
the cpu
> and not being impeeded by the timer resolution?*

Well, the options are:
* increase HZ in the kernel to something more than 100 Hz.  Not
recommended
* Write your own kernel module to use an available HW timer.  Hard for
mortals, not portable.
* Use HRT.  Highly recommended if available.  Portable across most
platforms & architectures, easy as rebuilding the kernel.

I looked through archived discussions here and unfortunately HRT is
not available for the TS-7800 kernel.  TS-7800 and HRT should be
available in the next  vanilla kernel release, when Alexander
Clouter's board support patches hit. (They are in 2.6.27rc2 now).  
Orion CPU is now quite well supported in mainline, but it wasn't when
TS branched their 7800 kernel.

So, sorry, looks like 50 Hz will have to do for now.  Perhaps after
2.6.27 hits someone can post a step-by-step guide to compiling a
vanilla kernel with HRT for the TS-7800, and still using the binary TS
SD card drivers.

Regards, ......... Charlie

> 
> Eric
> 
> 
> On Fri, Aug 8, 2008 at 7:54 AM, charliem_1216 <>wrote:
> 
> >   Hi Eric --
> >
> >
> > --- In  <ts-7000%40yahoogroups.com>, "Eric
> > Robishaw" <eric@> wrote:
> > >
> > > It doesn't appear to be a sleep issue... as I believe usleep calls
> > nanosleep
> >
> > It shows up as a sleep issue, ...
> >
> > > anyhow.
> > > I just can't read the registers any faster than 50hz (see Jim's
> > message if
> > > you haven't already).
> >
> > And I have ... The issue is timer resolution. As Jim correctly said,
> > the timer resolution is 10 mS in normal cases. You asked for a sleep
> > period of at least 10 mS, so the delay ends up being 10 mS, plus
> > another 10 mS for the process to become runnable again. Your total
> > delay is 20 mS, and 1/.02 = 50 Hz.
> >
> > The high resolution timers in recent kernels is clean way to solve
> > this problem, *transparently* giving timers resolution of 1 nS,
> > without having to write a special kernel driver to use an available HW
> > counter. It works great on the other TS boards (ep93xx based), but I
> > don't know if a) it was available when the TS ts=7800 kernel was
> > branched, or b) if TS enabled it; hence my suggestion.
> >
> > Jim is also right that it is a FAQ, and you can find lots more
> > discussion about it in the archives and the site I gave you.
> >
> > But in any case, good luck with your project!
> >
> > Regards, ........ Charlie
> >
> > >
> > > Eric
> > >
> > >
> > >
> >
> >  
> >
>



------------------------------------

Yahoo! Groups Links

<*> To visit your group on the web, go to:
    http://groups.yahoo.com/group/ts-7000/

<*> Your email settings:
    Individual Email | Traditional

<*> To change settings online go to:
    http://groups.yahoo.com/group/ts-7000/join
    (Yahoo! ID required)

<*> To change settings via email:
     
    

<*> To unsubscribe from this group, send an email to:
    

<*> Your use of Yahoo! Groups is subject to:
    http://docs.yahoo.com/info/terms/

<Prev in Thread] Current Thread [Next in Thread>
Admin

Disclaimer: Neither Andrew Taylor nor the University of NSW School of Computer and Engineering take any responsibility for the contents of this archive. It is purely a compilation of material sent by many people to the birding-aus mailing list. It has not been checked for accuracy nor its content verified in any way. If you wish to get material removed from the archive or have other queries about the archive e-mail Andrew Taylor at this address: andrewt@cse.unsw.EDU.AU