AnsweredAssumed Answered

ADXL345中断无法清除。

Question asked by qian on Dec 24, 2013
Latest reply on Dec 27, 2013 by CraigG

我使用的例程是:

x:\Analog Devices\WVGA_LCD_EI3_Extender_Board-Rel1.0.1\WVGA_LCD_EI3\Blackfin\Examples\ADSP-BF609\adxl345_accel

 

 

这个例程是BF609评估版 扩展板上的例程。

硬件上的区别就是:

1,我们自己的硬件只需要一个中断引脚 INT1

2,使用的GPIO引脚不同。修改如下:

 

 

#if 0

/* GPIO port and pin to which interrupt pin1 of ADXL34x is connected */

#define ADXL34x_INT1_GPIO_PORT              ADI_GPIO_PORT_G

#define ADXL34x_INT1_GPIO_PIN               3

#define ADXL34x_INT1_GPIO_PIN_INTERRUPT     ADI_GPIO_PIN_INTERRUPT_5

#define ADXL34x_INT1_GPIO_PIN_ASSIGN_BYTE   ADI_GPIO_PIN_ASSIGN_BYTE_0

#define ADXL34x_INT1_GPIO_PIN_ASSIGN_PORT   ADI_GPIO_PIN_ASSIGN_PGL_PINT5

#else

/* GPIO port and pin to which interrupt pin1 of ADXL34x is connected */

#define ADXL34x_INT1_GPIO_PORT              ADI_GPIO_PORT_B

#define ADXL34x_INT1_GPIO_PIN               15

#define ADXL34x_INT1_GPIO_PIN_INTERRUPT     ADI_GPIO_PIN_INTERRUPT_1

#define ADXL34x_INT1_GPIO_PIN_ASSIGN_BYTE   ADI_GPIO_PIN_ASSIGN_BYTE_1

#define ADXL34x_INT1_GPIO_PIN_ASSIGN_PORT   ADI_GPIO_PIN_ASSIGN_PBH_PINT1

#endif

 

 

当我把程序运行起来以后,中断无法被清除掉。 例程不停的打印信息。

我该如何才能清除掉中断?

 

 

打印信息如下:

The Device ID of adxl345 is 0xe5

ADI_ADXL34x_DEVID           = 0xe5

ADI_ADXL34x_THRESH_TAP      = 0x38

ADI_ADXL34x_OSFX            = 0x00

ADI_ADXL34x_OSFY            = 0x00

ADI_ADXL34x_OSFZ            = 0x00

ADI_ADXL34x_DUR             = 0x10

ADI_ADXL34x_LATENT          = 0x50

ADI_ADXL34x_WINDOW          = 0xff

ADI_ADXL34x_THRESH_ACT      = 0x00

ADI_ADXL34x_THRESH_INACT    = 0x00

ADI_ADXL34x_TIME_INACT      = 0x00

ADI_ADXL34x_ACT_INACT_CTL   = 0x00

ADI_ADXL34x_THRESH_FF       = 0x00

ADI_ADXL34x_TIME_FF         = 0x00

ADI_ADXL34x_TAP_AXES        = 0x0f

ADI_ADXL34x_ACT_TAP_STATUS  = 0x00

ADI_ADXL34x_BW_RATE         = 0x06

ADI_ADXL34x_POWER_CTL       = 0x01

ADI_ADXL34x_INT_ENABLE      = 0x60

ADI_ADXL34x_INT_MAP         = 0x00

ADI_ADXL34x_INT_SOURCE      = 0x00

ADI_ADXL34x_DATA_FORMAT     = 0x40

ADI_ADXL34x_DATAX0          = 0x00

ADI_ADXL34x_DATAX1          = 0x00

ADI_ADXL34x_DATAY0          = 0x00

ADI_ADXL34x_DATAY1          = 0x00

ADI_ADXL34x_DATAZ0          = 0x00

ADI_ADXL34x_DATAZ1          = 0x00

ADI_ADXL34x_FIFO_CTL        = 0x5f

ADI_ADXL34x_FIFO_STATUS     = 0x00

Got Data X = 0xff98, Y = 0xff31, Z = 0x1ff

 

 

Got Data X = 0xff93, Y = 0xff28, Z = 0x1ff

 

 

Got Data X = 0xff91, Y = 0xff28, Z = 0x1ff

 

 

Got Data X = 0xff91, Y = 0xff28, Z = 0x1ff

 

 

Got Data X = 0xff93, Y = 0xff29, Z = 0x1ff

 

 

Got Data X = 0xff93, Y = 0xff26, Z = 0x1ff

 

 

Got Data X = 0xff92, Y = 0xff27, Z = 0x1ff

 

 

Got Data X = 0xff92, Y = 0xff27, Z = 0x1ff

 

 

Got Data X = 0xff93, Y = 0xff28, Z = 0x1ff

 

 

Got Data X = 0xff92, Y = 0xff29, Z = 0x1ff

 

 

Got Data X = 0xff92, Y = 0xff29, Z = 0x1ff

 

 

Got Data X = 0xff91, Y = 0xff28, Z = 0x1ff

 

 

Got Data X = 0xff92, Y = 0xff28, Z = 0x1ff

Outcomes