New Page 1

Introduction

The LPC2106 are based on a 16/32 bit ARM7TDMI-S CPU with real-time emulation and embedded trace support, together with 128 kbytes (kB) of embedded high speed flash memory. A 128 bit wide memory interface and a unique accelerator architecture enable 32 bit code execution at maximum clock rate. For critical code size applications, the alternative 16-bit Thumb Mode reduces code by more than 30% with minimal performance penalty. Due to their tiny size and low power consumption, these microcontrollers are ideal for applications where miniaturization is a key requirement, such as access control and point-of-sale. With a wide range of serial communications interfaces and on-chip SRAM options up to 64 kilobytes, they are very well suited for communication gateways and protocol converters, soft modems, voice recognition and low end imaging, providing both large buffer size and high processing power. Various 32 bit timers, PWM channels and 32 GPIO lines make these microcontrollers particularly suitable for industrial control and medical systems.

The LPC-2106MT Development board is designed to evaluate LPC2106 processor. It has the following features:
- JTAG connector as per ARM's 2x10 pin layout, ARM-JTAG (Wiggler) compatible
- 14.7456 MHz crystal allow easy communication setup (4x PLL = 58,9824 Mhz CPU clock), the crystal is on socket and may be easy changed to any value
- RS232 interface circuit with SUB-D 9 pin connector
- LCD16x2 display
- five buttons
- Dallas iButton port
- Frequency input
- Relay with 10A/250VAC contacts
- Buzzer
- Status LED
- RESET circuit
- RESET button
- Bootloader enable jumper and pullup
- DEBUG jumper for JTAG enable/disable
- RTCK pullup resistors
- Power plug-in jack
- power supply: 6VAC/+9VDC
- three on board voltage regulators 1.8V, 3.3V and 5V
- power supply filtering capacitor
- Four mounting holes
- PCB: FR-4, 1.5 mm (0,062"), green soldermask, white silkscreen component print
- Dimensions: 120x38 mm (4.75x1.5")

The purpose of this guide is to describe LPC-2106MT Development board.

Board | LPC-2106MT
Hardware details | Describes the hardware peripherials in detail
Programming | describes how to write programs for the 2106MT Board.
Revision | 01.01.2005 Creating

Copyright (c) OLIMEX Ltd. All rights reserved


Picture

This is picture of LPC-2106MT Development board.

Board LPC-2106MT

Copyright (c) OLIMEX Ltd. All rights reserved


LPC 2106MT


2106MT Board


LPC P2106 Hardware description

Peripherials

Unit | Description
LCD Dysplay | 2X16 LCD Display
RS232 Connector | RS232 DB9 Female connector
JTAG Connector | 2x10 pins, 0,1" step connector for JTAG programming.
TTL RS232 Connector | 4 pins, 0,1" step connector whit TTL level
Extension ports | 2x7 pins, 0,1" extension ports EXT1 and EXT2
Dallas Connector | Interface to Dallas device connected to P0.11/ CTS / CAP1.1 (PIN 36).
Frequency Connector | External frequency connector which is connected to P0.10 / RTS1 / CAP1.0 (PIN 35)
Relay | Relay is connected to P0.13 / DTR1 / MAT1.1 (PIN 41)
Buzzer | Buzzer audio output connected to P0.8 / TXD1 / PWM4 (PIN 29) via jumper, which is describe bellow
Buttons | Button 1 connected to P0.27 / TRACEPKT0 / TRST (PIN 8), Button 2 connected to P0.28 / TRACEPKT1 / TMS (PIN 9), Button 3 connected to P0.29 / TRACEPKT2 / TCK (PIN 10), Button 4 connected to P0.30 / TRACEPKT3 / TDI (PIN 15), Button 5 connected to P0.31 / EXTIN0 / TDO (PIN 16)
Led | Red status led connected to P0.12 / DSR1 / MAT1.0 (PIN 37)

Technical characteristics

Parameter | Description
Voltage Supply | 9.0V AC or 12.0V DC
CPU | LPC2106
Crystals | Q1 - 14,745 MHz HF crystal
Board dimensions | 120x38 mm (4.75x1.5")
PCB | FR-4, 1.5 mm (0,062"), green soldermask, white silkscreen component print
Operating Temperature | form 0ºC to 70ºC

JTAG Connector

Pin / Name | Connected to: | Functionality
1 - VCC | VCC | -
2 - VCC | VCC | -
3 - TRST | PIN 47 | P0.17 / CAP1.2 / TRST
4 - GND | GROUND | -
5 - TDI | PIN 2 | P0.20 / MAT1.3 / TDI
6 - GND | GROUND | -
7 - TMS | PIN 48 | P0.18 / CAP1.3 / TMS
8 - GND | GROUND | -
9 - TCK | PIN 1 | P0.19 / MAT12 / TCK
10 - GND | GROUND | -
11 - RTCK | PIN 26 | RTCK
12 - GND | GROUND | -
13 - TDO | PIN 3 | P0.21 / PWM5 / TDO
14 - GND | GROUND | -
15 - RST | PIN 6 | RST
16 - GND | GROUND | -
17 - - | no connected | -
18 - GND | GROUND | -
19 - - | no connected | -
20 - GND | GROUND | -

RS232 Connector 1

Pin / Name | Connected to: | Functionality
1 - CD | not connected | -
2 - RXD | PIN 13 | P0.0 / TXD0 / PWM1
3 - TXD | PIN 14 | P0.1 / RXD0 / PWM3
4 - DTR | MCP130T | -
5 - GND | GROUND | -
6 - DSR | not connected | -
7 - RTS | not connected | -
8 - CTS | not connected | -
9 - RI | not connected | -

Max communication baud rate supported by LPC2106 is 448 kbps, maximum baud rate with MAX3232 driver on board is 250 kbps.

Extension port

Pin / Name | Connected to: | Functionality
1 - VCC | +5V | -
2 - GND | GROUND | -
3 - RST | PIN 6 | RST
4 - BSL | PIN 44 | P0.14 / DCD1 / EINT1
5 - P0.26 | PIN 39 | P0.26 / TRACESYNC
6 - P0.25 | PIN 38 | P0.25 / PIPESTAT2
7 - P0.16 | PIN 46 | P0.16 / EINT0 / MAT2.0
8 - P0.15 | PIN 45 | P0.15 / RI1 / EINT2
9 - RXD1 | PIN 30 | P0.9 / RXD1 / PWM6
10 - TXD1 | PIN 29 | P0.8 / TXD1 / PWM4
11 - SDA | PIN 21 | P0.3 / SDA / MAT0.0
12 - SCL | PIN 18 | P0.2 / SCL / CAP0.0
13 - +5V | +5V | -
14 - GND | GROUND | -

Notice!!! PIN10 is connected via jumper, which position is describe bellow

Jumpers

Jumpers | Position | Description
Jumper 1 (JRST) Jumper 2 (BSL) |  | Disable ICSP programming.
 |  | Enable ICSP programming - via COM Port
Jumper 3 (TX_J) |  | P0.8 / TXD1 / PWM4 (PIN 29) is connected to EXT connector and can be used as general purpose GPIO.
 |  | P0.8 / TXD1 / PWM4 (PIN 29) is connected to buzzer.
Jumper 4 (DBG) |  | Disable JTAG programming.
 |  | Enable JTAG programming.


Programming: RS232

RS232 Connector

Pin / Name | Description
1 - CD | Carrier Detected.
2 - RXD | Received Data.
3 - TXD | Transmited Data.
4 - DTR | Data Terminal Ready.
5 - GND | Signal Ground.
6 - DSR | Data Set Ready.
7 - RTS | Request to Send.
8 - CTS | Clear to Send..
9 - RI | Ring Indicator.

Register description

Register | Address | Function
U0RBR | 0xE000C000 DLAB = 0 | Receiver Buffer Register. Input data buffer.
U0THR | 0xE000C000 DLAB = 0 | Transmit Holding Register. Output data buffer.
U0DLL | 0xE000C000 DLAB = 1 | Divisor Latch LSB.
U0DLM | 0xE000C000 DLAB = 1 | Divisor Latch MSB.
U0IER | 0xE000C004 DLAB = 0 | Interrupt Enable Register.
U0IIR | 0xE000C008 | Interrupt ID Register.
U0FCR | 0xE000C008 | FIFO Control Register.
U0LCR | 0xE000C00C | Line Control Register.
U0LSR | 0xE000C014 | Line Status Register.
U0SCR | 0xE000C01C | Scratch Pad Register.
U0TER | 0xE000C030 | Transmit Enable.

1.Initialization

1.1. Set Line Control Register
U0LCR | Function | Description | Reset Value
1:0 | Word Length Select | 00: 5 bit character length 01: 6 bit character length 10: 7 bit character length 11: 8 bit character length | 0
2 | Stop Bit Select | 0: 1 stop bit 1: 2 stop bits (1.5 if U0LCR[1:0]=00) | 0
3 | Parity Enable | 0: Disable parity generation and checking 1: Enable parity generation and checking | 0
5:4 | Parity Select | 00: Odd parity 01: Even parity 10: Forced “1” stick parity 11: Forced “0” stick parity | 0
6 | Break Control | 0: Disable break transmission 1: Enable break transmission. Output pin UART0 TxD is forced to logic 0 when U0LCR6 is active high. | 0
7 | Divisor Latch Access Bit | 0: Disable access to Divisor Latches 1: Enable access to Divisor Latches | 0

1.2. UART0 Baudrate Calculation

The U0DLL and U0DLM registers together form a 16 bit divisor where U0DLL contains the lower 8 bits of the divisor and U0DLM contains the higher 8 bits of the divisor.

  devisor = pclk / (16 * baud);

1.3. Set Functionality to pins

Set functionality to P0.0 -> TX0 and P0.1 -> RXD0

2. RS232 Communication

2.1. Write to RS232

Use follow algorithm to send data:
- fill U0THR register with data to write
- wait shift all data
- clear interrupt flag

2.2. Read from RS232

Use follow algorithm to receive data:
- wait read all data
- clear interrupt flag
- get data from U0RBR

3. Example

Initialize:
//set Line Control Register (8
    bit, 1 stop bit, no parity, enable DLAB)
U0LCR_bit.WLS  = 0x3;     //8 bit
U0LCR_bit.SBS  = 0x0;     //1 stop bit
U0LCR_bit.PE   = 0x0;     //no parity
U0LCR_bit.DLAB = 0x1;     //enable DLAB

   //devisor
U0DLL = Pclk / (16 * baud);      //low
    bite
U0DLM = Pclk / (16 * baud)>>8;   //high bite
U0LCR &= ~0x80;

//set functionality to pins: port0.0 -> TX0, port0.1 -> RXD0
PINSEL0_bit.P0_0 = 0x1;
PINSEL0_bit.P0_1 = 0x1;

Read Data:
 //when U0LSR_bit.DR is 1 - U0RBR contains valid data
   while (U0LSR_bit.DR == 0);
   return U0RBR;

Write Data:
 //when U0LSR_bit.THRE is 1 - U0THR contains valid data.
   while (U0LSR_bit.THRE == 0);
   U0THR = ch0;


Programming: Real Time Clock

Register description

Register | Address | Function
ILR | 0xE0024000 | Interrupt Location. Reading this location indicates the source of an interrupt. Writing a one to the appropriate bit at this location clears the associated interrupt.
CTC | 0xE0024004 | Clock Tick Counter. Value from the clock divider.
CCR | 0xE0024008 | Clock Control Register. Controls the function of the clock divider.
CIIR | 0xE002400C | Counter Increment Interrupt. Selects which counters will generate an interrupt when they are incremented.
AMR | 0xE0024010 | Alarm Mask Register. Controls which of the alarm registers are masked. RW
CTIME0 | 0xE0024014 | Consolidated Time Register 0
CTIME1 | 0xE0024018 | Consolidated Time Register 1
CTIME2 | 0xE002401C | Consolidated Time Register 2

1.Initialization

1.1. Turn on the 32KHz external clock

CLKSRC (bit 4 from CCR Register)
0 - Disable 32kHz external clock
1 - Enable 32kHz external clock

1.2. Enable Interrupt
CIIR | Function | Description
0 | IMSEC | When one, an increment of the Second value generates an interrupt.
1 | IMMIN | When one, an increment of the Minute value generates an interrupt.
2 | IMHOUR | When one, an increment of the Hour value generates an interrupt.
3 | IMDOM | When one, an increment of the Day of Month value generates an interrupt.
4 | IMDOW | When one, an increment of the Day of Week value generates an interrupt.
5 | IMDOY | When one, an increment of the Day of Year value generates an interrupt.
6 | IMMON | When one, an increment of the Month value generates an interrupt.
7 | IMYEAR | When one, an increment of the Year value generates an interrupt.
1.3. Start the Real Time Clock

CLKEN (bit 0 from CCR Register) Enable/Disable Real Time Clock
0 - Disable Real Time Clock
1 - Enable Real Time Clock

2. Example

Initialize:
    CCR_bit.CLKEN  = 0;     //rtc disable
   CCR_bit.CLKSRC = 1;     //set external 32kHz oscillator
   CCR_bit.CTCRST = 0;     //disable reset
   CCR_bit.CTTEST = 0;     //disable test
   AMR            = 0;     //initialize interrupt mask register of RTC
   CIIR_bit.IMSEC = 1;     //enable interrupt every seconds
   ILR            = 3;     //clear all interrupt of RTC
   CCR_bit.CLKEN  = 1;     //rtc enable

Copyright (c) OLIMEX Ltd. All rights reserved


Programming: Blinking LED

GPIO Register map

Generic name | Description
IOPIN | GPIO Port Pin value register. The current state of the GPIO configured port pins can always be read from this register, regardless of pin direction and mode. Activity on non-GPIO configured pins will not be reflected in this register.
IOSET | GPIO Port Output set register. This register controls the state of output pins in conjunction with the IOCLR register. Writing ones produces highs at the corresponding port pins. Writing zeroes has no effect.
IODIR | GPIO Port Direction control register. This register individually controls the direction of each port pin.
IOCLR | GPIO Port Output clear register. This register controls the state of output pins. Writing ones produces lows at the corresponding port pins and clears the corresponding bits in the IOSET register. Writing zeroes has no effect.

Pin Connect Block Register Map

Register name | Description
PINSEL0 | PINSEL0 Pin function select register 0 (from P0.0 to P0.15)
PINSEL1 | PINSEL1 Pin function select register 1 (from P0.16 to P0.31)
PINSEL2 | PINSEL2 Pin function select register 2

1. Initialization (general case)

1.1. Set first functionality to port

PINSEL0 = 0x00;  //set first functionality to port (from P0.0 to P0.15)

1.2. Set port which is connected to LED as output
IO0DIR = 0xFF; //set P0.0 to P0.15 port as output

2. Led blink (general case)

 IO0CLR = 0xFF;   // set P0.0 - P0.15 to low
 IO0SET = 0xFF;   // set P0.0 - P0.15 to high

3. Example - blink led, which is connected to P0.12

    //Initialization
PINSEL0_bit.P0_12 = 0x0;
    // set first functionality to port
IO0DIR_bit.P0_12  = 0x1;
    // set P0.12 port to output
IO0SET_bit.P0_12  = 0x1;  // set P0.12 port to high

//loop forever
while(1)
{
Delay(1000);
    // Simple delay
IO0SET_bit.P0_12 = 0x1;  // set P0.12 port to high
Delay(1000);
    // Simple delay
IO0CLR_bit.P0_12 = 0x1;  // set P0.12 port to high
}


Links

1. Philips web site

LPC2106 product datasheets, application notes, etc info:
http://www.semiconductors.philips.com/

2. LPC microcontrollers discussion forum

http://groups.yahoo.com/group/lpc2000/ - forum for discussions on LPC2000 ARM microcontrollers

http://groups.yahoo.com/group/arm-olimex/ - forum for discussions on Olimex ARM boards

3. IAR Systems EW-ARM C compiler and debugger

http://www.iar.com/Products/?name=EWARM

4. Rowley associates CrossWorks for ARM C compiler and debugger

http://www.rowley.co.uk