G400HDR & G400-D Pins

I was going crazy flipping back and forth looking through G400HDR_Breakout_SCH.pdf and G400_Module_Brochure.pdf trying to map to CPU Pins…

Well I bit my tongue and made a list… I’ll share if you need/want it.

I do not know of a way to post a text file in here so I will try Format as Code. I believe you can just copy and paste the text when you view this post.

Let me know if you find any errors…!!!



400HDR Socket types (As shown on G400HDR_Breakout_SCH.pdf)
Also using G400_Module_Brochure.pdf (latest that I know of)
(No reference Pin-Out) refers to G400_Module_Brochure? = Need to check

1	R Y	LCD Red
2	G Y	LCD Green
3	B Y	LCD Blue
4	DI	Power USB Client DP
5	Z	Not Used
6	SU Y	S (SPI) U (UART) Y (GPIO)
7	IU X	I (I2C) U (UART) X (GPIO)
8	AI X	A (Analog In) I (I2C) X (GPIO)
9	PU Y	P (PWM) U (UART) Y (GPIO)
10	F	F (SD Card)

All Sockets - Pin 1 VCC (3V3), Pin 2 +5, Pin 10 GND
	
X1 Red
Socket 1 Pin3	LCD Red0 -  D400_171  PC11
Socket 1 Pin4	LCD Red1 -  D400_172  PC12
Socket 1 Pin5	LCD Red2 -  D400_173  PC13
Socket 1 Pin6 	LCD Red3 -  D400_174  PC14
Socket 1 Pin7 	LCD Red4 -  D400_168  PC15
Socket 1 Pin8 	LCD VSYNC  -  D400_143  PC27
Socket 1 Pin9 	LCD HSYNC  -  D400_144  PC28

X2 Green
Socket 2 Pin3	LCD G0 -  D400_161  PC5
Socket 2 Pin4	LCD G1 -  D400_162  PC6
Socket 2 Pin5	LCD G2 -  D400_163  PC7
Socket 2 Pin6	LCD G3 -  D400_164  PC8
Socket 2 Pin7	LCD G4 -  D400_165  PC9
Socket 2 Pin8	LCD G5 -  D400_170  PC10
Socket 2 Pin9	LCD BACKLIGHT?  D400_138  PA28 (No reference Pin-Out)

X3 Blue
Socket 3 Pin3	LCD Blue0 -  D400_152  PC0
Socket 3 Pin4	LCD Blue1 -  D400_153  PC1
Socket 3 Pin5	LCD Blue2 -  D400_154  PC2
Socket 3 Pin6	LCD Blue3 -  D400_155  PC3
Socket 3 Pin7	LCD Blue4 -  D400_156  PC4
Socket 3 Pin8	R3 0      -  D400_119  PC24 / LCDDISP (No reference Pin-Out)
				R4 DNP    -  D400_166  ( JP1_7,  PC29 / LCDDEN) - LCD Enable
Socket 3 Pin9	LCD CLK -    D400_145  PC30 - LCD CLK

X4 DI [As shown on USB_Client_DP_Module_SCH.pdf]
Socket 4 Pin3	D400_149 [STAT] -  ( JP2_13, PD5 ) (No reference Pin-Out)
Socket 4 Pin4	D400_196 [USB_DEVICE_D-] -  ( JP12, USB_A_N, USB1 HOST/CLIENT D- )
Socket 4 Pin5	D400_194 [USB_DEVICE_D+] -  ( JP1_4, USB_A_P, USB1 HOST/CLIENT D+ )
Socket 4 Pin6	D400_137 [UD_VBUS] -  ( JP2_17, PA27 ) (No reference Pin-Out)
Socket 4 Pin7	D400_139 [JACK_DET] -  ( JP2_16, PA29 ) (No reference Pin-Out)
Socket 4 Pin8	D400_115 [No connection]  ( JP2_26, PA30/TWD0 ) - I2C SCL
Socket 4 Pin9	D400_116 [No connection]  ( JP1_26, PA31/TWCK0 ) - I2C SDA

X5 Z (Not Used)?

X6 SU Y
Socket 6 Pin3	D400_101  ( JP2_31, PC31/FIQ )
Socket 6 Pin4	D400_98   ( JP1_34, PA5/TXD1 ) - COM3 TXD/CANTX1
Socket 6 Pin5	D400_99   ( JP2_34, PA6/RXD1 ) - COM3 RXD/CANRX1
Socket 6 Pin6	D400_100  ( JP1_33, PC22/LCDDAT22 ) (No reference Pin-Out)
!! Brochure shows PA21 and PA22 - Both as SPI1 MOSI
Socket 6 Pin7	D400_178  ( JP1_5, PA22/SPI1_MOSI ) 
Socket 6 Pin8	D400_176  ( JP1_1, PA21/SPI1_MISO ) 
Socket 6 Pin9	D400_175  ( JP2_9, PA23/SPI1_SPCK ) - SPI1 SPCK

X7 IU X
Socket 7 Pin3   D400_136  ( JP1_18, PA26 ) (No reference Pin-Out)
Socket 7 Pin4   D400_118  ( JP1_25, PA10/DTXD ) - COM1 DTXD/CANTX0
Socket 7 Pin5   D400_117  ( JP2_23, PA9/DRXD ) _ COM1 DRXD/CANRX0
Socket 7 Pin6   D400_104  ( JP1_31, PB12/AD1/PWM1 ) - AD1
Socket 7 Pin7   D400_     No connection
Socket 7 Pin8   D400_115  ( JP2_26, PA30/TWD0 ) - I2C SCL
Socket 7 Pin9   D400_116  ( JP1_26, PA31/TWCK0 ) - I2C SDA

X8  AI X
Socket 8 Pin 3	D400_158  ( JP1_9, PB14 / AD3 / PWM3 ) - AD3
Socket 8 Pin 4	D400_159  ( JP2_11 , PB15 / AD4 ) - AD4
Socket 8 Pin 5	D400_114  ( JP1_27, PB16 / AD5 ) - AD5
Socket 8 Pin 6	D400_110  ( JP1_29, PB17 / AD6 ) - AD6
Socket 8 Pin 7	No connection
Socket 8 Pin 8	D400_115  ( JP2_26, PA30 / TWD0 ) (I2C SCL / SPI1 NPCS3 ) - I2C SCL
Socket 8 Pin 9	D400_116  ( JP1_26, PA31 / TWCK0 ) (I2C SDA / SPI1 NPCS2 ) - I2C SDA
 
X9  PU Y
Socket 9 Pin 3	D400_96   ( JP1_35, PB18 / IRQ / ADTRG ) - IRQ/ADTRG
Socket 9 Pin 4	D400_200  ( JP1_3, PA7 / TXD2 ) - (COM4 TXD / SPI0 NPCCS1) - COM4 TXD
Socket 9 Pin 5	D400_167  ( JP2_10 , PA8 / RXD2 / SPI1_NPCS0 ) - COM4 RXD
Socket 9 Pin 6	D400_132  ( JP1_20, PC26 ) (No reference on Pin-Out)
Socket 9 Pin 7	D400_105  ( JP2_29 , PC18 / LCDDAT18 / PWM0 ) - PWM0
Socket 9 Pin 8	D400_130  ( JP1_19, PC21 / LCDDAT21 / PWM3 ) - PWM3
Socket 9 Pin 9	D400_133  ( JP2_19, PC20 / LCDDAT20 / PWM2 ) - PWM2
......................................................................................
GND	Reset button    NRST 
GND	LDR1  button	PA4
GND	LDR0  button	PA24/LDR0




2 Likes

@ willgeorge - I just commented on another post that they could use the code for the G400HDR Mainboard to get the mapping. BUT, this is 1000x better, thank you for sharing!

It might be worth including a comment on socket 6 indicating that it uses SPI module 2, the pin designation can mislead one to think it is SPImodule 1

@ Aron, this list might be nice to include on th developer page for the G400HDR.

@ taylorza - Thanks for your code!

I do have a question about using it with a Distance US3 … Maybe you know the answer.

Sorry if this is not the proper place to ask…

I cannot attach a Distance US3 to my G400HDR/G400-D

In Program.generated.cs - Main(), InitializeModules() I receive:

Invalid address 22706930 and range 4 Ram Start 20000000, Ram end 20100000
#### Exception System.ArgumentException - 0xfd000000 (1) ####
#### Message:
#### Microsoft.SPOT.Hardware.Port::.ctor [IP: 0000] ####
#### Microsoft.SPOT.Hardware.InputPort::.ctor [IP: 0008] ####
#### Gadgeteer.Interfaces.DigitalInput::.ctor [IP: 0015] ####
#### Gadgeteer.Modules.GHIElectronics.Distance_US3::.ctor [IP: 003b] ####
#### GadgeteerAppG400.Program::InitializeModules [IP: 0023] ####
A first chance exception of type ‘System.ArgumentException’ occurred in Microsoft.SPOT.Hardware.dll
An unhandled exception of type ‘System.ArgumentException’ occurred in Microsoft.SPOT.Hardware.dll

private Gadgeteer.Modules.GHIElectronics.Distance_US3 distance_US3;

Error here > this.distance_US3 = new GTM.GHIElectronics.Distance_US3(6);

I have tried Sockets 6 through 9 and I receive the null error on each socket.

I know the Distance US3 is OK because it works on my Spider.

Any suggestions?

@ willgeorge - I believe you might have found a bug in the port? It seems that when configuring an IO pin’s pull-down resistor this exception is generated.

Try the following in a straight .NETMF application for the G400.

This works:


var port = new InputPort((Cpu.Pin)26, false, Port.ResistorMode.PullUp);

This fails with the same exception you are seeing


var port = new InputPort((Cpu.Pin)26, false, Port.ResistorMode.PullDown);

GHI will need to confirm, but looking at the data sheet the MCU supports pull down configuration on PIOA so I do not see why it should not work other than it being a bug.

BTW. pin 26 is PA26 -> Pin 3 on Socket 7. Pin 3 is used in the distance module driver capture the echo.

1 Like

@ taylorza -

Thanks for the quick reply…

I will try tomorrow… Off to babysit my granddaughters in a bit…

Now that you mention it, I had the problem before and made a note to myself…
I forgot all about it

//Exception when using Port.ResistorMode.PullDown
Socket9Button = new InterruptPort((Cpu.Pin)G400.Pin.PB18, false, Port.ResistorMode.PullUp, Port.InterruptMode.InterruptEdgeBoth);

Babysitting called off. Parents changed plans…

I was looking at the Distance_US3_42.cs driver file and I see…



/// <summary>Constructor</summary>
/// <param name="socketNumber">The socket that this module is plugged in to.</param>
public Distance_US3(int socketNumber)
{
    Socket socket = Socket.GetSocket(socketNumber, true, this, null);
    socket.EnsureTypeIsSupported(new char[] { 'X', 'Y' }, this);

    Echo = new GTI.DigitalInput(socket, Socket.Pin.Three, GTI.GlitchFilterMode.Off,
                                             GTI.ResistorMode.PullDown, this); 

    Trigger = new GTI.DigitalOutput(socket, Socket.Pin.Four, false, this);
}


I think I’ll play around and see if I can modify Echo
by changing the GTI.ResistorMode.PullDown and get it to work.
(Not change the official driver) Just use the code (modified) locally in my application…

Sounds like fun!