hello everyone,
JN5189 i2c function, if as a slave, what is its slave address? Which document can I see?
thank you very much
Solved! Go to Solution.
Hi,
If you are using i2c_dma_transfer demo application as base for your development, this project should configure pin routing and pin features in board > pin_mux.c file. Port0_Pin6 (I2C1_SCL) and Port0_Pin7 (I2C_SDA) should be already configured in this file, and depending on your code's structure, there may be some configuration overwriting.
Could you please confirm that these pins are configured only once in your project?
Regards
Eduardo.
Hello,
If you are using the I2C driver examples from the SDK, the slave address should be defined with the macro:
#define I2C_MASTER_SLAVE_ADDR_7BIT
And it should be set to (0x7EU) by default, but you should be able to change this address. This value is then assigned to slaveConfig.address0.address field, as i2c_slave_config_t slaveConfig structure should be used to initialize the I2C Slave peripheral.
Regards,
Eduardo.
Thank you for your reply.
One more question.I used the i2c driver example in the sdk. An example of dma_transfer in the i2c folder. I compiled and then downloaded nxp JN5189 development board, in this example, i2c0 and i2c1 can communicate normally, its configuration is as follows:
I2C connected to I2C0
SCL PIO_6(J3 pin13) --> PIO_10(J3 pin17)
SDA PIO_7(J3 pin14) --> PIO_11(J3 pin18)
Above is I2c0 (PIO_10 PIO_11) as the host and I2c1 (PIO_6 PIO_7) as the slave.
It can communicate. But I want to change it to I2c1 (PIO_6 PIO_7) as the host and I2c0 (PIO_10 PIO_11) as the slave.
How do I configure the I/O port? I swapped the io configuration in the example, but it didn't communicate.
For the configuration of I/O ports, see the attachment.
How do I configure the I/O port?
Hi,
You can try swapping I2Cx_BASE addresses and setting DMA channel to 7 (as indicated in JN5189 User Manual, Chapter 17 DMA, Section 17.5.1.1 DMA requests).
Regards,
Eduardo.
Thank you for your reply.
According to your modification, I2c1 (PIO_6 PIO_7) is used as slave or host. I2c0 (PIO_10 PIO_11) as slave or host, they can communicate with each other. Now I have a light sensor that communicates with JN5189 through the i2c interface. If I use (PIO_10 PIO_11) as the host and the light sensor as the slave, they can communicate with each other. But if I use (PIO_6 PIO_7) as the host and the light sensor as the slave, they cannot communicate with each other (does not read the ack of the slave). This is a strange question, do I need to configure anything else?
Attached is the i2c code. Are there any errors?
Screenshot is the i2c0 as the host can communicate. i2c1 cannot communicate as a host
thank you
Hi,
If you are using i2c_dma_transfer demo application as base for your development, this project should configure pin routing and pin features in board > pin_mux.c file. Port0_Pin6 (I2C1_SCL) and Port0_Pin7 (I2C_SDA) should be already configured in this file, and depending on your code's structure, there may be some configuration overwriting.
Could you please confirm that these pins are configured only once in your project?
Regards
Eduardo.
thank you .The issue has been resolved. The i2c configuration is reversed
Hello@EduardoZamora do you have time to help me look at this problem, stuck on this problem