Noob looking for help understanding a L3GD20h 3 axis gryo datasheet

Hi all,

I'm a bit new to working with gyros, and new to the arduino platform.

So I have a 9 dof imu I got from adafruit, see here:

It's a L3GD20h gyro on one chip, and an accelerometer/compass on another chip, connected to an arduino via I2C communication.

The specific problem I'm having is accessing the registers of the L3GD20h. The datasheet for the gyro is here:

I'm able to get data from the WHO_AM_I register at address 0fh. I can set CTRL_REG1 at address 20h. What I can't do is access the data in registers 28h - 2dh by their address.

According to the datasheet, 5.1.1:

The I
2
C embedded in the L3GD20 behaves like a slave device and the following protocol
must be adhered to. After the start condition (ST) a slave address is sent, once a slave
acknowledge (SAK) has
been returned, an 8-bit sub-addr
ess is transmit
ted: the 7 LSb
represent the actual register address while the MSb enables address auto-increment. If the
MSb of the SUB field is 1, the SUB (register address) will be automatically incremented to
allow multiple data read/write.

So I get it, add a MSb of 1 to auto increment. What if I don't want to auto increment? What if I just want the data from register 28h only. What's it's address? Is it 28h or is it 0xA8?

Am I maybe just missing something in the binary/hex/dec conversions?

The code I'm using needs a bit of cleaning, but I'll post it soon. Looking for any help.

Thanks,
Randy

To read one register, read one register, don't get hung up on autoincrement, use it when you need it.

MarkT:
To read one register, read one register, don't get hung up on autoincrement, use it when you need it,
it doesn affect a single read.

Thanks MarkT for the reply,

MarkT:
To read one register, read one register, don't get hung up on autoincrement, use it when you need it.

But that's just it, reading the register at 0x28 returns invalid data when compared to the data in the register at 0xA8.

Or so that is what I was thinking.....

While tidying up the code & taking a screen shot of the serial out to post here, clearly showing the problem, I found a typo in my code, I had the wrong register address. I had the address as 0x26, not 0x28, 0x26 is a temperature register.

I feel stoopid now... but at least I found my problem.

Thanks,
Randy

Electronics and programming are all about double-checking and reduce the mistake count to less
than 1... Thoroughness and methodical checking are rewarded!