Thank you, thank you, thank you. Adding O_SYNC brought the
wait-loop counts down into the low 20's, and the readings are
reasonable. Problem solved.
The defective open statement I copied from the code sample
in the July, 2009 version of the "Linux for ARM on TS-72XX
User's Guide". That's the latest version I've come across.
I'll try to alert the appropriate authorities.
--- In "Charles" <> wrote:
>
>
> Hi --
>
> Did you remember to use O_SYNC when you opened /dev/mem?
>
> regards, .....Charlie
>
> PS - There is also a MAX197 device driver in the 'files' section of this
> group; it worked quite well for me with high speed sampling.
>
> --- In mike ingle <finndmike62@> wrote:
> >
> > Hi
> > I can't answer your question, but I can say I have seen this topic several
> > times. Please search the archives (try "MAX197"), and I think you will
> > find your answer. Google yields 580 results from "TS7250 MAX197".
> >
> > Best regards, and you will generally find this group to be helpful.
> >
> > Mike
> >
> >
> > On Sep 29, 2011, at 5:40 PM, randomyellowbits wrote:
> >
> > > I'm trying to understand the MAX197 A/D converter on my TS-7250, but its
> > > behavior differs wildly from my expectations. I hope someone here can
> > > tell me what I'm missing.
> > >
> > > For starters, after writing a control byte to 0x10c00000, I typically
> > > have to poll 0x10800000 a couple million times before the INT* line
> > > (0x80) goes low. This doesn't seem consistent with a conversion time on
> > > the order of 10 microseconds.
> > >
> > > Secondly, according to my reading of the MAX197 specs, the act of reading
> > > the result sends INT* high again; but it typically takes a couple million
> > > passes through the polling loop before it goes high.
> > >
> > > If I don't wait for INT* to go high before initiating another conversion,
> > > it will still be low after I write the control byte, which looks as if
> > > the conversion is completed, but if I optimistically read the result, the
> > > low-order byte of the result is identical to the control byte I just
> > > wrote.
> > >
> > > Being new here, I'm not sure how much code I'm welcome to post, so here
> > > are the bare essentials:
> > >
> > > #define MMAP(x) mmap(0,getpagesize(),PROT_READ|PROT_WRITE,
> > > MAP_SHARED,fd,x);
> > >
> > > static volatile unsigned char *initiate;
> > > static volatile unsigned short *adresult;
> > > static volatile unsigned char *installed;
> > > static volatile unsigned char *complete;
> > >
> > > initiate = (unsigned char *) MMAP(0x10c00000);
> > > complete = (unsigned char *) MMAP(0x10800000);
> > > installed = (unsigned char *) MMAP(0x22400000);
> > > adresult = (unsigned short *) initiate;
> > >
> > > Thanks in advance for informative comments, or even illuminating insults.
> > >
> > >
> >
>
------------------------------------
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/
|