Interfacing with RFEM24-250!

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Interfacing with RFEM24-250!

3,845 Views
ganesh3
Contributor II

Hello People,

I'm not able to properly interface with RFEM24-250 RF Energy Module via I2C. Specifically, I cannot set the device mode to operating as it is always in standby mode. I followed all the basic command sequences mentioned in the user manual specifications. Any help or extra documentation would be appreciated.

-Ganesh

0 Kudos
Reply
10 Replies

3,725 Views
Braveheart53
Contributor I

@ganesh3 

Were you able to successfully interface with the module?

I am attempting to do the same using I2C with a Total Phase Aardvark as the Master OR an Arduino Uno as the maser both through Matlab.

 

I can do python as well, but the customer preferred matlab. Please advise.

0 Kudos
Reply

3,695 Views
ganesh3
Contributor II

Yes. I was able to connect. Please let me know which step you are stuck on.

-Ganesh

-Ganesh

0 Kudos
Reply

3,828 Views
LPP
NXP Employee
NXP Employee

At first, try to determine the reason of the standby using LED indication as described in the Interface Reference Manual.
Then read "Read Alerts" register and investigate all the status bits.
If CMD_ERR Alert bit is set, read an error code that will provide more information as to the cause of the error.


Have a great day,
Pavel
TIC
-------------------------------------------------------------------------------
Note:
- If this post answers your question, please click the "Mark Correct" button. Thank you!
- We are following threads for 7 weeks after the last post, later replies are ignored
Please open a new thread and refer to the closed one, if you have a related question at a later point in time.
-------------------------------------------------------------------------------

0 Kudos
Reply

3,713 Views
Braveheart53
Contributor I

@LPP 

Pavel, the LED is awaiting ID assignment in my case. Yet, I cannot get it to assign address. The arduino uno dioes not detect it either by 0x7F address or by bus search. A total phase aardvark as master does see the device at the 0X7F address, but device does not seem to respond.

Ideally, I would like to control with an Arduino Uno as master through matlab. This method allows the user to monitor other pins and device status. Please advise.

0 Kudos
Reply

3,694 Views
ganesh3
Contributor II

Hello!

I got the Module to work and its worth the money. Firstly, I hope you were able to download the interface datasheet from NXP.

I followed the following steps to assign the ID after your regular initializations:

  • Reset by pulling the pin LOW and pulling it HIGH after a second
  • Send Reset Command via I2C Interface (0x00, 0x65(CRC))
  • Read Alerts Command vial I2C Interface (0x46, 0xB0) and Read the alerts (Alert-Status, Error-Code, CRC)
  • Verify the incoming CRC
  • Send 'Assign-Command' via I2C Interface (0x01, newID, CRC(based on newID))

This should work. Verify by LED Status! (It should change to Standby)

Also, I would recommend the following troubleshooting tips before you actually connect your load:

  • What is the status LED indicating as you send the instructions
  • Did you make sure that all the pins are properly connected? Verify the data and clock lines with an oscilloscope
  • Did you follow the CRC Generation process as described in the manual? Make sure that you did set the seed to 0x01? Use an online CRC calculator to verify as well.
  • Check the reset pin!

Do let me know if you need more help.

-Ganesh

0 Kudos
Reply

3,170 Views
RC_Argo
Contributor I

Hey Ganesh, reviving an old thread.  I am also trying to use an Arduino UNO as the host for this module.  I am stuck on figuring out the CRC calculation function.  For the reset command, 0x00, the supplied function (and lookup table) generates 0x65 which matches your comment and seems to have the desired effect.  However, when I try the CRC calculation for the Read Alerts command I am missing something.

Sending 0x46 0xB0 as you suggest above does seem successful, as I am able to then read alert bytes back (ie Wire.available() = 2).  However, when I try to use the supplied CRC functions (either lookup or the alternate implementation shown on page 25 of the interface doc) with an input of 0x46 I get 0x97 (151) instead of the 0xB0 value suggested.

Can you provide the code you used to get the module running, or comment on what may be going wrong with my understanding of the CRC code?

0 Kudos
Reply

3,156 Views
ganesh3
Contributor II

CRC Table:

static const uint8_t crc8_table_[256] = {
0x00, 0x65, 0xCA, 0xAF, 0xF1, 0x94, 0x3B, 0x5E, 0x87, 0xE2, 0x4D, 0x28, 0x76, 0x13, 0xBC, 0xD9,
0x6B, 0x0E, 0xA1, 0xC4, 0x9A, 0xFF, 0x50, 0x35, 0xEC, 0x89, 0x26, 0x43, 0x1D, 0x78, 0xD7, 0xB2,
0xD6, 0xB3, 0x1C, 0x79, 0x27, 0x42, 0xED, 0x88, 0x51, 0x34, 0x9B, 0xFE, 0xA0, 0xC5, 0x6A, 0x0F,
0xBD, 0xD8, 0x77, 0x12, 0x4C, 0x29, 0x86, 0xE3, 0x3A, 0x5F, 0xF0, 0x95, 0xCB, 0xAE, 0x01, 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, 0xB8, 0xDD, 0x04, 0x61, 0xCE, 0xAB, 0xF5, 0x90, 0x3F, 0x5A
};

uint8_t GetCRCByte(uint8_t* DATA, uint8_t LENGTH, uint8_t CRC_SEED)
{
//Keep Decrementing the Data length!
while(LENGTH--)
{
CRC_SEED = crc8_table_[(uint8_t)(CRC_SEED ^ *DATA++)];
}

return CRC_SEED;
}

3,131 Views
RC_Argo
Contributor I

Awesome, thank you for the response - my problem actually ended up being with the I2C bus which is now sorted.  Now that I have that fixed though, I am unsure how to supply the required 32MHz clock (or standalone crystal as I'm only using one module).  I have 32 MHz crystal oscillators but the interface document is very scarce on how this should be input to the RFEM. What was your solution for that?

0 Kudos
Reply

3,123 Views
ganesh3
Contributor II

Hey Bud! see the picture for details on my setup for the crystal. I used an enable line to control this crystal oscillator (it is optional)

crystal.PNG

0 Kudos
Reply

3,065 Views
RC_Argo
Contributor I

Great, many thanks for the helpful responses.  I have a functioning clock set up and the module is entering operating mode.  Unfortunately it is now failing the pulse test with error code 0xA1, "under forward power" in the low power portion of the test.  Did you run into anything similar?  The interface manual again doesn't give any information on troubleshooting.

0 Kudos
Reply