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.