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.
Solved! Go to Solution.
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.
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.
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.
Regards,
Mario