ts-7000
[Top] [All Lists]

[ts-7000] Re: Reading GPIO ports

To:
Subject: [ts-7000] Re: Reading GPIO ports
From: "themoog5" <>
Date: Fri, 21 Jul 2006 20:25:10 -0000
--- In  Matt Godbolt <> wrote:
>
> 
> > tate = *PBDR;
> > > while (!(state & 0x01)) {
> > > state = *PBDR;
> > > }
> > >
> > > printf("boo\n");
> > > }
> > >
> >
> > Your delay is unlikely the pins. It's more likely to be the IO.
> > You might want to try to flush the io buffer after each printf:
> > "fflush(stdout);"
> >
> Hi there, I tried all manner of IO flushing, ioctl()s, etc (including
> flashing the LEDs on the circuit board) and none of that helped - even
> without flushing it wouldn't have missed some of the edges as my
> experiments suggested, it would have just bunched them up until the
> printfs() got flushed. 
> 
> I'm still not sure what was going on,  but writing kernel-level drivers
> has obviated the issue.  In fact, if anyone is interested in either a
> /dev/lcd driver (a patch to lcdmod), or a driver to act on interrupts on
> a DIO pin from an infra-red detector (I have a driver to lirc), let
me know.
> 
> Thanks to those who helped - one day I will revisit this user-mode issue
> and try and work out what it was, but until then I'm happy in
kernel-space.
> 
> Thanks,
> 
> Matt
>

Hi again all, regarding this issue, something in the recently-posted
thread 'Increasing kernel clock_tick' made me realise - the problem
I'm getting is exactly the issue solved by the O_SYNC flag Peter
Elliot mentions!  http://www.simtec.co.uk/appnotes/AN0014/ notes this
too -- I really was reading cached memory (as all the example code,
including Jim Jackson's adio library do).  Without the O_SYNC flag you
get a cached representation of the IO...which gives exactly the
symptoms I was observing!

I hope this helps anyone else who's suffering from problems with
user-mode GPIO access :)

Cheers,

Matt
-==-






------------------------ Yahoo! Groups Sponsor --------------------~--> 
Yahoo! Groups gets a make over. See the new email design.
http://us.click.yahoo.com/XISQkA/lOaOAA/yQLSAA/CFFolB/TM
--------------------------------------------------------------------~-> 

 
Yahoo! Groups Links

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

<*> 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