Can the I2C API be used without a subaddress/register address step?

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

Can the I2C API be used without a subaddress/register address step?

2,946 Views
bburch
Contributor III

Hi!

I am using an NXP-824 to drive a radio device.  The device does not have any register addresses defined, and wants to just send a group of bytes based on a function code (which is not in the right place to pretend to be a register address) and I cannot seem to get the API to not try to send the register address to the device.

Is it possible with the standard API?

Is there a modified version of the API that is without subaddress?

A bit of googling suggests that others have hit this snag, so I am hoping one of you has some advice.

Thanks!

-BenBurch

BTR Controls, Inc.

Labels (2)
7 Replies

2,737 Views
Sabina_Bruce
NXP Employee
NXP Employee

Hi Ben,

I want to make sure I'm understanding correctly what you are trying to achieve so please correct me if I'm wrong.

I have a couple additional questions concerning the I2C protocol. As a standard, each time a device receives a byte it responds with an ack/nack bit. 

Introduction to I2C - Message, Frame, and Bit

If I understood correctly, you want to send data from the radio to the LPC, correct? If this is the case each time you send a byte, the LPC will respond with an ack/nack bit. Does your radio have the ability to manage this acknowledgement bit? If not, it will affect the communication directly, since the LPC will be modifying the data line.

So keep in mind that if the above mentioned is your case. It will not be possible to follow through using I2C, in that case you would have to emulate the communication using GPIOs(although this might be more complicated and we dont have any examples of how this can be implemented).

I would suggest here to take a look at the MCUs that have the FlexIO. The FlexIO is a highly configurable module providing a wide range of functionality including: emulation of a variety of serial communication protocols. The Kinetis KL43 is a Cortex-M0+ (same as the LPC824) and does support FlexIO. 

Best Regards,

Sabina

2,737 Views
bburch
Contributor III

Sorry for taking a while to get back to you - I got very busy!  

Yes, we are seeing the appropriate ACK sent out.  What was tripping me up was that the LPC software was trying to send out a register address when the radio had no concept of a register address.  By specifying the register as being length zero, that phase is skipped.  The 824 is the only processor we can use here, but thank you for the recommendation.

We are sending out our command to the radio, and the radio is sending back the expected results.

-Ben Burch

BTR Controls

0 Kudos

2,737 Views
Sabina_Bruce
NXP Employee
NXP Employee

Hi Ben,

Good! As long as the ACK bit is being handled correctly then you can send data instead  of the initial address byte.

From what I understand you are now successfully communicating between the radio and the LPC824? If so, do you have any other questions?

Best Regards,

Sabina

2,737 Views
bburch
Contributor III

Yes, I believe this is working so far, and thank you for your attention!

-Ben Burch

BTR Controls

0 Kudos

2,737 Views
bburch
Contributor III

Oh, and yes it is an 824.  Using the dev board now, but the production part will use the 20 pin package.

0 Kudos

2,737 Views
Sabina_Bruce
NXP Employee
NXP Employee

Hello Ben,

My name is Sabina and I will be assisting you. In order to provide a more accurate solution I will need more information. I would like to confirm first if the NXP device you are using is in fact the LPC824. 

1. Are you using any of the examples we provide?

2. Can you specify the communication protocol that your radio device supports? I ask this, because it seems strange that if the radio device supports I2C that it does not have an address associated.

Let me know this information, so I can continue to help you.

Thank you and have a great day!

Sabina

2,737 Views
bburch
Contributor III

Sabina,

Well, the object we need to talk with wants to send fixed size 13 byte messages with a function code embedded in a place where it will not serve as a register address.  It is NOT a standard i2c part, but is a microprogram using i2c wiring.  I am (at the start) using the i2c master polling example which I have modified.

Also in this system, there can be only two devices, either may be master, both have i2c address of 0x00!

What I did discover was;

1. i2c_master_transfer_t structure allows specifying a zero byte register address.

2. Then I2C_MasterTransferBlocking can be used to send the message without the subaddress and without the repeated start step.

So, it appears that I can make it do what I need, but I wonder if this is the best way to accomplish this?

-BenB

0 Kudos