[NHS3100][I2C] How to run and test the "i2c: I2C Driver Example", that is, "app_example_dp_i2c" in "release_mra2_10_1_nhs3100.zip"

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

[NHS3100][I2C] How to run and test the "i2c: I2C Driver Example", that is, "app_example_dp_i2c" in "release_mra2_10_1_nhs3100.zip"

Jump to solution
1,093 Views
aresmarser
Contributor III
Hi Sir,
I am now working on NHS3100 with LPCXpresso.
I downloaded "release_mra2_10_1_nhs3100.zip" and imported to LPCXpresso.
I tried to test/run the "app_example_dp_i2c" to study how the I2C Driver works.
But I got some problem to understand the behavior of the example.
And I read the "\release_mra2_10_1_nhs3100\docs" for "i2c: I2C Driver Example", which talks about:
-------------
How to setup
 User can use two NHS demo boards for the example application. The I2C pins - PIO0_4 and PIO0_5 - of the two boards are to be connected back to back. User need to also ensure that PIO0_4 and PIO0_5 are pulled-up.
 To evaluate this example, user can flash one of the boards with the master build and the other board with the slave build.
Note
 The I2C IRQ handler is implemented in the I2CIO mod. In case this module is not linked in the application, the application itself needs to implement it.
-------------
 
Here are my questions:
1. "User need to also ensure that PIO0_4 and PIO0_5 are pulled-up."
=> What does it mean? Should I modified the example project "app_example_dp_i2c"?
2. "The I2C IRQ handler is implemented in the I2CIO mod. In case this module is not linked in the application, the application itself needs to implement it."
=> What does it mean? Should I modified the example project "app_example_dp_i2c" so that it can run correctly?
I am working hard for making the whole thing clear but I am still confused.
Sorry but it is a little new for me for this topic.
Appreciated your support and help.
Many thanks and regards,
Arna
1 Solution
897 Views
driesmoors
NXP Employee
NXP Employee

1. "User need to also ensure that PIO0_4 and PIO0_5 are pulled-up." 

The basic function of a pull-up is to insure that given no other input, a circuit assumes a default value. See e.g. resistors - What is a pull up and pull down? - Electrical Engineering Stack Exchange for an introduction. So, no: this requires no change to your code, but you must check your physical setup.

2. "The I2C IRQ handler is implemented in the I2CIO mod. In case this module is not linked in the application, the application itself needs to implement it."

This is about the interrupt handler only, and a general comment in case you are moving away from the example or demo code. The example application app_example_dp_i2c does take the I2CIO module in, so there is no need to do something extra there. But since the I2CIO module provides an implementation of I2C0_IRQHandler, and you make your own application without this module, you will have to provide your own implementation of I2C0_IRQHandler yourself (likely just copying and pasting it somewhere).

Best,
Dries.

View solution in original post

2 Replies
898 Views
driesmoors
NXP Employee
NXP Employee

1. "User need to also ensure that PIO0_4 and PIO0_5 are pulled-up." 

The basic function of a pull-up is to insure that given no other input, a circuit assumes a default value. See e.g. resistors - What is a pull up and pull down? - Electrical Engineering Stack Exchange for an introduction. So, no: this requires no change to your code, but you must check your physical setup.

2. "The I2C IRQ handler is implemented in the I2CIO mod. In case this module is not linked in the application, the application itself needs to implement it."

This is about the interrupt handler only, and a general comment in case you are moving away from the example or demo code. The example application app_example_dp_i2c does take the I2CIO module in, so there is no need to do something extra there. But since the I2CIO module provides an implementation of I2C0_IRQHandler, and you make your own application without this module, you will have to provide your own implementation of I2C0_IRQHandler yourself (likely just copying and pasting it somewhere).

Best,
Dries.

897 Views
aresmarser
Contributor III

Hi  Dries Moors,

Thanks a lot, Sir.

I got more understanding.

Another question:

If I use polling event handler instead of interrupt based handler, that is, using item 1 instead of item 2 as below, I don't need I2C0_IRQHandler  in this case, right?

1. Chip_I2C_SetMasterEventHandler(I2C0, Chip_I2C_EventHandlerPolling);

2. Chip_I2C_SetMasterEventHandler(I2C0, Chip_I2C_EventHandler);

Thanks,

Arna

0 Kudos