This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

RF430FRL152H: Use I2C to connect the accelerometer

Part Number: RF430FRL152H


Hello,

I want to use the I2C interface of RF430FRL152H to connect the accelerometer.

But I found that RF430FRL152H only has a 16-bit RESULT_MAILBOX, how do I get the acceleration on X/Y/Z at the same time?

I don’t know if my description is clear, I hope you can understand.

Best regards,

Zhixiong CHEN

  • Hi Zhixiong,

    yes, your description is clear and I understand the problem you have. If the ROM code handles the data storage you can exchange only 16 bit of data at a time. If no processing of the data has to be done by the ROM code, like using the alarm functions, you can also store your measurement data direct into the memory. The mailbox can then be loaded with dummy data. Take care that your data will not be overwritten by the ROM code, see the "Logging FRAM Memory Space Register".

    Best Regards,

    Helfried

  • Hi Helfried,

    Thank you for your help, I want to try it, if there is any problem, I will contact you.

    Best regards,

    Zhixiong 

  • Hi ,

    Sorry I don't quite understand how to save the sensor data directly to the RF430FRL152H register without using the mailbox. Is there a more detailed explanation or example?

    Best regards,

    Zhixiong

  • Hi Zhixiong,

    the measurement data is stored starting from block number 9 (8 byte block) which correlates to memory address 0xF8B0. If the ROM code already uses this location then put your data at a different address, lets say 0xF900 which would be block number (13 hex = 10 dec).

    A C code that uses a pointer could look like:

    unsigned int* storage_location = (unsigned int*)0xF900;

    storage_location[0] = X_value;   // address 0xF900

    storage_location[1] = Y_value;   // address 0xF902

    storage_location[2] = Z_value;   // address 0xF904

    This would store the XYZ values subsequent in the memory starting from 0xF900.

    Best Regards,

    Helfried

  • Hi Helfried,

    Thank you for your help, this problem is solved.

    Best Regards,

    Zhixiong