Hello everyone,
I am trying to connect I2C as a slave at JN5164. I describe the code shown below. Note that an address of slave is 0x05.
void initialFunction(){
vAHI_SiSlaveConfigure(0x05, FALSE, FALSE,
E_AHI_SIS_DATA_RR_MASK |
E_AHI_SIS_DATA_RTKN_MASK |
E_AHI_SIS_DATA_RR_MASK |
E_AHI_SIS_LAST_DATA_MASK |
E_AHI_SIS_ERROR_MASK,
FALSE);
vAHI_SiSetLocation(FALSE);
vAHI_SiRegisterCallback(_callbackForI2C);
vAHI_SiSlaveWriteData8(0x30);
}
static void _callbackForI2C(uint32 u32Device, uint32 u32ItemBitmap){
vfPrintf(&sSerStream, "Interrupted\n\r");
vAHI_SiSlaveWriteData8(0x30);
}
On the other hand, a master device works well. It can output the slave address from SDA and output clocks from SCL. I have already checked them using an oscilloscope. In spite of it, a bit of ACK/NACK remains high state. It means that the slave device is not responding.
Does anyone has ever made a program for I2C communication in the same environment?
Thank you,
Kazuki Ashida
Hi Kasuki,
What is the AN that you are working on?
Did you set up the handles interrupts priority?
For example The JN-AN-1217, the irq_JN516x.S defines the priority of the modules that you are working on. The 15 is the higher priority.
Please look at the PIC_ChannelPriorities and PIC_SwVectTable.
Hope it helps and please let me know any question that you have.
Regards,
Mario
Hi Mario,
Thank you for replying my message. I use TWE-Lite which is a wireless communication module included JN-516x. TWE-Lite is a popular module as ZigBee in Japan. I would like to connect about 5 modules via I2C, so one module is as master and others are as slave nodes. I don't know "JN-AN-1217", so could you tell me the relationship between JN-AN-1217 and JN516x?
Thank you,
Kazuki Ashida
Hi Kazuki,
I am not sure the example project that you took as reference.
The JN-AN-1217 has a file example that defines the I2C interrupts. The irq_JN516x.S file is included in that example,
You could look at and take as a reference.
Regards,
Mario
Hi Mario,
I would appreciate it if you tell me the place of the example file for JN-AN-1217? I don't know the place.
Thank you,
Kazuki Ashida
Hi Kasuki,
Please look at the Zigbee 3.0 JN-AN-1217
I am not sure how are you developing with the JN devices.
Are you using the Beyond Studio IDE?
Regards,
Mario