MMA6827

キャンセル
次の結果を表示 
表示  限定  | 次の代わりに検索 
もしかして: 

MMA6827

1,392件の閲覧回数
Zhang_123
Contributor II

I am writing the driver for the MMA6827 and am currently in the driver code for the MMA6800 in the reference TWR_SENSOR_PAK_AUTO_PROJECT

void MMA6800_Read_Acceleration(word cfgX,word cfgY)
{
word tmpx,tmpy;

(void)MMA6800_RegRead(MMA6800_DEVSTAT); //READING DEVSTAT
MMA6800_Delay(10);
(void)MMA6800_AccRead(cfgX); // AccXCfg7 X-Axis Raw, Unsigned Data, Disabled/PCM 0b0011000000000100
MMA6800_Delay(10);
xy_digits.x_dgt = MMA6800_AccRead(cfgY); //SENDING ACCELERATION READ COMMAND 2
MMA6800_Delay(10);
xy_digits.y_dgt = MMA6800_RegRead(MMA6800_DEVSTAT); //READING ACCELERATION 2
MMA6800_Delay(10);

in the previous code,xy_digits.x_dgt = MMA6800_AccRead(cfgY); Is the configured Y-axis data assigned to the X-axis? How to understand this code? Thank you so much!

0 件の賞賛
返信
3 返答(返信)

1,369件の閲覧回数
JozefKozon
NXP TechSupport
NXP TechSupport

Hi Eric,

please see below an answer from an application engineer I have contacted.

DESCRIPTION

The response to the first command happen during the second command is being sent and that is the reason for this.

Row 424, a read sensor channel X command is sent the response to this command is captured in row 426.

On row 426 a read sensor channel Y command is sent and the response to the command is captured in row 428.

 

In that function, while DEVSTAT register read command are sent the response to this command is never captured and used as dummy command.

JozefKozon_0-1680066974030.png

 

With Best Regards,

Jozef

0 件の賞賛
返信

1,355件の閲覧回数
Zhang_123
Contributor II

Thanks a lot!

0 件の賞賛
返信

1,352件の閲覧回数
JozefKozon
NXP TechSupport
NXP TechSupport

Hi Eric,

you are very welcome.

With Best Regards,

Jozef

0 件の賞賛
返信