Something I never thought much about. (Guess I should have)
Use to my Spider (Just does it’s thing from Visual Studio) and I never have to worry…
My ChipworksX and G400-D a different matter.
Example using the common Gadgeteer Button Module on a G400HDR
X9 PU Y
Socket 9 Pin 3 G400_96 ( JP1_35, PB18 / IRQ / ADTRG )
Socket 9 Pin 4 G400_200 ( JP1_3, PA7 / TXD2 ) - (COM4 TXD / SPI0 NPCCS1)
Using Socket 9 Pin 4 for OutputPort
(Cpu.Pin)G400.Pin.PA7 ID returns GPIO_Pin7
(The Gadgeteer Button module LED)
Using Socket 9 Pin 3 InterruptPort
(Cpu.Pin)G400.Pin.PB18 ID returns 50
(The Gadgeteer Button module switch output)
(Cpu.Pin)G400.Pin.PA7 ID = GPIO_Pin7 maps to G400-D processor Pin 200
(??? on schematic)
(Cpu.Pin)G400.Pin.PB18 ID = 50 maps to G400-D processor Pin 96 (PC6)
I do not see the relation of the ID to the actual processor pin number.
Can someone explain this to me?
using G400 = GHI.Hardware.G400; //FEZ Hydra
static OutputPort LED;
static InterruptPort Socket9Button;
LED = new OutputPort((Cpu.Pin)G400.Pin.PA7, true);
Debug.Print("Button LED using pin: " + LED.Id.ToString());
Socket9Button = new InterruptPort((Cpu.Pin)G400.Pin.PB18, false,
Port.ResistorMode.PullUp, Port.InterruptMode.InterruptEdgeBoth);
Debug.Print("Button interrupt using pin: " + Socket9Button.Id.ToString());
The code works.
Visual Studio Debug Output
Button LED using pin: 7
Button interrupt using pin: 50
Thanks…