Multifunction DAQ

cancel
Showing results for 
Search instead for 
Did you mean: 

I2C with USB 6008

Is it possible to do I2C Communication with the USB-6008 daq? I need to output a byte to a pic18 micro, and thought I2C would be the easy route but I'm not sure if its possible to do this with the 6008. It would help if anyone can give me advice on how to implement sending a byte of info from Labview via the USB-6008 to a PIC18 micro I would appreciate it...
0 Kudos
Message 1 of 5
(6,304 Views)
no chance to use a max232 and a serial port?
Greetings from Germany
Henrik

LV since v3.1

“ground” is a convenient fantasy

'˙˙˙˙uıɐƃɐ lɐıp puɐ °06 ǝuoɥd ɹnoʎ uɹnʇ ǝsɐǝld 'ʎɹɐuıƃɐɯı sı pǝlɐıp ǝʌɐɥ noʎ ɹǝqɯnu ǝɥʇ'


0 Kudos
Message 2 of 5
(6,276 Views)

Hi willnage-

 

     I2C Communication would be very difficult using the USB 6008.  It would require more work than it is really worth. 

 

     We have another very inexpensive USB device, the USB-8451, that is made specifically for I2C communication.

 

     Best of luck with your application.  I hope this helps!

Gary P.
Applications Engineer
National Instruments
0 Kudos
Message 3 of 5
(6,262 Views)

Hi GParente

 

The problem is the system is already a working system with the USB6008 integrated into it. I have to integrate the PIC into the system so that it can communicate with the USB6008. Is there some way to do this? I just have to send the pic a byte from LabView dependant on the zero crossover from the mains (this circuit is already designed) I just need some help with the communication between the PIC and the USB6008.

 

Thanks a lot for the help.

 

Willie

0 Kudos
Message 4 of 5
(6,247 Views)

Willie,

 

It is actually very simple to do especially if you are writting the LV code as master.  I did it at a previous job using the USB-6501 and it worked well.  As I don't have the code anymore, I'll give you the basics from what I remember for the way I did it.

 

1)   Convert the byte you want to transmit to an array of boolean.

2)   Set SCL=1 and SDA=1

3)   Set SDA=0  (Start Condition)

4)   Set SCL=0

5)   Index through your boolean array and set SDA

6)   Clock the data (SCL=>1 then 0)

7)   After the 8th bit is clocked, change SDA to an input

😎   Clock the ACK bit from the PIC

9)   Set SDA=0

10) Set SCL=1

11) Set SDA=1  (Stop Condition)

 

 

A question I have is are you actually sending data (some value between 0 and 255) or just letting the PIC know the instant of zero crossover?  If it's the latter, I would think using a single bit interupt would be the better way to go.

 

Tom 

0 Kudos
Message 5 of 5
(6,232 Views)