Having a little bit of a brain stump-er here trying to get this module to work with the user socket on the G120HDR. Basically i wired up the user socket to be an I type socket for the HUB.
Here is a picture of my wiring but basically it breaks down to this pin assignment that i have double and triple checked. And actually pulled from the current Fez Cobra Driver for 4.3.5.
pin 3 = P0_25
pin 6 = P1_0
pin 8 = P0_27 (SDA)
pin 9 = P0_28 (SCL)
Module is getting power from the user socket as the Led is lit.
Here is a very simple test program i threw together to replicate the problem
public class Program
{
public static void Main()
{
GT.Socket socket;
socket = GT.Socket.SocketInterfaces.CreateNumberedSocket(1);
socket.SupportedTypes = new char[] { 'A', 'I', 'T', 'X' };
socket.CpuPins[3] = G120.P0_25;
socket.CpuPins[4] = Cpu.Pin.GPIO_NONE;
socket.CpuPins[5] = Cpu.Pin.GPIO_NONE;
socket.CpuPins[6] = G120.P1_0;
socket.CpuPins[7] = Cpu.Pin.GPIO_NONE;
socket.CpuPins[8] = G120.P0_27;
socket.CpuPins[9] = G120.P0_28;
GT.Socket.SocketInterfaces.RegisterSocket(socket);
HubAP5 hub = new HubAP5(1);
new TestModule(hub.HubSocket1);
}
}
public class TestModule : Gadgeteer.Modules.Module
{
private Gadgeteer.Socket Socket { get; set; }
private Gadgeteer.SocketInterfaces.InterruptInput Interrupt { get; set; }
public TestModule(int socket)
: base()
{
this.Socket = Gadgeteer.Socket.GetSocket(socket, true, this, "Test Module");
Interrupt = Gadgeteer.SocketInterfaces.InterruptInputFactory.Create(this.Socket,
Gadgeteer.Socket.Pin.Three,
Gadgeteer.SocketInterfaces.GlitchFilterMode.On,
Gadgeteer.SocketInterfaces.ResistorMode.Disabled,
Gadgeteer.SocketInterfaces.InterruptMode.FallingEdge,
null);
}
}
Now the issue is that i get a Native I2c Exception informing that the device may not be connected. When i try to create the first Interrupt. I have also tried creating Digital pins with no difference in outcome as it throws the same I2c exception.
Now ive gone over my wiring and the pin outs in the documentation multiple times so i have to rule that out as a cause of the problem.
My current project is a stock .net MF project.
I debugged into the ap5 using a pdb i built locally and the exception is coming from a write but i was able to verify the hub is getting the correct socket assignment in software.
No idea why I’m having so many problems with getting this module to work. I have a hub AP5 running in a g400 project on software i2c and it works fine controlling the touch on a cp7 touch screen. I converted it to software i2c driver for that project because of a clock stretching issue with the cp7 screen but i did have it working with native i2c first.
There must be some configuration setting i’m missing somewhere to cause the i2c to not initialize.
Here is the exact exception text:
Additional information: SoftwareI2C: Exception writing to device at address 32 - perhaps device is not responding or not plugged in.
Want to add that I’m running the latest .net micro framework and gadgeteer release.
Also:
In an attempt to be thorough
I grabbed the project here
https://www.ghielectronics.com/community/codeshare/entry/755#
I converted it to 4.3.5 and the latest gadgeteer assemblies and installed it so i could use the designer as i was worried i was missing config settings or initializations. I implemented a single I socket on the user socket and created a similar test project to the one above. And can repeat the exception. Also quadruple checked the wiring for shorts to other pins and that all checks out.
Added some pics of the beast it is going into when i get it to work. I’ll have it controlling an statefull rgb led button board along with a blackberry track ball mounted to the grip interfacing to my desktop through usb. I’ve kind of gotten sucked into building a set of custom flight sim gear lately.
I suppose the next thing on my shopping list will be a logic analyzer because i just don’t have the tools to track this much further. One thought would be missing pullups on the SDA and SCl lines but id expect the AP5 to have pull ups built in if it needed them. And also the manual mentions there being built in pullups on all of the gpio pins.