05-11-2018 04:44 PM - last edited on 04-04-2024 01:36 PM by Content Cleaner
Hello,
I'm having trouble using the NI-9402 module for I2C communication to a sensor (MC3670 accelerometer):
My connection:
What I'm trying to do:
Troubleshooting on the scope: this is what I'm seeing on the scope =
0x4C | Write = 0 | Acknowledge by the Slave (MC3672 sensor)
0x0D | Acknowledge by the Slave
0x40 | Acknowledge by the Slave
0x0D | Acknowledge by the Slave | Repeated Start
0x4C | Read = 1 | Acknowledge by the Slave
0x40 | NACK by the Master (NI-9402) | Start Stop
The Labview Front Panel is reporting a 0x00 byte read. It's not seeing this 0x40 as I'm seeing on the scope.
Other troubleshooting methods that I tried:
Attachments:
Any help would be appreciated. Thank you.
05-11-2018 07:10 PM
Hello,
I've since gotten it to work. I'm not sure what I did differently, but I did move a couple of items around in the block diagram; see attachments for the final VIs.
07-11-2019 08:44 AM
Hello.
I'm trying to communicate I2C using NI9402 with the I2C API you mentioned but keep fails.
1. Where did you implemented I2C protocol on cRIO, scan engine interface in RT or FPGA?
2. How did you set the input/output properties of NI9402 nodes for SDA and SCL in the project explorer? Should it be inout or output?
3. Did you used pull up resistor for SDA and SCL?
I hope you could share your project files so that I can refer your project to debug mine.
Best regards
07-11-2019 12:13 PM
Hi, wow, this project was so long ago so I'll try my best to remember the details.
1) I implemented this I2C protocol under cRIO --> Chassis --> FPGA Target (see attached image "9402")
2) In my previous post, I had pictures of my Labview code. Was that helpful? There was a library in Labview for NI-9402, and I used all of those libraries (see attached picture "I2C") to configure the NI-9402 for I2C. I don't remember setting the input/output of the SDA and SCL.
3) On my hardware, yes, I did use 10kOhm (?) resistors for SDA and SCL.
4) I'll have to dig up my old project files to get the Labview code. If I can find them, I'll share in a later post.