Problem reading GPIO14 analog inputs

I2C, Serial, Wireless etc.

Moderator: chris

Problem reading GPIO14 analog inputs

Postby zufoant » Fri Nov 21, 2008 12:12 am

Hi,

Here's the setup I have:
Linux Program written in C
I2C-USB interface (ftdi chip)
SD20 Servo Controller (I2C)
GPIO14 Controller (I2C)
All three chips were bought from robot electronics

After 12 hours I managed to get the Linux and I2C/USB working! A few minutes after that I was controlling the servos, no problem.

Then I tried to get the GPIO14 working. I have no problem reading the chip version, setting pins high/low but I just can't get the analog I/O working; this is the main reason for buying these chips!

On the I2C bus I'm doing the following:

- write 0x80 to AD_CONTROL
- write GET_AD0 to CMD
- read 1 byte from register 1 (have also tried reading two byes, and also 1 byte from register 2)

Whatever I appear to play with, all I get is either a result of 0x01 or random values that don't match upto the inputs supplied to the pins.

Help!
zufoant
 
Posts: 2
Joined: Thu Nov 20, 2008 11:04 pm

Re: Problem reading GPIO14 analog inputs

Postby zufoant » Fri Nov 21, 2008 12:29 am

A reply to my own post; great!

I've just read yet more forum messages on here and found the following quote on http://www.robot-electronics.co.uk/forum/viewtopic.php?f=5&t=132 from Gerry.

Most commands that do not actually return data, will return an acknowledge byte, which is 0x00 for failed and 0x01 for succeeded. It seems you are not reading the ack from a previous command somewhere, so it is still in the buffer when you read data.


I will be looking into this as a cause for my problem. Any suggestions before I reach a conclusion are most welcome :)
zufoant
 
Posts: 2
Joined: Thu Nov 20, 2008 11:04 pm


Return to Communication devices

Who is online

Users browsing this forum: Bing [Bot] and 0 guests