From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

Digital I/O

cancel
Showing results for 
Search instead for 
Did you mean: 

DIO32-HS I2C BUS Implementation

Hello I need some help...

I want to implement an I2C Master at a PC. I did it with the parallel port and it works fine. Unfortunatelly the parallel port is to slow for my application.

I want to use the DIO-32HS High speed IO card for doing it.

Until now I could not synchronise the write port with the read port. In my application I use port 2 for writing (generation of the SCL and SDA_out). Port 0 is configured to read (reading od SDA_in).
At Hardware level I use an open collector buffer with the pull up resistor.

Does anybody know what I have to do for synchronising both ports? What Handshake Mode should I use ? Is a hardware connection nessecary (REG ,ACK)?
Does anybody has an example for this. There is one in the Code Li
brary SyncDio.vi but i can't use it (continous mode), I need a single bufferd Input and Output mode.

thanks for your help

MarciDarci
0 Kudos
Message 1 of 2
(3,040 Views)
MarciDarci,

It does not appear that any example programs exist for your application, but it should not be too difficult to combine a couple of example programs that install with NI-DAQ to accomplish your task:

DOsingleBufPatternGen653x.C
DIsingleBufPatternGenExtClock653x.C

To synchronize your output and input, you need to share the clock these two operations are using. In your case, the output operation should generate the clock (internal clock), and the input operation should use this clock (external clock). Because the input operation is the slave in this situation, it should be configured and started before the output operation. Furthermore, you will need to either wire REQ1 to REQ2 or route the clock through the RTSI bus.

Good luck with your a
pplication.

Spencer S.
0 Kudos
Message 2 of 2
(3,040 Views)