Orientation Detection in accelerometer

AI Thread Summary
The discussion revolves around using the BMA250e accelerometer to detect orientation changes in mobile devices. The user is experiencing issues where the orientation status remains unchanged despite attempts to read the relevant registers. Key points include the need to verify interrupt settings, ensure the correct registers are being read, and check if the axes are enabled. There is also a mention of the importance of understanding the chip's specifications thoroughly to troubleshoot effectively. The conversation emphasizes the necessity of checking both hardware and firmware configurations to resolve the detection issue.
Ravindra Kant
Messages
4
Reaction score
0
Hello,
I am using accelerometer to detect orientation change.for an e.g.if mobile accelerometer senses the direction that
is it in portrait or landscape mode.so basically in this method the change of axis is detected .
I am using the BMA250e module as an acceleromter,which has an inbuilt feature that it detects the change in orientation and respectively generates the interrupt,In my code i have checked the status of bits which detects the change after changing the orientation the status remains the same.
I seriously want to know how to resolve the issue?
 
Engineering news on Phys.org
Are you expected to detect the bits directly? Or is there an API available, where you just call a function and it returns a value?
 
Sir,
I have an register available in the sensor chip which when read shows the status of orient_bit in the register.
If there is any change in orientation than orient_bit sets to '1' and after a certain delay it gets to '0' say, after 50 ms
First,I am unable to get the status it always remains zero.
Secondly,there are three types of orient modes low asymmetrical,high asymmetrical and symmetrical,what do these signify?
 
It is difficult to determine your issue since there are so many things you could be doing incorrectly in the firmware.

Do you actually get the interrupt, or are you just polling for changes? Are you using latched, non-latched or temporary?
The interrupt condition could be going away while you check it if you use temporary or non latched.

Does the temperature sensor work? (just to check your data interface)

Have you activated the self check and verified its results?

Have you written a register and read it back to verify the write worked?

As for the symmetry modes, page 35 of the spec explains the angles for the different modes.

Basically, in order to use a chip of this complexity you need to have read the spec from beginning to end at least twice, and understand the purpose of every bit in every register.

I didn't look at the driver API to see how much they abstracted the control details. Are you using the drivers, or writing your own.
 
Sir,
I am not using any drivers ,just writing my own,
since orientation interrupt gets cleared automatically after about 50 ms so there is no need it to be latched,but yes the register INT_STATUS0 (0x09).shows the status of orientation change.
Yes the temperature sensor is working fine.
I run the self test ,and checked the data on each axis if there is any motion in any axis i wold get any alarm.
So if there is any slow motion i would get the result that slow motion is detected,
that status can also be checked by reading the register INT_STATUS0.

the thing you said are general procedure that i tested,but if i want to check the orientation change ,how should i proceed according to you?
 
I'm not entirely clear what your problem is. Is it "how do I do this with this module?, or "I am doing XYZ and getting the incorrect result".

I have never used the module, so I would have to mess with it to figure out exactly what to do.

You can read the orientation in register 09 since it always reflects the current orientation. Do you see that change when you change orientation?
 
No,i do not see any change that is my question,why is there any problem of timing ?
 
oops:
Register 0C (I mistakenly said 09) is supposed to always contain the orientation. If it has values and they change with orientation, then there is something wrong with your threshold or interrupt settings. Do you see 0C change with orientation. If so, the chip is working and you need to determine the interrupt settings.

If the values in 0C do not change, maybe you have the axis disabled (0x16)

Since the orientation interrupt is cleared after 1 stable period of the value in 0C, maybe you are missing it. I don't see how to set the period.
 
Back
Top