LPC 2378 OLIMEX Board Notes
Buttons
Button 1 (BUT1) - P0.30/U1D- (pin 43) NOTE: P0.30 is tied to P0.29 in odd ways, read user manual ch10 5.1!!!
Button 2 (BUT2) - P0.6/I2SRX_SDA/SSEL1/MAT2.0 (pin 113) pinned out on ext2-3
LEDs
STAT (STAT) - P1.19/CAP1.1 (pin 47) (wtf? seriously, what's this for???) whatever it is, it's active low, and not pinned out anywhere just yet.
The 2 green LEDs that have been added to the proto section of the board run at around 1.7 mA when powered straight from 3.3 V, and emit a dim luminosity. I'm assuming these are under voltage/under current and fine to run directly without a limiting resistor.
GPIO setup
- NOTE: WHY DOES GPIO 2 BOUNCE???
SCS bit 0 (0xE01F C1A0) controls the GPIO "mode"
from the docs: 0 GPIO ports 0 and 1 are accessed via APB addresses in a fashion compatible with previous LPC2000 devices. 1 High speed GPIO is enabled on ports 0 and 1, accessed via addresses in the on-chip memory range. This mode includes the port masking feature described in the GPIO chapter.
Steps to set up the GPIO:
- ensure correct SCS if using GPIO 0 or 1
- consider masks (should this get masked before direction comes up???)
- set or clear the direction register FIOxDIR (1 should be output)
LPC2364/65/66/67/68
100 pin
Port 0: Port 0 is a 32-bit I/O port with individual direction controls for each bit. The operation of port 0 pins depends upon the pin function selected via the pin connect block. Pins 12, 13, 14, and 31 of this port are not available.
Port 1: Port 1 is a 32-bit I/O port with individual direction controls for each bit. The operation of port 1 pins depends upon the pin function selected via the pin connect block. Pins 2, 3, 5, 6, 7, 11, 12, and 13 of this port are not available.
Port 2: Port 2 is a 32-bit I/O port with individual direction controls for each bit. The operation of port 2 pins depends upon the pin function selected via the pin connect block. Pins 14 through 31 of this port are not available.
Port 3: Port 3 is a 32-bit I/O port with individual direction controls for each bit. The operation of port 3 pins depends upon the pin function selected via the pin connect block. Pins 0 through 24, and 27 through 31 of this port are not available.
Port 4: Port 4 is a 32-bit I/O port with individual direction controls for each bit. The operation of port 4 pins depends upon the pin function selected via the pin connect block. Pins 0 through 27, 30, and 31 of this port are not available.
LPC2377/78
144 pin
Port 0: Port 0 is a 32-bit I/O port with individual direction controls for each bit. The operation of port 0 pins depends upon the pin function selected via the pin connect block.
Port 1: Port 1 is a 32-bit I/O port with individual direction controls for each bit. The operation of port 1 pins depends upon the pin function selected via the pin connect block. Pins 2, 3, 5, 6, 7, 11, 12, and 13 of this port are not available.
Port 2: Port 2 is a 32 bit I/O port with individual direction controls for each bit. The operation of port 2 pins depends upon the pin function selected via the pin connect block. Pins 14 through 31 of this port are not available.
Port 3: Port 3 is a 32 bit I/O port with individual direction controls for each bit. The operation of port 3 pins depends upon the pin function selected via the pin connect block. Pins 8 through 22, and 27 through 31 of this port are not available.
Port 4: Port 4 is a 32 bit I/O port with individual direction controls for each bit. The operation of port 4 pins depends upon the pin function selected via the pin connect block. Pins 16 through 23, 26, and 27 of this port are not available.
LPC2387
100 pin
Port 0: Port 0 is a 32-bit I/O port with individual direction controls for each bit. The operation of port 0 pins depends upon the pin function selected via the Pin Connect block. Pins 12, 13, 14, and 31 of this port are not available.
Port 1: Port 1 is a 32-bit I/O port with individual direction controls for each bit. The operation of port 1 pins depends upon the pin function selected via the Pin Connect block. Pins 2, 3, 5, 6, 7, 11, 12, and 13 of this port are not available.
Port 2: Port 2 is a 32-bit I/O port with individual direction controls for each bit. The operation of port 2 pins depends upon the pin function selected via the Pin Connect block. Pins 14 through 31 of this port are not available.
Port 3: Port 3 is a 32-bit I/O port with individual direction controls for each bit. The operation of port 3 pins depends upon the pin function selected via the Pin Connect block. Pins 0 through 24, and 27 through 31 of this port are not available.
Port 4: Port 4 is a 32-bit I/O port with individual direction controls for each bit. The operation of port 4 pins depends upon the pin function selected via the Pin Connect block. Pins 0 through 27, 30, and 31 of this port are not available.
LPC2388
144 pin
Port 0: Port 0 is a 32-bit I/O port with individual direction controls for each bit. The operation of port 0 pins depends upon the pin function selected via the Pin Connect block.
Port 1: Port 1 is a 32-bit I/O port with individual direction controls for each bit. The operation of port 1 pins depends upon the pin function selected via the Pin Connect block. Pins 2, 3, 5, 6, 7, 11, 12, and 13 of this port are not available.
Port 2: Port 2 is a 32 bit I/O port with individual direction controls for each bit. The operation of port 2 pins depends upon the pin function selected via the Pin Connect block. Pins 14 through 31 of this port are not available.
Port 3: Port 3 is a 32 bit I/O port with individual direction controls for each bit. The operation of port 3 pins depends upon the pin function selected via the Pin Connect block. Pins 8 through 22, and 27 through 31 of this port are not available.
Port 4: Port 4 is a 32 bit I/O port with individual direction controls for each bit. The operation of port 4 pins depends upon the pin function selected via the Pin Connect block. Pins 16 through 23, 26, and 27 of this port are not available.
100 pin packages
To enable GPIO
PORT.PIN PINSELx BITS SETTING
---- --- ------- ---- -------
PORT 0.0 PINSEL0 1:0 00
PORT 0.1 PINSEL0 3:2 00
PORT 0.2 PINSEL0 5:4 00
PORT 0.3 PINSEL0 7:6 00
PORT 0.4 PINSEL0 9:8 00
PORT 0.5 PINSEL0 11:10 00
PORT 0.6 PINSEL0 13:12 00
PORT 0.7 PINSEL0 15:14 00
PORT 0.8 PINSEL0 17:16 00
PORT 0.9 PINSEL0 19:18 00
PORT 0.10 PINSEL0 21:20 00
PORT 0.11 PINSEL0 23:22 00
PORT 0.15 PINSEL0 31:30 00
PORT.PIN PINSELx BITS SETTING
---- --- ------- ---- -------
PORT 0.16 PINSEL1 1:0 00
PORT 0.17 PINSEL1 3:2 00
PORT 0.18 PINSEL1 5:4 00
PORT 0.19 PINSEL1 7:6 00
PORT 0.20 PINSEL1 9:8 00
PORT 0.21 PINSEL1 11:10 00
PORT 0.22 PINSEL1 13:12 00
PORT 0.23 PINSEL1 15:14 00
PORT 0.24 PINSEL1 17:16 00
PORT 0.25 PINSEL1 19:18 00
PORT 0.26 PINSEL1 21:20 00
PORT 0.27 PINSEL1 23:22 00
PORT 0.28 PINSEL1 25:24 00
PORT 0.29 PINSEL1 27:26 00
PORT 0.30 PINSEL1 29:28 00
PORT.PIN PINSELx BITS SETTING
---- --- ------- ---- -------
PORT 1.0 PINSEL2 1:0 00
PORT 1.1 PINSEL2 3:2 00
PORT 1.4 PINSEL2 9:8 00
PORT 1.8 PINSEL2 17:16 00
PORT 1.9 PINSEL2 19:18 00
PORT 1.10 PINSEL2 21:20 00
PORT 1.14 PINSEL2 29:28 00
PORT 1.15 PINSEL2 31:30 00
PORT.PIN PINSELx BITS SETTING
---- --- ------- ---- -------
PORT 1.16 PINSEL3 1:0 00
PORT 1.17 PINSEL3 3:2 00
PORT 1.18 PINSEL3 5:4 00
PORT 1.19 PINSEL3 7:6 00
PORT 1.20 PINSEL3 9:8 00
PORT 1.21 PINSEL3 11:10 00
PORT 1.22 PINSEL3 13:12 00
PORT 1.23 PINSEL3 15:14 00
PORT 1.24 PINSEL3 17:16 00
PORT 1.25 PINSEL3 19:18 00
PORT 1.26 PINSEL3 21:20 00
PORT 1.27 PINSEL3 23:22 00
PORT 1.28 PINSEL3 25:24 00
PORT 1.29 PINSEL3 27:26 00
PORT 1.30 PINSEL3 29:28 00
PORT 1.31 PINSEL3 31:30 00
PORT.PIN PINSELx BITS SETTING
---- --- ------- ---- -------
PORT 2.0 PINSEL4 1:0 00
PORT 2.1 PINSEL4 3:2 00
PORT 2.2 PINSEL4 5:4 00
PORT 2.3 PINSEL4 7:6 00
PORT 2.4 PINSEL4 9:8 00
PORT 2.5 PINSEL4 11:10 00
PORT 2.6 PINSEL4 13:12 00
PORT 2.7 PINSEL4 15:14 00
PORT 2.8 PINSEL4 17:16 00
PORT 2.9 PINSEL4 19:18 00
PORT 2.10 PINSEL4 21:20 00
PORT 2.11 PINSEL4 23:22 00
PORT 2.12 PINSEL4 25:24 00
PORT 2.13 PINSEL4 27:26 00
PORT.PIN PINSELx BITS SETTING
---- --- ------- ---- -------
PORT 3.25 PINSEL7 19:18 00
PORT 3.26 PINSEL7 21:20 00
PORT.PIN PINSELx BITS SETTING
---- --- ------- ---- -------
PORT 4.28 PINSEL9 25:24 00
PORT 4.29 PINSEL9 27:26 00
144 pin packages
To enable GPIO
ADC Setup
To set up the ADC
- On reset, the ADC is disabled.
- To enable the ADC, first set the PCADC bit (bit 12 in PCONP - address 0xE01F C0C4) and then enable the ADC (bit PDN in AD0CR - address 0xE003 4000)
- To disable the ADC, first clear the PDN bit, and then clear the PCADC bit.
ADC pins
- AD0.0 P0.23, PINSEL1 15:14 set to 01
- AD0.1 P0.24, PINSEL1 17:16 set to 01
- AD0.2 P0.25, PINSEL1 19:18 set to 01
- AD0.3 P0.26, PINSEL1 21:20 set to 01
- AD0.4 P1.30, PINSEL3 29:28 set to 11
- AD0.5 P1.31, PINSEL3 31:30 set to 11
- AD0.6 P0.12, PINSEL0 25:24 set to 11 (not available in 2368!)
- AD0.7 P0.13, PINSEL0 27:26 set to 11 (not available in 2368!)
I2C setup
Asumptions
- Will treat transmits and receives as sort of "atomic" A send will complete before a receive may begin and vice versa.
- The data counter may be a separate global for each I2C interface.