[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [microblaze-uclinux] usleep



Hi Jay,

Jay Norrish wrote:

> My whole Idea here is to keep my application simple and not have to write
> interrupts or rely on software timming loops that tie up the proccessor.
> I don't need precise timming like a real time op system. The peripherals
> take between 300 to 500 usec to update once started. I would just like to
> start them put the application to sleep and then go read them later.
> I could live with 100 hz tik rate but 1000 hz would be better.

You may like to look at this page for some more discussion on the subject:

http://www.tldp.org/HOWTO/IO-Port-Programming-4.html

> So I changed the #define HZ to 1000. Every thing seems to work fine so far.
> Telnet and thttdpd are still working. And I can still update the flash with
> tftp.
> I'll let you know if it causes any problems.

Great, thanks.  One thing that would be interesting to see is the impact 
on bogomips (or dhrystone) of increasing HZ.  Performance should 
decrease due to increased timer interrupt handling and scheduling 
overhead - I wonder by how much?

> Just as an experiment I tried to increase the tik rate higher and got an
> error.
> I traced it to the timex.h file where the SHIFT_HZ is generated for the PLL.
> Is there an easy explanation about what that PLL is for?

I think it's a software PLL, accumulating error to keep average system 
clock correct.  SHIFT_HZ is used in linux-2.4.xc/kernel/time.c - a bit 
of source-diving and you could probably work it out.  The #define 
cascade in timex.h suggests you could extend the HZ range beyound the 
1536HZ limit currently coded there.  (I like what happens if you go 
beyond that limit - #error "You lose" - one of the more descriptive 
error messages I've seen lately! :)

John
___________________________
microblaze-uclinux mailing list
microblaze-uclinux@itee.uq.edu.au
Project Home Page : http://www.itee.uq.edu.au/~jwilliams/mblaze-uclinux
Mailing List Archive : http://www.itee.uq.edu.au/~listarch/microblaze-uclinux/