JN5168 I2C Can Not Initialize

取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 
已解决

JN5168 I2C Can Not Initialize

跳至解决方案
2,234 次查看
xleaderx
Contributor I

Hello guys!
I have a problem with i2c interface on JN5168 module.
I have a function to initialize I2C interface on module, but it completely blocks device (Look like hard fault)

Here is includes:
/*-- Hardware specific libraries --------------------------------------------*/
#include "AppHardwareApi.h"

Here is my function:
/******************************************************************************
 *  @brief  Function
 *  @param  None.
 *  @retval None.
 *****************************************************************************/
void memExt_I2C_Init_HW(void)
{
    Debug_WriteLine("memExt_I2C_Init_HW()");

    Debug_WriteLine("Before vAHI_SiMasterConfigure()");

    ////16M/((scale+1)*5) = 100k

    //Init I2C
    //vAHI_SiMasterConfigure(TRUE, FALSE, 7);   // Enabled, no interrupt, 400kHz
    vAHI_SiMasterConfigure(TRUE, FALSE, 31);   // Enabled, no interrupt, 100kHz

    Debug_WriteLine("After vAHI_SiMasterConfigure()");
}

In my debug log i see next:
0000000.168: memExt_I2C_Init_HW()
0000000.171: Before vAHI_SiMasterConfigure()
{\xfe}

And after no more debug log, device freezes.

What is my error, why i2c is not initializing?

Of course this code executing after u32AHI_Init();
My function caling from in vStartApplication();

Using JN-4170 SDK.

标签 (3)
0 项奖励
回复
1 解答
2,130 次查看
xleaderx
Contributor I

Guys. the reason was very simple.
My debug UART uses DIO14 and DIO15, the same pins as using I2C.
DIO remapping was solution for me.

在原帖中查看解决方案

2 回复数
2,131 次查看
xleaderx
Contributor I

Guys. the reason was very simple.
My debug UART uses DIO14 and DIO15, the same pins as using I2C.
DIO remapping was solution for me.

2,130 次查看
mario_castaneda
NXP TechSupport
NXP TechSupport

Hi,

The functions for using a JN516x as a slave can be found in section 13.2 of the JN516x Integrated Peripherals API User Guide. It also includes descriptions of the process to follow so that you can receive information, sending it to an I2C master and initialization process.

 

You could also check JN-AN-1220, which has examples using different sensors.

JN516x/7x Zigbee 3.0 | NXP 

Regards,

Mario

0 项奖励
回复