Hie,
Here is my first post, coming from Paris...I hope you'll be kind with my poor language.
I've got an ADXL345 board, connected to an Arduino Duelmilanove.
I'm using the adafruit library.
first :
I was asking myself about my wiring because I need to add another I2C component.
I didn't find (on internet) the way to determinate the pullup resistance value ... help !
Second:
adafruit library is nice, but I am not sure I ve got the right values from adxl345.
what are values you putted in registers ?
Ox38 : I tried 0x80
Ox32: I tried 0x0B (for 16g)
thanks a lot
adxl345 & pullup
Moderators: adafruit_support_bill, adafruit
Please be positive and constructive with your questions and comments.
- adafruit_support_bill
- Posts: 88089
- Joined: Sat Feb 07, 2009 10:11 am
Re: adxl345 & pullup
In most cases the exact resistance value is not critical. Most of our breakout boards have pullup resistors included. If you have very many of them on the same bus, the combined pullup might be too strong, so you can remove some. But in most cases it is not an issue.I was asking myself about my wiring because I need to add another I2C component.
I didn't find (on internet) the way to determinate the pullup resistance value ... help !
Not sure what you are referring to. Do you mean these registers?Second:
adafruit library is nice, but I am not sure I ve got the right values from adxl345.
what are values you putted in registers ?
Ox38 : I tried 0x80
Ox32: I tried 0x0B (for 16g)
Code: Select all
#define ADXL345_REG_DATAX0 (0x32) // X-axis data 0
#define ADXL345_REG_FIFO_CTL (0x38) // FIFO control
-
- Posts: 2
- Joined: Wed Oct 30, 2013 3:57 am
Re: adxl345 & pullup
Thanks,
(It seems that my english is good enough to be read)
instead of 0x32, i was thinking about 0x31 ... wich is set thanks to 'setRange' function , you're right.
you said "0x38 is not used at all." ... is that mean that whatever the value, it work fine ?
I mean the best way to have the last value mesured is the bypass mode, isn't it ?
datasheet are never written in french ... and sometimes, i m not sure to understand what it means.
(It seems that my english is good enough to be read)
instead of 0x32, i was thinking about 0x31 ... wich is set thanks to 'setRange' function , you're right.
you said "0x38 is not used at all." ... is that mean that whatever the value, it work fine ?
I mean the best way to have the last value mesured is the bypass mode, isn't it ?
datasheet are never written in french ... and sometimes, i m not sure to understand what it means.
- adafruit_support_bill
- Posts: 88089
- Joined: Sat Feb 07, 2009 10:11 am
Re: adxl345 & pullup
Sometimes I am not sure if they are written in English either. They can be very difficult to read.datasheet are never written in french ... and sometimes, i m not sure to understand what it means.
The library does not read or write to this register. Bypass mode is the default value for this register (see table 22 on page 27): http://www.analog.com/static/imported-f ... DXL345.pdfyou said "0x38 is not used at all." ... is that mean that whatever the value, it work fine ?
I mean the best way to have the last value mesured is the bypass mode, isn't it ?
0x31 is used by the getRange and setRange functions:instead of 0x32, i was thinking about 0x31 ... wich is set thanks to 'setRange' function , you're right.
Code: Select all
/**************************************************************************/
/*!
@brief Sets the g range for the accelerometer
*/
/**************************************************************************/
void Adafruit_ADXL345::setRange(range_t range)
{
/* Red the data format register to preserve bits */
uint8_t format = readRegister(ADXL345_REG_DATA_FORMAT);
/* Update the data rate */
format &= ~0x0F;
format |= range;
/* Write the register back to the IC */
writeRegister(ADXL345_REG_DATA_FORMAT, format);
}
/**************************************************************************/
/*!
@brief Sets the g range for the accelerometer
*/
/**************************************************************************/
range_t Adafruit_ADXL345::getRange(void)
{
/* Red the data format register to preserve bits */
return (range_t)(readRegister(ADXL345_REG_DATA_FORMAT) & 0x03);
}
Code: Select all
/* Used with register 0x31 (ADXL345_REG_DATA_FORMAT) to set g range */
typedef enum
{
ADXL345_RANGE_16_G = 0b11, // +/- 16g
ADXL345_RANGE_8_G = 0b10, // +/- 8g
ADXL345_RANGE_4_G = 0b01, // +/- 4g
ADXL345_RANGE_2_G = 0b00 // +/- 2g (default value)
} range_t;
Please be positive and constructive with your questions and comments.