1_pretet7: ITG3200 driver: Initialization issue

This forum is dedicated to software development related to MultiWii.
It is not the right place to submit a setup problem.
Software download
Post Reply
ziss_dm
Posts: 529
Joined: Tue Mar 08, 2011 5:26 am

1_pretet7: ITG3200 driver: Initialization issue

Post by ziss_dm »

Hi Alex,

Just a small issue with ITG3200 driver. The ITG3200 requires some delay after reset to stabilize values (10msec by datasheet, as I remember). Currently we do not have any delay before we starting calibration. As a result calibration not always succesfull. (sometimes I had values 3-5 instead of zeros). To solve this I have just put delay(100) at the end of the initialization procedure. (10msec was not enough in my case, for some reasons)

Regards,
ziss_dm

mistral
Posts: 6
Joined: Fri Feb 04, 2011 8:19 am

Re: 1_pretet7: ITG3200 driver: Initialization issue

Post by mistral »

Hi Ziss_dm ;

Can you post your mod to put delay ?

Thank you.

Fab

javitech
Posts: 8
Joined: Mon Feb 28, 2011 10:19 pm

Re: 1_pretet7: ITG3200 driver: Initialization issue

Post by javitech »

i have same problem, i do a second calibration and is ok....

Alexinparis
Posts: 1630
Joined: Wed Jan 19, 2011 9:07 pm

Re: 1_pretet7: ITG3200 driver: Initialization issue

Post by Alexinparis »

thanks for the advice:

the code mod is here:

Code: Select all

...
#if defined(ITG3200)
static uint8_t rawADC_ITG3200[6];

void i2c_Gyro_init() {
  delay(100);
  i2c_rep_start(0XD0+0);      // I2C write direction
  i2c_write(0x3E);            // Power Management register
  i2c_write(0x80);            //   reset device
  i2c_write(0x16);            // register DLPF_CFG - low pass filter configuration & sample rate
  i2c_write(0x1D);            //   10Hz Low Pass Filter Bandwidth - Internal Sample Rate 1kHz
  i2c_write(0x3E);            // Power Management register
  i2c_write(0x01);            //   PLL with X Gyro reference
  delay(100);
  gyroPresent = 1; 
}
...

Post Reply