Hi,

after thinking a bit about it I think it is reading too fast from the bus, so 
the first bit is garbage and the remaining bits are shifted by 1. The least 
significant bit is then dropped...
I changed the speed of the bus in

os/linux-2.6/arch/cris/drivers/i2c.c  :

/* use the kernels delay routine */
#define i2c_delay( usecs ) udelay( 5*usecs )

is it the correct way of doing this? 
At this speed everythings works fine and the bus is very stable.
Maybe I will make the I2C speed configurable as an option.

BTW: the update script and the sdk_version do not work for me. 
If a would like to change sth, whom should I send it to to get it into the 
SVN?

-Cornelius


Am Mittwoch, 5. September 2007 15:23 schrieb Cornelius Claussen:
> Hi,
>
> I'm pretty new to the foxboard and I can't get the I2C bus fully working. I
> want to use a servo controller (SD20). I am using the new driver from Geert
> Vancompernolle (the one from the rar file in the yahoo groups file list)
> I can write to the I2C bus with
>
>        adc.slave     = 0xC2;
>        adc.wbuf[ 0 ] = 1;
>        adc.wbuf[ 1 ] = servocounter+=10;
>        adc.wlen      = 2;
>        int err = ioctl( fd_i2c, _IO( ETRAXI2C_IOCTYPE, I2C_WRITE ), &adc );
>
> This works perfectly. However, reading using WRITEREAD produces strange
> results: (the first number is the value I wrote to the register, the second
> is the value I get when I read it back):
>
> servo value: 8, read: 132
> servo value: 18, read: 137
> servo value: 28, read: 142
> servo value: 38, read: 147
> servo value: 48, read: 24
> servo value: 58, read: 157
> servo value: 68, read: 162
> servo value: 78, read: 167
> servo value: 88, read: 172
> servo value: 98, read: 177
>
> It is interesting that the steps are 5 on the read values, while the steps
> on the values I set are 10. Seems it is missing one bit... Do you think
> this is a software or hardware problem?
> Any help would be much appreciated.
> Best regards,
>
> Cornelius

-- 
Cornelius Claussen
opentek GbR
Mobile: +49 (0)175 6944518
E-Mail: [EMAIL PROTECTED]
Internet: http://www.opentek.de
USt.-IdNr.: DE242952925


 
Yahoo! Groups Links

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

<*> Your email settings:
    Individual Email | Traditional

<*> To change settings online go to:
    http://groups.yahoo.com/group/foxboard/join
    (Yahoo! ID required)

<*> To change settings via email:
    mailto:[EMAIL PROTECTED] 
    mailto:[EMAIL PROTECTED]

<*> To unsubscribe from this group, send an email to:
    [EMAIL PROTECTED]

<*> Your use of Yahoo! Groups is subject to:
    http://docs.yahoo.com/info/terms/
 

Reply via email to