LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

ADXL 345 I2C "NAK" error with myRIO 1900

Hello guys,

 

I've been trying to run a project that aims to read the accelerometer readings via I2C and displays it on the graph.

The problem is I saw a video of this project running smoothly but with me it popped up this error.

Error.PNG

I understand that the error is that the device is reading a no ack signal, I have no idea why.

Any solutions out there? I'd be more than thankful.

 

Please find attached the project vi.

0 Kudos
Message 1 of 2
(2,780 Views)

Hi Michel66,

As you mentioned, that error is a "No Acknowledge" error that occurs when an I2C slave does not acknowledge transmissions from the Master. In this case, the master is your myRIO-1900 and the slave is the I2C device you are communicating with. One very common cause for this error would be using the wrong slave address. Ensure that the "PmodACL address" value on the block diagram matches the address of your I2C slave. 

I would also recommend hooking up a Logic State Analyzer or similar way of monitoring the signal to see if the acknowledge is being sent at all from the slave. If the acknowledge is not being sent, there could be an issue with the slave or with your I2C Bus. 

Does the error happen the first time you try to transmit? Or does it occur after running for some time? If it's the latter, you might be able to modify the code with error handling to retry a transmission when a NAK error is received. 

Charlie J.
National Instruments
0 Kudos
Message 2 of 2
(2,759 Views)