Hi all, I’m completely new (and stuck) with what I feel should be a very simple task so I thought maybe somebody would have a quick fix or suggestion. I have a FEZ cerberus board (which I know is discontinued) but I’m making modifications to an older project which uses it.
Here’s the set up:
Socket 2= used to talk over USB (I send commands from a GUI on my computer)
Socket 8= used to deploy code (from VS 2013 using SDK 4.2) to the cerberus
Socket 5= used to communicate over SPI with motor chips
This has all been working well. But now, I want to talk over I2C with another chip. I used what seemed to be pretty simple code found here (I just copied the code from the “An I2C example” into a function that I call): https://www.ghielectronics.com/docs/12/i2c
but it keeps giving me the “Failed to perform I2C transaction” message. I then took a scope to socket 1 (since that is where I2C is available) and saw nothing on the signal pins (power pins were fine). Oddly enough, I did see signals coming from socket 6 (which doesn’t support I2C) on the scope. I know this signaling is coming from the I2C code and not my motor SPI code because the function I call only has the I2C code in it from the link above. I have attached two pics from the scope in case that is of interest. Note that in the zoomed out photo blue is pin 9 (I think clock) while yellow is pin 7 (I think data), but vice versa in the zoomed in photo since I swapped the probe channels (so yellow clock and blue data).
So I gave up and tried using the code from this link: How to use Gadgeteer Interfaces directly from your application | Microsoft Learn
Once again, I just put it in a function and called it. Except the GetSocket(int, true, null, null) function always throws an exception saying that the socket number is invalid (I’ve tried 0 to 100, all are invalid). So obviously this code doesn’t work for me.
In summary, I’m just trying to get a signal to come out of socket 1 since that is where it should be (and I’m already using socket 2 which is the only other socket with I2C). I can’t even get the simplest of examples to work and the only thing I can think of is that somehow when you set up the SPI comm it disallows I2C comm even though it’s on other sockets (which I highly doubt is true but I have no other ideas. The code is so simple and I just copied it)
Any help or advice as to what do do next is appreciated.
Thanks!