I2C JN5169 to Raspberry Pi

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

I2C JN5169 to Raspberry Pi

1,148 Views
matthew3
Contributor III

Hello,

   I am trying to use the Raspberry Pi to detect a PCB board that i have had made. The PCB as on it the JN5169 NXP Microcontroller and all the components to make it funtion. I have attached a cable that consist of 3 wires. 1st wire is SDA, 2nd wire is SCL and the 3rd wire is a common GND wire. I have attached the SDA and SCL to the output pins of the JN5169 (DIO14 - SDA and DIO15 - SCL) solder pads on my PCB board. The GND wire is attached to a GND pad that i have applied on th PCB Board. At the Raspberry Pi end i have taken the SDA wire of the cable and attached it to Pin3 on the Raspberry Pi header pins, the SCL Wire of the cable is attached to Pin5 and the GND wire is attached to Pin6. I have also added two 4.7k ohm resistors on the SDA and SCL wires for the pull up resistors to VCC 3.3v. I have eneabled the i2c on the Raspberry Pi and run the command "i2cdetect -y 1" in the Terminal window.

I am not detecting the JN5169 PCB board. See printout below:

pi@StrainSensorPi:~ $ i2cdetect -y 1

     0  1  2  3  4  5  6  7  8  9  a  b  c  d  e  f

00:          -- -- -- -- -- -- -- -- -- -- -- -- --

10: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --

20: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --

30: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --

40: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --

50: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --

60: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --

70: -- -- -- -- -- -- -- --

I have tested the Raspberry pi out with an ADXL345 board and that gets detected (address 0x53). See printout below:

pi@StrainSensorPi:~ $ i2cdetect -y 1

     0  1  2  3  4  5  6  7  8  9  a  b  c  d  e  f

00:          -- -- -- -- -- -- -- -- -- -- -- -- --

10: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --

20: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --

30: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --

40: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --

50: -- -- -- 53 -- -- -- -- -- -- -- -- -- -- -- --

60: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --

70: -- -- -- -- -- -- -- --

Do i need to enable anything in my code i2c for example for the Raspberry Pi to see it or should it be always enabled to communicate over i2c?

Regards

Matthew

Tags (2)
0 Kudos
3 Replies

952 Views
Sebastian_Del_Rio
NXP Employee
NXP Employee

Hi Matthew, I hope you're doing well!

 

To use the JN516x as an I2C master/slave, you can use the Serial Interface functions included with the SDK. Depending on which Serial Communication protocol you want to use, the two-wire serial interface can be configured using different functions. To use it as an I2C master, the functions in section 29.1 of the JN516x Integrated Peripherals API guide, and to use it as I2C slave, you can use the ones in section 29.2.

 

Could you please give me more information about your project, so I can further recommend an Application Note? Information about what you want to use the JN516x for, is it a coordinator?

 

You can find the JN516x Integrated Peripherals API Guide here.

 

Please let me know if you need more information.

 

Best regards,

Sebastian

0 Kudos

952 Views
matthew3
Contributor III

Hi Sebastian,

   I am using the JN5169 as a slave device which as the sensor attached to it and the Raspberry Pi as the Master. The sensor is a Strain Gauge connected through an external Op Amp to the JN5169 PCB board. This is giving us a millivolt reading. its the millivolts that i want to be sent to the Raspberry Pi which then can stores the values into a Database internal and also remotley up on an Amazon cloud database. From there it gets called into a webpage.

I have this working in Zigbee mode but one of our clients as asked if it could be hard wired hence i2c communication.

Regards

Matthew

0 Kudos

952 Views
Sebastian_Del_Rio
NXP Employee
NXP Employee

Hi Matthew,

 

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 on the process to follow so that you can receive information, sending to an I2C master, and initialization process.

 

You could also check JN-AN-1220, which has examples using different sensors, and you could instead send the data to the Raspberry Pi using UART.

 

Best regards,

Sebastian

0 Kudos