When we made the changes you specified, this is what happens.

We are able to write the changes to the ADMUX, we can verify that the change is correct by doing a ReadReg on ADMUX (and we see 0xc0).  So this works.  However, when we do:

i2c-io 0x0b get adc.x, we always get 1023, and after doing this, when we read ADMUX, we see 0x03 (if we had just read adc.3).

So it appears that i2c-io, when it does the adc reads, is still writing 00 into REFS1 and REFS0.  Is this supposed to happen?  If so, how can we keep it from doing that?


On 5/3/06, Dave Hylands <dhylands@gmail.com> wrote:
Hi Adrian,

> We are still not quite sure what we need to do to get the 2.56V reference
> selected at bootup, and how to keep it that way while we are using it.  Do
> we need to compile a program for the robostix to do this?  Or is this
> something that we can do over i2c?

OK - I went ahead and modified a2d_8.c so that it no longer sets the
REFS0 or REFS1 bits (although I have no way of testing this right now)
- it's in revision 976. I won't change the precompiled files until I
can test this.

So if you rebuild i2c-io with update source:
cd robostix
svn update
cd i2c-io
make clean

and then redownload i2c-io.hex using i2c-load.

Now you can set the REFS0 and REFS1 bits using i2c-io

i2c-io 0x0b writereg ADMUX 0xC0

and then when you call

i2c-io 0x0b get adc.3

it will use the reference selected in the ADMUX. The default is still
to use AREF (REFS0 = REFS1 = 0).

> I understand that we need to or those bits on to the existing contents of
> the ADMUX register, but I don't understand how we get to that point.

If you're not using i2c-io then how you do it will depend entirely on
the software running on the robostix.

Dave Hylands
Vancouver, BC, Canada

Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
gumstix-users mailing list