Subversion Repositories Code-Repo

Rev

Details | Last modification | View Log | RSS feed

Rev Author Line No. Line
193 Kevin 1
 
2
 
3
 
4
// Power supply must be 5V for proper operation of the board!
5
 
6
#define ADDRESS_EEPROM 0x50
7
 
8
// BTN1 = RG6, BTN2 = RG7, BTN3 = RD13
9
// Note: Write to PORTx is effectively the same as write to LATx
10
#define BTN1_TRIS TRISGbits.TRISG6
11
#define BTN1_PORT PORTGbits.RG6
12
#define BTN2_TRIS TRISGbits.TRISG7
13
#define BTN2_PORT PORTGbits.RG7
14
#define BTN3_TRIS TRISDbits.TRISD13
15
#define BTN3_PORT PORTDbits.RD13
16
 
17
// LED1 = G12, LED2 = G13, LED3 = G14, LED4 = G15
18
#define LED1_TRIS TRISGbits.TRISG12
19
#define LED1_PORT PORTGbits.RG12
20
#define LED2_TRIS TRISGbits.TRISG13
21
#define LED2_PORT PORTGbits.RG13
22
#define LED3_TRIS TRISGbits.TRISG14
23
#define LED3_PORT PORTGbits.RG14
24
#define LED4_TRIS TRISGbits.TRISG15
25
#define LED4_PORT PORTGbits.RG15
26
 
27
// <editor-fold defaultstate="collapsed" desc="PMOD to MCU Pinouts">
28
/*
29
JA-01	AN2/C2IN-/CN4/RB2			RB02
30
JA-02	AN3/C2IN+/CN5/RB3			RB03
31
JA-03	AN4/C1IN-/CN6/RB4			RB04
32
JA-04	PGEC2/AN6/OCFA/RB6			RB06
33
JA-07	PGED2/AN7/RB7				RB07
34
JA-08	AN8/C1OUT/RB8				RB08
35
JA-09	AN9/C2OUT/RB9				RB09
36
JA-10	CVrefout/PMA13/AN10/RB10		RB10
37
 *
38
JB-01	PMD0/RE0				RE00
39
JB-02	PMD1/RE1				RE01
40
JB-03	PMD2/RE2				RE02
41
JB-04	PMD3/RE3				RE03
42
JB-07	PMD4/RE4				RE04
43
JB-08	PMD5/RE5				RE05
44
JB-09	PMD6/RE6				RE06
45
JB-10	PMD7/RE7				RE07
46
 *
47
JC-01	T2CK/RC1				RC01
48
JC-02	C2RX/PMD8/RG0				RG00
49
JC-03	C2TX/ETXERR/PMD9/RG1			RG01
50
JC-04	ETXCLK/PMD15/CN16/RD7			RD07
51
JC-07	AN15/?/OCFB/PMALL/PMA0/CN12/RB15       RB15
52
JC-08	PMRD/CN14/RD5				RD05
53
JC-09	OC5/PMWR/CN13/RD4			RD04
54
JC-10	AN14/ERXD2/AETXD3/PMALH/PMA1/RB14       RB14
55
 *
56
JD-01	SS1/IC2/RD9				RD09
57
JD-02	SDO1/OC1/INT0/RD0			RD00
58
JD-03	T5CK/SDI1/RC4				RC04
59
JD-04	SCK1/IC3/PMCS2/PMA15/RD10		RD10
60
JD-07	OC2/RD1					RD01
61
JD-08	OC3/RD2					RD02
62
JD-09	OC4/RD3					RD03
63
JD-10	ETXD2/IC5/PMD12/RD12			RD12
64
 *
65
JE-01	AETXD0/SS1A/U1BRX/U1ACTS/CN20/RD14	RD14
66
JE-02	SCL1A/SDO1A/U1ATX/RF8			RF08
67
JE-03	SDA1A/SDI1A/U1ARX/RF2			RF02
68
JE-04	AETXD1/SCK1A/U1BTX/U1ARTS/CN21/RD15	RD15
69
JE-07	TRCLK/RA6				RA06
70
JE-08	TRD3/RA7				RA07
71
JE-09	Vref-/CVref-/AERXD2/PMA7/RA9            RA09
72
JE-10	Vref+/CVref+/AERXD3/PMA6/RA10		RA10
73
 *
74
JF-01	AC1RX/SS3A/U3BRX/U3ACTS/RF12		RF12	shared with CAN1 Transceiver (JP-1)
75
JF-02	SCL3A/SDO3A/U3ATX/PMA8/CN18/RF5		RF05
76
JF-03	SDA3A/SDI3A/U3ARX/PMA9/CN17/RF4		RF04
77
JF-04	AC1TX/SCK3A/U3BTX/U3ARTS/RF13		RF13	shared with CAN1 Transceiver (JP-2)
78
JF-07	TMS/RA0					RA00
79
JF-08	TCK/RA1					RA01
80
JF-09	TDI/RA4					RA04
81
JF-10	TDO/RA5					RA05
82
 
83
N/A	SCL2/RA2				RA02	I2C bus #2, not shared with Pmod connector
84
N/A	SDA2/RA3				RA03	I2C bus #2, not shared with Pmod connector
85
N/A	AETXCLK/SCL1/INT3/RA14			RA14	I2C Bus #1, not shared with Pmod connector
86
N/A	AETXEN/SDA1/INT4/RA15			RA15	I2C Bus #1, not shared with Pmod connector
87
N/A	PGED1/AN0/CN2/RB0			RB00	Used by debug circuit, PGC
88
N/A	PGEC1/AN1/CN3/RB1			RB01	Used by debug circuit, PGD
89
N/A	AN5/C1IN+/VBUSON/CN7/RB5		RB05	USB VBUSON
90
N/A	AN11/ERXERR/AETXERR/PMA12/RB11		RB11	Ethernet PHY
91
N/A	AN12/ERXD0/AECRS/PMA11/RB12		RB12	Ethernet PHY
92
N/A	AN13/ERXD1/AECOL/PMA10/RB13		RB13	Ethernet PHY
93
N/A	OSC1/CLKI/RC12				RC12	Primary Oscillator Crystal
94
N/A	SOSCI/CN1/RC13				RC13	Secondary Oscillator Crystal
95
N/A	SOSCO/T1CK/CN0/RC14			RC14	Secondary Oscillator Crystal
96
N/A	OSC2/CLKO/RC15				RC15	Primary Oscillator Crystal
97
N/A	ETXEN/PMD14/CN15/RD6			RD06	Ethernet PHY
98
N/A	RTCC/EMDIO/AEMDIO/IC1/RD8		RD08	Ethernet PHY
99
N/A	EMDC/AEMDC/IC4/PMCS1/PMA14/RD11		RD11	Ethernet PHY
100
N/A	ETXD3/PMD13/CN19/RD13			RD13	BTN3
101
N/A	AERXD0/INT1/RE8				RE08	USB Overcurrent detect
102
N/A	AERXD1/INT2/RE9				RE09	Ethernet PHY Reset
103
N/A	C1RX/ETXD1/PMD11/RF0			RF00	Ethernet PHY
104
N/A	C1TX/ETXD0/PMD10/RF1			RF01	Ethernet PHY
105
N/A	USBID/RF3				RF03	USBID (USB-4)
106
N/A	D+/RG2					RG02	D+ (USB-3)
107
N/A	D-/RG3					RG03	D- (USB-2)
108
N/A	ECOL/SCK2A/U2BTX/U2ARTS/PMA5/CN8/RG6	RG06	BTN1
109
N/A	ECRS/SDA2A/SDI2A/U2ARX/PMA4/CN9/RG7	RG07	BTN2
110
N/A	?/SCL2A/SDO2A/U2ATX/PMA3/CN10/RG8	RG08	Ethernet PHY
111
N/A	?/SS2A/U2BRX/U2ACTS/PMA2/CN11/RG9	RG09	Ethernet PHY
112
N/A	TRD1/RG12				RG12	LED1
113
N/A	TRD0/RG13				RG13	LED2
114
N/A	TRD2/RG14				RG14	LED3
115
N/A	AERXERR/RG15				RG15	LED4
116
 */
117
// </editor-fold>
118
 
119
// <editor-fold defaultstate="collapsed" desc="Connectors">
120
/*
121
J7 - I2C port #2 daisy chain connector
122
 * This connector provides access to the I2C signals, power and ground for I2C port #2.
123
J8 - I2C port #1 daisy chain connector
124
 * This connector provides access to the I2C signals, power and ground for I2C port #1.
125
J9 - CAN #1 Connector
126
 * This connector is used to access the signals for CAN #1.
127
J10 - CAN #2 Connector
128
 * This connector is used to access the signals for CAN #2.
129
J11 - Ethernet Connector
130
 * This connector provides access to the 10/100 Ethernet port.
131
J12-J14
132
 * Do Not Use.
133
J15 - Debug USB Connector
134
 * This connector is used to connect the on-board programming and
135
    debug circuit to the PC for use with the MPLAB IDE.
136
J16 - Power supply source select
137
 * This jumper is used to select the source of main board power.
138
	Place a shorting block in the upper, ?USB? position to have the
139
            board powered from the USB device connector, J19.
140
	Place a shorting block in the center, ?EXT? position to have the
141
            board powered from one of the external power connectors, J17 or J18.
142
	Place a shorting block in the lower, ?DBG? position to have the
143
            board powered from the debug USB connector, J15.
144
J17 - External Power Connector
145
 * This is a 2.5mm x 5.5mm, center positive, coax power connector used to 
146
    provide external power to the board. The optional Digilent 5V Switching
147
    Power Supply is connected here.
148
J18 - External Power Connector
149
 * This is a screw terminal connector used to provide external power to
150
    the board. Be sure to observe proper polarity (marked near the connector)
151
    when providing power via this connector, or damage to the board and/or
152
    connected devices may result.
153
J19 - USB Device / OTG Connector
154
 * This is a USB micro-AB connector. It is used when using the PIC32MX795
155
    microcontroller to implement a USB device or OTG Host/Device.
156
J20 - USB Host Connector
157
 * This is a standard sized USB type A connector. This connector is used to 
158
    connect USB devices to the board when using the PIC32MX795 microcontroller
159
    to implement an embedded USB host.
160
 */
161
// </editor-fold>
162
 
163
// <editor-fold defaultstate="collapsed" desc="Jumpers">
164
/*
165
J20 - USB Host Connector
166
 * This is a standard sized USB type A connector. This connector is used to 
167
    connect USB devices to the board when using the PIC32MX795 microcontroller
168
    to implement an embedded USB host.
169
JP1 & JP2 - CAN or Pmod Select
170
 * These jumpers select microcontroller signals RF12 and RF13 for use with CAN 
171
    #1 or Pmod connector JF. Place these jumpers in the CAN position to use CAN
172
    #1. Place the jumpers in the PMOD position to use then with Pmod connector JF.
173
JP3 & JP4 - Pull-up enable for I2C port #2
174
 * These two jumpers are used to enable/disable the pull-up resistors on I2C
175
    port #2. Insert shorting blocks on these two jumpers to enable the pull-up
176
    resistors. Remove the shorting blocks to disable the pull-up resistors. Only
177
    a single device on the I2C bus should have the pull-up resistors enabled.
178
JP5 - CAN #1 Termination
179
 * This jumper is used to enable/disable the 120 ohm termination resistor for 
180
    CAN #1. Insert the shorting block to enable the termination resistor, remove
181
    it to disable the termination resistor.
182
JP6 - CAN #1 5V0 Enable
183
 * This jumper is used to enable/disable providing 5V to the CAN #1 connector. 
184
    Insert the shorting block to connect the board 5V0 supply to pins 9 & 10 of
185
    CAN #1 connector. Remove the shorting block to disconnect the 5V0 supply.
186
JP7 - CAN #2 Termination
187
 * This jumper is used to enable/disable the 120 ohm termination resistor for 
188
    CAN #2. Insert the shorting block to enable the termination resistor, remove
189
    it to disable the termination resistor.
190
JP8 - CAN #1 5V0 Enable
191
 * This jumper is used to enable/disable providing 5V to the CAN #1 connector. 
192
    Insert the shorting block to connect the board 5V0 supply to pins 9 & 10 of
193
    CAN #1 connector. Remove the shorting block to disconnect the 5V0 supply.
194
JP9 - Do Not Use
195
JP10 - USB host power select
196
 * This jumper is used to select which host connector is powered when host power
197
    is enabled. Place the shorting block in the ?MICRO? position to supply power
198
    to the USB micro-AB OTG Connector, J19. Place the shorting block in the ?A?
199
    position to supply power to the USB type A Host Connector, J20.
200
JP17 - Do Not Use
201
 */
202
// </editor-fold>