Hi,
I just bought the CC2540 MDK, and I am currently try to figure the precision of the accelerometer ? From what I understand, the accelerometer now is in a mode that measures 'tilt', so I was wondering is there any way for the accelerometer to measure " movement acceleration" instead of "tilted acceleration". By the way when I opened the cma3000d.c file, I found that the accelerometer is in "Measurement mode" (MEAS 100HZ, range 2g), and I believe the "Motion detection mode" is limited because it is band pass filtered, therefore we will not be able to get real data. Plus, I also did not see any parameter that related with "tilted" either in the data sheet or cma3000d.c file, forgive me if I'm wrong since I am new to this device. I would really appreciate for any help.
Regards.
Hello,
I believe you are familiar with keyFobDemo - but this is different that what you are trying.
http://processors.wiki.ti.com/index.php/Category:KeyFobDemo
Maybe there is more info at
VTI's web site: http://www.vti.fi/en/products/accelerometers/consumer_electronics/cma3000_series/
-Greg
Hi Greg,
Thanks for replying. By the way,I already downloaded the source code from keyFobDemo and in the cma3000d.c file, it shows that the accelerometer is "measurement mode" as it is described in the data sheet that I downloaded from the VTI's web site. However from this previous discussion, http://e2e.ti.com/support/low_power_rf/f/538/p/110761/394353.aspx#394353, it seems there is a mode for the accelerometer to measure movement which I am not sure how to change to that mode.
On the subject of the accelerometer found in the keyfob of the CC2540 Mini DK (BLE stack 1.2)
I am able to read the Characteristic Value Handle for the UUIDs:
ACCEL_ENABLER_UUID 0xFFA1 (0x0033) and
ACCEL_RANGE_UUID 0xFFA2 (0x0033)
unfortunately, when I try to discover the handles for
ACCEL_X_UUID 0xFFA3ACCEL_Y_UUID 0xFFA4ACCEL_Z_UUID 0xFFA5
I get a status of "READ_NOT_PERMITTED"
same for the keys UUIDs. Also, writing to the attribute handles (say, 0x0035) results in a "WRITE_NOT_PERMITTED" status.
What am I doing wrong?
Thank you for your help
Radu
Radu Iorgulescu unfortunately, when I try to discover the handles for ACCEL_X_UUID 0xFFA3ACCEL_Y_UUID 0xFFA4ACCEL_Z_UUID 0xFFA5 I get a status of "READ_NOT_PERMITTED"
The characteristics of the UUIDs for the accelerometer axes are set to notify only. In order for you to read any UUID set to a notify characteristic, you have to read the next address of the register for the corresponding handle. For instance, using the BLE Stack v1.2, you can discover that the handles for the axes are as follows.
ACCEL_X_UUID 0x0039ACCEL_Y_UUID 0x003DACCEL_Z_UUID 0x0041
If you want to read the x-axis value, you have to read 0x003A (which is one register after 0x0039). For the y-axis, it's 0x003E and for the z-axis, 0x0042.
Thanks Misael. All clear.
I can see the UUID handle in the reply itself; I was expecting the characteristic value handle to be filled automatically as result of my discovery request.
I also understand the "characteristic configuration" concept and the need to write at characteristic-value_handle + 1 to enable the accel. axis notifications.
I also followed all the steps and checked multiple forums treads on this topic, but I still read 00 from any of the accelerometers. I have successfully written 01 to 0x0033 (handle for 0xFFA1). I thought I had to specify a range (ACCEL_RANGE_UUID, 0xFFA2, handle 0x0036), but the parameter does not accept any writing. Even if it did, I would not know what number to use. The stack is correct and the keyfob has the proper firmware, since I can confirm it with my iphone. What am I missing or doing wrong?
Thank you in advance!
Armando Barbedo I also followed all the steps and checked multiple forums treads on this topic, but I still read 00 from any of the accelerometers. I have successfully written 01 to 0x0033 (handle for 0xFFA1).
I also followed all the steps and checked multiple forums treads on this topic, but I still read 00 from any of the accelerometers. I have successfully written 01 to 0x0033 (handle for 0xFFA1).
So you are not seeing notification updates on occurring on your iPhone? I can see BTool v1.20c auto updating values (through notifications) when I rotate the keyfob to engage the accelerometer after running these steps. Can you check to see if you can at least see the transmission through BTool?
Armando Barbedo I thought I had to specify a range (ACCEL_RANGE_UUID, 0xFFA2, handle 0x0036), but the parameter does not accept any writing. Even if it did, I would not know what number to use.
I thought I had to specify a range (ACCEL_RANGE_UUID, 0xFFA2, handle 0x0036), but the parameter does not accept any writing. Even if it did, I would not know what number to use.
The way TI set up this profile, they only allow you to read the current "range" of the accelerometer, or the sensitivity of the accelerometer (2G or 8G). The only way that I know of to change this setting is to update the firmware manually by setting static uint16 accelRange = ACCEL_RANGE_8G; instead of the 2G parameter.
Thank you for the clarification about the range.
My comment about the iphone was to make clear that everything works with the keyfob. The accelerometer responds properly, the buzzer responds to the command, and the buttons update the status in the app. What I am unable to do is to read any accelerometer data through BTool. I know I have to enable the accelerometer, but I am not sure I am doing it right and whether I am missing an additional step.
Thank you!
Check to make sure that you are also enabling notifications for each axis as well as enabling the accelerometer in BTool. Write 01:00 to characteristic handles 0x003A, 0x003E, and 0x0042. If that isn't enough, then the only other thing I would suggest is that you check to see if you are using the latest revision of BTool, or at least a 1.2 revision. I have seen in other posts about issues arising with people using the new BLE stack (1.2) with older versions of BTool (prior to 1.2). Hope that helps.
Misael, you're the man! It works! Thanks a lot!