From: Shawn C. <scy...@gm...> - 2008-03-23 22:41:26
|
Hello, As mentioned before we are developing a quadrotor helicopter, which is running off of a gumstix verdex xm4-bt / robostix combo. I need to set 4 PWM signals on the robostix through I2C. This works correctly but the time to write to the registers is variable and very slow. When we execute the following: I2C_IO_WriteReg16(i2cdev,ch1,servo1*2); I2C_IO_WriteReg16(i2cdev,ch2,servo2*2); I2C_IO_WriteReg16(i2cdev,ch3,servo3*2); I2C_IO_WriteReg16(i2cdev,ch4,servo4*2); The total process after timing it takes approximately 59ms which restricts our control loop to approximately 16 Hz. What's weird is that the first WriteReg command takes 1 ms and the others take 18-19 ms (occasionaly they spuriously only take 1-2 ms but rarely). What could cause such a differential in execution time? We changed the bus speed to both 100khz and 400khz yet get approximately the same execution times. If anyone could help it would be much appreciated as we need to dramatically increase the speed for our control loop in order to produce a stable hover of our quadrotor. Is this a normal execution time, because in my experience writing to registers has been a very fast process? Thank you very much for your time, -Shawn |