|
|
View previous topic :: View next topic |
Author |
Message |
farouk_baya
Joined: 18 Jun 2010 Posts: 27
|
|
Posted: Wed Dec 24, 2014 8:44 am |
|
|
I get the correct i2c adresse but when reading data from the sensor I get always MSB = 0xFF and LSB = 0xFF.
I think the problem can be about the i2c speed.
the configuration is as follows:
Cpu clock = 32 M
i2c speed (#use i2c) : Fast = 40000 (40KHz)
Is that correct? |
|
|
temtronic
Joined: 01 Jul 2010 Posts: 9243 Location: Greensville,Ontario
|
|
Posted: Wed Dec 24, 2014 11:29 am |
|
|
Since you say you get the correct addresses, you can assume it's speed is correct, though your 'code snippet' isn't correct.
All '0xFF' usually means no data. Are there other registers you can write and read to correctly?
If that device has a bit of RAM, send known data to it, then read, better yet, if there's some EEPROM, send known data to it, power off, wait,power up, read the EEPROM.
I don't have that device so I can't test....
jay |
|
|
Ttelmah
Joined: 11 Mar 2010 Posts: 19538
|
|
Posted: Wed Dec 24, 2014 3:37 pm |
|
|
I'd change the clock setting to be slow=40000 not fast.
The chip supports 10KHz to 100KHz max. The 'slow' standard is for 100KHz. Fast normally starts at 400KHz. It doesn't matter on most chips, but on one with programmable slew rates, selecting 'fast' would switch to these. Better to stick with 'slow' since this is what the chip supports. |
|
|
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
Powered by phpBB © 2001, 2005 phpBB Group
|