04-30-2010 05:07 AM
05-03-2010 03:56 AM
05-03-2010
12:05 PM
- last edited on
03-27-2025
04:57 PM
by
Content Cleaner
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!
05-04-2010 12:50 AM
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
05-04-2010 07:31 AM
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