MPL3115A2

取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 

MPL3115A2

471 次查看
jetsman97
Contributor I

I am attempting to write code on my STM43F411CEU6 "Black Pill" microcontroller to extract data from the Altimeter on the MPL3115A2. I am writing this code in C Language in the STM32CubeIDE. I am trying to go according to the data sheet but am running into many issues that are from a lack of clarity of explanantion.

For example, my question that brought me here initially: What is the difference between the  STANDBY_SBYB_MASK and the ACTIVE_MASK? My understanding is that they both are used to toggle the Standby/Active modes in the CTRL_REG_1 and both hold the value of 0x01. If this is true, then why are both necessary? If this is not the case, please help me understand why both exist and what they mean.

Additionally, the example codes throughout the datasheet are missing information. I get many errors when I attempt to use them and I there are many things that are not defined. For example, in the code for converting a 20-bit altitude reading to a signed decimal number, a type "tword" is used in the function but this is an unknown type that is not referenced in the data sheet. Furthermore, functions for the conversion are given but not how to perform the conversion itself/what calls are needed to make. Also, the functions IIC_RegWrite/Reg_Read are undeclared.

I'd appreciate an answer to my questions. However, what would help me most is an example code document I can use and make small adjustments on. I hope you can assist me in understanding this sensor due to the datasheet not being clear enough, at least for me.

Thank you

标签 (1)
0 项奖励
1 回复

431 次查看
diazmarin09
NXP TechSupport
NXP TechSupport

Hello jetsman97,

I hope all is great with you. Thank you for using the NXP communities.

In this case I do recommend the following post. You may use it as a reference for your design.

MPL3115A2 - Bare metal example project

I hope this information helps.

Regards,

David

0 项奖励