0% found this document useful (0 votes)
15 views102 pages

VSK-2148 (Revised)

The ARM7 LPC2148 Starter Kit features a 32/16 Bit ARM7TDMI-S CPU with 512KB flash memory, suitable for both beginners and experienced engineers. It includes the IAR Embedded Workbench IDE for efficient development, along with a powerful C/C++ compiler and assembler. The LPC2148 microcontroller is ideal for low-power applications, offering various communication interfaces and extensive peripheral support.

Uploaded by

Maathu
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
15 views102 pages

VSK-2148 (Revised)

The ARM7 LPC2148 Starter Kit features a 32/16 Bit ARM7TDMI-S CPU with 512KB flash memory, suitable for both beginners and experienced engineers. It includes the IAR Embedded Workbench IDE for efficient development, along with a powerful C/C++ compiler and assembler. The LPC2148 microcontroller is ideal for low-power applications, offering various communication interfaces and extensive peripheral support.

Uploaded by

Maathu
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 102

ARM7 LPC2148 STARTER KIT VSK-2148

ARM7 LPC2148 STARTER KIT

The ARM7 LPC2148 starter kit is based on a 32/16 Bit ARM7TDMI-s CPU with real time
Emulation and Embedded Trace support, That combines with the microcontroller with embedded
high speed 512KB flash memory. It can work with 16-bit Thumb Mode.

With Useful Implemented peripherals, plentiful practical code examples and a broad set of
additional on board. VSK-2148 board make fast and reliable tools that can satisfy the needs of
experienced engineers and beginners alike.

VSK-2148 Boards achieve their small size through Modern SMD technology and Multilayer
Design. All Controller signals and ports extend from the controller to high density pitch
Connectors of the board.

VSK-2148 Hardware Manual Describes the board’s design and functions. Precise Specifications for
the NXP LPC2148 Microcontroller can be found in the enclosed Microcontroller Data
sheet/User’s Manual. In this hardware manual, schematic diagrams and Block Diagrams are
attached.

Vi Microsystems Pvt. Ltd., [1]


ARM7 LPC2148 STARTER KIT VSK-2148

IAR EMBEDDED WORKBENCH

The IAR Embedded Workbench® IDE is a very powerful Integrated Development Environment,
that allows you to develop and manage complete embedded application projects. It is a
development platform, with all the features you would expect to find in your everyday working
place.

The IDE is the framework where all necessary tools are seamlessly integrated:

* The highly optimizing IAR C/C++ Compiler

* The IAR Assembler

* The versatile IAR ILINK Linker, including accompanying tools

* A powerful editor

* A project manager

* A command line build utility

* IAR C-SPY® Debugger, a state-of-the-art high-level language debugger.

IAR Embedded Workbench is available for many microprocessors and microcontrollers in the 8-,
16-, and 32-bit segments, allowing you to stay within a well-known development environment
also for your next project. It provides an easy-to-learn and highly efficient development
environment with maximum code inheritance capabilities, comprehensive and specific target
support. IAR Embedded Workbench promotes a useful working methodology, and you can
reduce your development time significantly by using the IAR Systems tools. We call this concept
“Different Architectures. One Solution.”

Vi Microsystems Pvt. Ltd., [2]


ARM7 LPC2148 STARTER KIT VSK-2148

IAR C/C++ Compiler

The IAR C/C++ Compiler for ARM is a state-of-the-art compiler that offers the standard features
of the C or C++ languages, plus many extensions designed to take advantage of the ARM- specific
facilities. The compiler is integrated with other IAR Systems software in the IDE.

FEATURES

The compiler provides the following features:

CODE GENERATION

* Generic and ARM-specific optimization techniques produce very efficient machine


code.

* Comprehensive output options, including reloadable object code, assembler source


code, and list files with optional assembler mnemonics.

* Support for ARM EABI ELF/DWARF object format.

* The object code can be linked together with assembler routines.

* Generation of extensive debug information.

LANGUAGE FACILITIES

* Support for the C and C++ programming languages

* Support for IAR Extended EC++ with features such as full template support, namespace
support, the cast operators static_cast, const_cast, and reinterpret_cast, as well as the
Standard Template Library (STL).

* Conformance to the ISO/ANSI C standard for a free-standing environment.

* Target-specific language extensions, such as special function types, extended keywords,


pragma directives, predefined symbols, intrinsic functions, absolute allocation, and inline
assembler

* Standard library of functions applicable to embedded systems

* IEEE-compatible floating-point arithmetic

IAR Assembler

The IAR Assembler is integrated with other IAR Systems software for the ARM core. It is a
powerful relocating macro assembler (supporting the Intel/Motorola style) with a versatile set of
directives and expression operators. The assembler features a built-in C language preprocessor and
supports conditional assembly. The assembler uses the same mnemonics and operand syntax as
the Advanced RISC Machines Ltd Assembler for ARM, which simplifies the migration of existing
code

Vi Microsystems Pvt. Ltd., [3]


ARM7 LPC2148 STARTER KIT VSK-2148

FEATURES

The IAR Assembler provides these features:

* C preprocessor
* List file with extensive cross-reference output
* Number of symbols and program size limited only by available memory
* Support for complex expressions with external references
* 255 significant characters in symbol names
* Support for ARM EABI ELF/DWARF object format.

CREATING THE NEW PROJECT IN EWARM-5.4 KICKSTART VERSION

CREATING THE NEW PROJECT

IAR Embedded Workbench Installation is completed , Shortcut ICON is placed at your desktop.
Just make an double click on that ICON. New Window is open as given below.

Vi Microsystems Pvt. Ltd., [4]


ARM7 LPC2148 STARTER KIT VSK-2148

1. To create a new project, choose Project>Create New Project. The Create New Project dialog
box appears, which lets you base your new project on a project template.

Vi Microsystems Pvt. Ltd., [5]


ARM7 LPC2148 STARTER KIT VSK-2148

2. Make sure the Tool chain is set to ARM, and click OK.

3. Select the project template Empty project, and click ok button. Which simply creates an
empty project that uses default project setting.

4. In the standard Save As dialog box that appears, specify where you want to place your
project file, that is, in your newly created projects directory. Type your project name in
the File name box, and click Save to create the new project. eg. LED.

Vi Microsystems Pvt. Ltd., [6]


ARM7 LPC2148 STARTER KIT VSK-2148

The project will appear in the Workspace window.

To Creating your Application ‘C’ file, Choose FILE menu and select NEW>File.

Vi Microsystems Pvt. Ltd., [7]


ARM7 LPC2148 STARTER KIT VSK-2148

Edit the application code in C Language . Eg. Led.c

To Save your ‘C’ file, Choose File>Save As. In the standard Save As dialog box that appears,
specify where you want to place your project file, that is, in your project directory. Type your
filename in the File name box, and click Save to create the new project. Eg. Led.c

Vi Microsystems Pvt. Ltd., [8]


ARM7 LPC2148 STARTER KIT VSK-2148

ADDING FILES TO THE PROJECT

1. In the Workspace window, select the destination to which you want to add a source file; a
group or, as in this case, directly to the project.

2. Choose Project>Add Files to open a standard browse dialog box. Locate the files led.c
select them in the file selection list, and click Open to add them to the project1 project.

Vi Microsystems Pvt. Ltd., [9]


ARM7 LPC2148 STARTER KIT VSK-2148

To save your work space, Choose File>Save Workspace and specify where you want to place your
workspace file. In this tutorial, you should place it in your newly created project directory. Type
LED in the File name box, and click Save button.

Vi Microsystems Pvt. Ltd., [ 10 ]


ARM7 LPC2148 STARTER KIT VSK-2148

SETTING PROJECT OPTIONS

Now you will set the project options. For application projects, options can be set on all levels of
nodes. First you will set the general options to suit the processor configuration in this tutorial.
Because these options must be the same for the whole build configuration, they must be set on the
project node.

1. Select the project folder icon LED - Debug in the Workspace window and choose
Project>Options. Then select Output Converter in the Category list to display the linker
option pages.

The Output options are used for specifying details about the output format and the level of
debugging information included in the output file.

Vi Microsystems Pvt. Ltd., [ 11 ]


ARM7 LPC2148 STARTER KIT VSK-2148

Select “option” on the popup menu. After selecting popup menu window shows as given below.

Select output format as “ Intel Extended”, output file in the format of .hex format.

Vi Microsystems Pvt. Ltd., [ 12 ]


ARM7 LPC2148 STARTER KIT VSK-2148

Select the linker file menu, linker configuration file available at project directory.

To Compile your Project, Choose Project>Rebuild ALL

If your project has no error Building completed and Hex file generated

Vi Microsystems Pvt. Ltd., [ 13 ]


ARM7 LPC2148 STARTER KIT VSK-2148

µC/OS-II Integration with IAR Embedded Workbench

1. To create a new project, choose Project>Create New Project. The Create New Project
dialog box appears, which lets you base your new project on a project template.

2. Make sure the Tool chain is set to ARM, and click OK.

3. Select the project template Empty project, and click ok button. Which simply creates an
empty project that uses default project settings.

Vi Microsystems Pvt. Ltd., [ 14 ]


ARM7 LPC2148 STARTER KIT VSK-2148

4. In the standard Save As dialog box that appears, specify where you want to place your
project file, that is, in your newly created projects directory. Type your project name in
the File name box, and click Save to create the new project. eg. UART.

RTOS Package comprises set of ‘C’ files and headed files. C Files are classified as Application file,
CPU files, µC/OS-II Files and BSP.

In this project, we have to split the C files according to the functions. So these files are integrate
under separate folder.

Project Group Names are

i) APP
ii) BSP
iii) UCOS-II

a) PORT
b) SOURCE

Vi Microsystems Pvt. Ltd., [ 15 ]


ARM7 LPC2148 STARTER KIT VSK-2148

ADDING Groups TO THE PROJECT

1. Creating several groups is a possibility for you to organize your source files logically
according to your project needs.

2. To create new group Choose Project>Add Group.

3. Type your group name and click ok button.

Vi Microsystems Pvt. Ltd., [ 16 ]


ARM7 LPC2148 STARTER KIT VSK-2148

ADD Files to APP group

Vi Microsystems Pvt. Ltd., [ 17 ]


ARM7 LPC2148 STARTER KIT VSK-2148

Create New group

Add files to BSP Group

Vi Microsystems Pvt. Ltd., [ 18 ]


ARM7 LPC2148 STARTER KIT VSK-2148

Create New group

Add Files to CPU Group

Vi Microsystems Pvt. Ltd., [ 19 ]


ARM7 LPC2148 STARTER KIT VSK-2148

Create New group

Under ucos-ii group, create two group named as source and ports.

Vi Microsystems Pvt. Ltd., [ 20 ]


ARM7 LPC2148 STARTER KIT VSK-2148

Add Corresponding files to above mentioned group

Vi Microsystems Pvt. Ltd., [ 21 ]


ARM7 LPC2148 STARTER KIT VSK-2148

SETTING PROJECT OPTIONS

Now you will set the project options. For application projects, options can be set on all levels of
nodes. First you will set the general options to suit the processor configuration in this tutorial.
Because these options must be the same for the whole build configuration, they must be set on the
project node.

1. Select the project folder icon UART - Debug in the Workspace window and choose
Project>Options. Then select C/C++ Compiler where you have select CODE menu ,
enable ARM Processor Mode.

Vi Microsystems Pvt. Ltd., [ 22 ]


ARM7 LPC2148 STARTER KIT VSK-2148

After that Select Preprocessor menu from same window.

At Preprocessor, we have to include all the directories as given below

$PROJ_DIR$

$PROJ_DIR$\..\uCOS-II\ports

$PROJ_DIR$\..\uCOS-II\source

$PROJ_DIR$\..\BSP

$PROJ_DIR$\..\CPU

Vi Microsystems Pvt. Ltd., [ 23 ]


ARM7 LPC2148 STARTER KIT VSK-2148

For Creating the Hex file, we choose output file format as given below.

Select Linker file as given below.

Vi Microsystems Pvt. Ltd., [ 24 ]


ARM7 LPC2148 STARTER KIT VSK-2148

To Compile this Project, Choose Project>Rebuild ALL

If there is no error, Message window shows like this. Now Hex file is created.

ISP UTILITY

NXP Semiconductors produce a range of Microcontrollers that feature both on-chip Flash
memory and the ability to be reprogrammed using In-System Programming technology. Flash
Magic is Windows software that allows easy access to all the ISP features provided by the devices.
These features include:

* Erasing the Flash memory (individual blocks or the whole device)

* Programming the Flash memory

* Modifying the Boot Vector and Status Byte

* Reading Flash memory

* Performing a blank check on a section of Flash memory

* Reading the signature bytes

* Reading and writing the security bits

* Direct load of a new baud rate (high speed communications)

* Sending commands to place device in Boot loader mode


Vi Microsystems Pvt. Ltd., [ 25 ]
ARM7 LPC2148 STARTER KIT VSK-2148

Under Windows, only one application may have access the COM Port at any one time,
preventing other applications from using the COM Port. Flash Magic only obtains access to the
selected COM Port when ISP operations are being performed. This means that other applications
that need to use the COM Port, such as debugging tools, may be used while Flash Magic is loaded.
Note that in this manual third party Compilers are listed alphabetically. No preferences are
indicated or implied.

Procedure:

1. Select the COM Port

2. Select the Baud Rate

3. Select Device ( Eg.LPC2148)

4. Interface – None ISP

5. Select Osc. Frequency – 12Mhz

6. Enable “ Erase Blocks used by Hex files”

7. Select the Hex File to be downloaded.

Vi Microsystems Pvt. Ltd., [ 26 ]


ARM7 LPC2148 STARTER KIT VSK-2148

Processing

Vi Microsystems Pvt. Ltd., [ 27 ]


ARM7 LPC2148 STARTER KIT VSK-2148

After completely downloaded, window shows like this

HARDWARE DETAILS

About VSK-2148 CPU

The LPC2148 microcontrollers are based on a 32/16 bit ARM7TDMI-S CPU with real-time
emulation and embedded trace support, that combines the microcontroller with embedded high
speed flash memory ranging from 32 kB to 512 kB. A 128-bit wide memory interface and unique
accelerator architecture enable 32-bit code execution at the 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, LPC2148 are ideal for applications where
miniaturization is a key requirement, such as access control and point-of-sale. A blend of serial
communications interfaces ranging from a USB 2.0 Full Speed device, multiple UARTS, SPI, SSP
to I2Cs and on-chip SRAM of 8 kB up to 40 kB, make these devices 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, single
or dual 10-bit ADC(s), 10-bit DAC, PWM channels and 45 fast GPIO lines with up to nine edge or
level sensitive external interrupt pins make these microcontrollers particularly suitable for
industrial control and medical systems.

Vi Microsystems Pvt. Ltd., [ 28 ]


ARM7 LPC2148 STARTER KIT VSK-2148

Features:

* 6/32-bit ARM7TDMI-S microcontroller in a tiny LQFP64 package.

* 8 to 40 kB of on-chip static RAM and 32 to 512 kB of on-chip flash program memory.

* 28 bit wide interface/accelerator enables high speed 60 MHz operation.

* In-System/In-Application Programming (ISP/IAP) via on-chip boot-loader software.

* Single flash sector or full chip erase in 400 ms & programming of 256 bytes in 1 ms.

* Embedded ICE RT and Embedded Trace interfaces offer real-time debugging with the on-chip
Real Monitor software and high speed tracing of instruction execution.

* USB 2.0 Full Speed compliant Device Controller with 2 kB of endpoint RAM. In addition, the
LPC2146/8 provide 8 kB of on-chip RAM accessible to USB by DMA.

* One or two (LPC2141/2 vs LPC2144/6/8) 10-bit A/D converters provide a total of 6/14 analog
inputs, with conversion times as low as 2.44 s per channel.

* Single 10-bit D/A converter provides variable analog output.

* Two 32-bit timers/external event counters (with four capture and four compare channels
each), PWM unit (six outputs) and watchdog.

* Low power real-time clock with independent power and dedicated 32 kHz clock input.

* Multiple serial interfaces including two UARTs (16C550), two Fast I2C-bus (400 Kbit/s), SPI
and SSP with buffering and variable data length capabilities.

* Vectored interrupt controller with configurable priorities and vector addresses.

* Up to nine edge or level sensitive external interrupt pins available.


* 60 MHz maximum CPU clock available from on-chip PLL with settling time of 100s.

* On-chip integrated oscillator operates with an external crystal range from 1 MHz to 30 MHz
and with an external oscillator up to 50 MHz.

* Power saving modes include Idle and Power-down.

* Individual enable/disable of peripheral functions as well as peripheral clock scaling for


additional power optimization.

* Processor wake-up from Power-down mode via external interrupt, USB, Brown-Out Detect
(BOD) or Real-Time Clock (RTC).

* Single power supply chip with Power-On Reset (POR) and BOD circuits:
Vi Microsystems Pvt. Ltd., [ 29 ]
ARM7 LPC2148 STARTER KIT VSK-2148

– CPU operating voltage range of 3.0 V to 3.6 V (3.3 V 10 %) with 5 V


tolerant I/O pads.

* Up to 45 of 5 V tolerant fast general purpose I/O pins in a tiny LQFP64 package.

Application

* Industrial control

* Medical systems

* Access control

* Point-of-sale

* Communication gateway

* Embedded soft modem

* General purpose applications

On Board Peripherals

1. NXP LPC2148 Microcontroller (TQFP-64 Packaging).


2. 8 Digital Outputs – LED.
3. 8 Digital Inputs – Switch.
4. 4 x 4 Matrix Keypad.
5. Character Based LCD (16 x 2).
6. RS232 Port.
7. External interrupt Source.
8. Analog input Trimmer.
9. Two SPDT Relay.
10. I2C Peripherals
a) Real Time Clock.
b) Serial EEPROM.
c) Seven Segment.
11. Buzzer.
12. Temperature Sensor.
13. Stepper Motor Interface.
14. Power supply Section.
Vi Microsystems Pvt. Ltd., [ 30 ]
ARM7 LPC2148 STARTER KIT VSK-2148

LPC2148 PINOUT DETAILS

Vi Microsystems Pvt. Ltd., [ 31 ]


ARM7 LPC2148 STARTER KIT VSK-2148

LPC2148 CIRCUIT DIAGRAM

Vi Microsystems Pvt. Ltd., [ 32 ]


ARM7 LPC2148 STARTER KIT VSK-2148

SIMPLE ASSEMBLY PROGRAMS

1. ADDITION

Addition of two 32 Bit Numbers

#include <NXP/iolpc2148.h>
NAME main
PUBLIC __iar_program_start
SECTION .intvec : CODE (2)
CODE32
__iar_program_start
B main
SECTION .text : CODE (2)
CODE32
#include "uart.asm"
main NOP
LDR R0,=0X11111111 //Move 32 bit value to R0 Register
LDR R1,=0X12345678 //Load 2nd 32 bit value to R1 Register
ADD R8,R1,R0 //Add the two value
BL UART //output value display in a serial window, serial window
language is hex.
stop B stop //Stop the program.
END

Vi Microsystems Pvt. Ltd., [ 33 ]


ARM7 LPC2148 STARTER KIT VSK-2148

2. SUBTRACTION

#include <NXP/iolpc2148.h>
NAME main
PUBLIC __iar_program_start
SECTION .intvec : CODE (2)
CODE32
__iar_program_start
B main
SECTION .text : CODE (2)
CODE32
#include "uart.asm"
main NOP
LDR R0,=0X0000FFFF //Load first 32 bit value to R0 Register
LDR R1,=0X0000EEEE //Load 2nd 32 bit value to R1 Register
SUB R8,R0,R1 //Subtract the two value
BL UART //Output value display in a serial window
stop B stop //Stop the program
END

3. MULTIPLICATION

#include <NXP/iolpc2148.h>
NAME main
PUBLIC __iar_program_start
SECTION .intvec : CODE (2)
CODE32
_iar_program_start
B main
SECTION .text : CODE (2)
CODE32
#include "uart.asm"
main NOP
LDR R0,=0X00000005 //Load the first 32 bit value to R0 Register
LDR R1,=0X00000005 //Load 2nd 32 bit value to R1 Register
MUL R8,R0,R1 //serial window language is hex.
BL UART //output value display in a serial window
stop B stop //Stop the program
END
4. DIVISION

#include <NXP/iolpc2148.h>
NAME main
PUBLIC __iar_program_start
SECTION .intvec : CODE (2)
CODE32
__iar_program_start
B main

Vi Microsystems Pvt. Ltd., [ 34 ]


ARM7 LPC2148 STARTER KIT VSK-2148

SECTION .text : CODE (2)


CODE32
#include "uart.asm"
main NOP
LDR R0,=0X00001000 //Load the first 32 bit value to R0 Register
LDR R1,=0X00000100 //Load the second 32 bit value to R1 Register
MOV R8,#0 //Clear R8 Register
loop: CMP R1,#0 //Compare R1 with 0
BEQ ERR //Branch
CMP R0,R1 //Compare R0 with R1
BLT DONE //Branch instructions if 0 go to done
ADD R8,R8,#1 //Add R8
SUB R0,R0,R1
B loop
ERR: MOV R8,#0XFFFFFFFF //Move the value to R8 Register
DONE: BL UART //Display in serial window
stop: B stop //Stop the window
END

Vi Microsystems Pvt. Ltd., [ 35 ]


ARM7 LPC2148 STARTER KIT VSK-2148

EMBEDDED ‘C’ PROGRAMS

LEDs:

LEDs are based on the semiconductor diode. When the diode is forward biased (switched on),
electrons are able to recombine with holes and energy is released in the form of light. This effect
is called electroluminescence and the color of the light is determined by the energy gap of the
semiconductor.

The features of LEDs are listed below


* Lower power consumption
* Require series resistors to limit the current
* Displaying decimal digits

LED lighting is an emerging technology with many home applications such as LED Christmas
lights, LED rope lights, LED spotlights, etc. LED bulbs last over 50,000 hours.

VSK-2148 has 8 LEDs that are connected to the Microcontroller Port Line.
Used Port Lines : LED0 – LED7 : P1.24 – P1.31

#include<nxp/iolpc2148.H>
void delay() //Delay Routine
{
for(int i=0x00;i<=0xff;i++)
for(int j=0x00;j<=0xFf;j++);
}
void main()
{

Vi Microsystems Pvt. Ltd., [ 36 ]


ARM7 LPC2148 STARTER KIT VSK-2148

PINSEL2 = 0X00000000; // P1.24 TO P1.31 as GPIO


IO1DIR = 0XFF000000; // p1.24 TO P1.31 Configured as Output port.
while(1)
{
IO1SET=0XFF000000; // P1.24 TO P1.31 goes to high state
delay(); //delay
IO1CLR=0XFF000000; // P1.24 TO P1.31 goes to low state
delay(); //delay
}
}

SWITCHES

An electrical switch is any device used to interrupt the flow of electrons in a circuit. Switches are
essentially binary devices: they are either completely on ("closed") or completely off ("open").. In
the simplest case, a switch has two pieces of metal called contacts that touch to make a circuit,
and separate to break the circuit. DIP switch is one of the mostly used type.

The VSK-2148 Development Board has one 8-Way Dip Switch. When the switch is open, no
current flows through the resistor and therefore the voltage on the microcontroller pin is 3.3 V.
When the switch is closed the pin is connected directly to ground. As before, when the TTL input
is HIGH practically no current flows in the circuit and when the input is LOW there is a direct
current for the 3 A that may flow from the pin.

In VSK-2148 board Dip-switch and matrix keypad lines are multiplexed.

To Access the Dip-switch, connect 10- core cable between P13 and P14 connectors.

Used Port Lines

// SWITCH INTERFACE
// SW0 - SW7 : P0.16 - P0.23
// LED0 - LED7 : P1.24 - P1.31
// Switch Staus Displayed on LED

Vi Microsystems Pvt. Ltd., [ 37 ]


ARM7 LPC2148 STARTER KIT VSK-2148

#include <nxp/iolpc2148.h>
static void delay(void ) //Delay Routine
{
volatile int i,j;
for (i=0;i<0x3F;i++)
for (j=0;j<500;j++);
}
void main()
{
PINSEL1 = 0x00000000; // Configured as GPIO port
PINSEL2 = 0x00000000; // Configured as GPIO port
IO0DIR = 0X00000000; // P0.16 TO P0.23 Configured as input
IO1DIR = 0Xff000000; // P1.23 TO P1.31 Configured as output
while(1)
{
IO1PIN = (~(IO0PIN & 0x00FF0000)<<0x08); //Read the switch value
}
} //And shift 8 times and then move
KEYPAD

The Matrix keyboard is used to minimize the number of I/O lines. Normally it is possible to
connect only one key or switch with a I/O line. If the number of keys in the system exceeds the
more I/O lines are required. To reduce the number of I/O lines the keys are connected in the
matrix circuit. Keyboards use a matrix with the rows and columns made up of wires. Each key act
like a switch. When a key is pressed a column wire makes contact with row wire and completes a
circuit.

For example 16 keys arranged in a matrix circuit uses only 8 I/O lines.

In VSK-2148 board Dip-switch and matrix keypad lines are multiplexed.

To Access the Dip-switch, connect 10- core cable between P13 and P12 connectors.

Vi Microsystems Pvt. Ltd., [ 38 ]


ARM7 LPC2148 STARTER KIT VSK-2148

K8
K7
K6
K5
SW1 SW2 SW3 SW4
C D E F
1 1 1 1
2

2
K4
K3
K2
SW5 SW6 SW7 SW8
K1
8 9 A B
1 1 1 1
2

2
SW10 SW11 SW12 SW13
4 5 6 7
1 1 1 1
2

SW14 SW15 SW16 SW17


0 1 2 3
1 1 1 1
2

Port lines Used

// Keypad Interface
// K1 TO K8 : P0.16 TO P0.23
// Key Value is displayed on UART0
// SCAN LINES : P0.20 TO P0.23 (OUTPUT)
// READ LINES : PO.16 TO P0.19 (INPUT)

#include<nxp/iolpc2148.h>
#define DESIRED_BAUDRATE 19200
#define CRYSTAL_FREQUENCY_IN_HZ 12000000
#define PCLK CRYSTAL_FREQUENCY_IN_HZ
#define DIVISOR (PCLK/(16*DESIRED_BAUDRATE))

void delay_ms()
{ //delay Routine
int i,j;
for(i=0;i<=0xff;i++)
for(j=0;j<=0xf0;j++);
}
Vi Microsystems Pvt. Ltd., [ 39 ]
ARM7 LPC2148 STARTER KIT VSK-2148

int putchar(char ch)


{
if (ch=='\n')
{
while (!(U0LSR&0x20)); //wait until Transmit Holding Register is empty
U0THR='\r'; //then store to Transmit Holding Register
}

while (!(U0LSR&0x20)) {} //wait until Transmit Holding Register is empty


U0THR=ch; //then store to Transmit Holding Register
return ch; }
void Arm_Uart0_Init()
{
U0LCR=0x83; // U0LCR: UART0 Line Control Register.
// 0x83: enable Divisor Latch access, set 8-bit word length.
// 1 stop bit, no parity, disable break transmission.
VPBDIV=0x01; // VPBDIV: VPB bus clock divider 0x01:
PCLK = processor clock.
U0DLL=DIVISOR&0xFF; // U0DLL: UART0 Divisor Latch (LSB).
U0DLM=DIVISOR>>8; // U0DLM: UART0 Divisor Latch (MSB).
U0LCR=0x03 ; // U0LCR: UART0 Line Control Register
// 0x03: same as above, but disable Divisor Latch access.
U0FCR=0x05 ; // U0FCR: UART0 FIFO Control Register
// 0x05: Clear Tx FIFO and enable Rx and Tx FIFOs
}

void main()
{
PINSEL0 = 0x00000005; //Pin selection for UART0
PINSEL2 = 0x00000000; //P0.16 TO P0.23 Configured as GPIO.
IO0DIR = 0X00F00005; //P0.20 TO P0.23 (O/P), P0.16 TO P0.19(I/P)
Arm_Uart0_Init(); //Serial initialization
printf("\n\r 4 x 4 Matrix Key Pad Interface ");
printf("\n\r Press any Key Pad Interface ");

while(1)
{
IO0PIN=0x00E00000; // First Scan Line
if(( IO0PIN & 0x000F0000 )!= 0x000F0000) //Check if any key is pressed in //4th
row
{

switch(IO0PIN & 0x000F0000) //Check which one of the key is pressed


{
case 0x00070000 : printf("F");break;
case 0x000B0000 : printf("B");break;
case 0x000D0000 : printf("7");break;
Vi Microsystems Pvt. Ltd., [ 40 ]
ARM7 LPC2148 STARTER KIT VSK-2148

case 0x000E0000 : printf("3");break;


}
}
IO0PIN=0x00D00000; //Move second data to scan line

if(( IO0PIN & 0x000F0000 )!= 0x000F0000) //Check if any key is pressed in
//3rd row.
{
switch(IO0PIN & 0x000F0000) //check which one of the key is pressed
{
case 0x00070000 : printf("E");break;
case 0x000B0000 : printf("A");break;
case 0x000D0000 : printf("6");break;
case 0x000E0000 : printf("2");break;
}
}
IO0PIN=0x00B00000; //Move 3rd scan data to port line
if(( IO0PIN & 0x000F0000 )!= 0x0F000000)//Scan any key is pressed in 2nd row
{
switch(IO0PIN & 0x000F0000) //Check which one of the key is
//pressed in 2nd row
{
case 0x00070000 : printf("D");break;
case 0x000B0000 : printf("9");break;
case 0x000D0000 : printf("5");break;
case 0x000E0000 : printf("1");break;
}
}
IO0PIN=0x00700000; //Move 4th scan data to port line
if(( IO0PIN & 0x000F0000 )!= 0x000F0000) //Check any key is pressed in 1st
// row
{
switch(IO0PIN & 0x000F0000) //Check which one of the key is
//pressed in 1st row
{
case 0x00070000 : printf("C");break;
case 0x000B0000 : printf("8");break;
case 0x000D0000 : printf("4");break;
case 0x000E0000 : printf("0");break;
}
}
delay_ms();
}
}

Vi Microsystems Pvt. Ltd., [ 41 ]


ARM7 LPC2148 STARTER KIT VSK-2148

LCD (Liquid Crystal Display)

Liquid crystals are a phase of matter whose order is intermediate between that of a liquid and that
of a crystal. The molecules are typically rod-shaped organic matters about 25 Angstroms in length
and their ordering is a function of temperature. The molecular orientation can be controlled with
applied electric fields. LCD is made up of two sheets of polarizing material with the liquid crystal
solution between them. An electric current passed through the liquid causes the crystals to align
so that light cannot pass through them, which results in display of character as per the applied
voltage in its data lines. The driver is provided to drive the LCD. It stores the display data
transferred from the microcontroller in the internal display RAM and generates dot matrix liquid
crystal driving signals. Each bit data of display RAM corresponds to on/off state of a dot of a liquid
crystal display.

LCD is used in widespread applications due to the following reasons:

1. The declining prices of LCDs.


2. The ability to display numbers, characters, and graphics.
3. Incorporation of a refreshing controller into the LCD, thereby relieving the CPU of the
task of refreshing the LCD.
4. Ease of programming for characters and graphics.

CHARACTER BASED LCD

A standard character LCD is probably the most widely used data Visualization component.

Character LCDs are available in various kinds of models.

1. No. Of characters  Lines: 81, 161, 162, 164, 204, 404…


2. Color: Yellow, Green, Gray, Blue…

The Character LCD communicates with the microcontroller via 8 bit data bus.
The pin description for character LCD is given below.

VCC, GND AND V0 - While VCC and VSS provide +5V and ground, respectively; V0 is used for
controlling LCD contrast.
RS (Register Select) - If RS = 0, the instruction command code register is selected, allowing the
user to send a command such as clear display, cursor at home, etc.

If RS = 1, the data register is selected, allowing the user to send data to be displayed on the LCD.

RW (Read/Write) - RW allows the user to write information to the LCD or read information from
it. RW=1 when reading; RW=0 when writing.

EN (Enable) - The LCD to latch information presented to its data pins uses the enable pin. When
data is supplied to data pins, a high to low pulse must be applied to this pin in order for the LCD
to latch in the data present at the data pins.

Vi Microsystems Pvt. Ltd., [ 42 ]


ARM7 LPC2148 STARTER KIT VSK-2148

D0 – D7 - The 8-bit data pins, are used to send information to the LCD or read the contents of the
LCD’s internal registers. To display letters and numbers, we send ASCII codes for the letters A-Z,
a-z, and numbers 0-9 to these pins while making RS = 1.

Vi Microsystems Pvt. Ltd., [ 43 ]


ARM7 LPC2148 STARTER KIT VSK-2148

Used Port Lines

//LCD0-LCD7 - P1.16 to P1.23


//RS - P0.8
//LCDEN - P0.11
#include <nxp/iolpc2148.h>
#define LCD_EN 0X00000800 //Define port line to LCD enable
#define RS 0X00000100 //Define port line to RS enable
unsigned char arr1[16]="Vi Microsystems ";
unsigned char arr2[16]=" Chennai.. ";
void delay_ms() //Delay Routine
{
unsigned int i,j;
for(j=0;j<0x3Ff;j++)
for(i=0;i<0xff;i++);
}
void busy_check() //Busy check delay
{
delay_ms();
}
void command_write(int comm)
{
busy_check();
IO0CLR = RS; //RS = 0
IO1PIN = comm<<16; //Command move to port lines
IO0SET = LCD_EN; //Set LCD Enable
IO0CLR = LCD_EN; //Clear LCD Enable
}
void lcd_init()
{
command_write(0x38); // 5 * 7 Matrix
command_write(0x01); // Clear Display
command_write(0x0f); // Display ON and Cursor Blinking
command_write(0xc0); // 5 * 7 Matrix
command_write(0x06);
}
void lcd_out(unsigned char z)
{
busy_check();
IO0SET = RS; //RS = 1
IO1PIN = (z<<16); //data with Rs=1
IO0SET = LCD_EN; //Set LCD Enable
IO0CLR = LCD_EN; //Clear LCD Enable
}
void main()
{
PINSEL2=0x00000000; //Pin Selection or GPIO
IO0DIR =0xffffffff; // RS& LCDEN - Output Pins
Vi Microsystems Pvt. Ltd., [ 44 ]
ARM7 LPC2148 STARTER KIT VSK-2148

IO1DIR =0xFFFFFFFF; // LCD0 to LCD7 - Output Pins

IO0DIR =0x5FFF7FFF; //RS, EN Line Select to output


IO1DIR =0xFFFFFFFF; //LCD Data line select to output

IO0CLR = 0X00000800; //Clear All data line


IO1PIN = 0X00000000; //Clear All data line
IO0PIN = 0X00000000; //Clear All data line

IO0CLR = RS; //RS = 0


IO0CLR = LCD_EN; //EN = 0
lcd_init(); //LCD initialization
command_write(0x80); //First Line select
for(int i=0;i<16;i++)
lcd_out(arr1[i]); //Display arr[] data in first line
command_write(0xC0); //Select second Line
for(int i=0;i<16;i++)
lcd_out(arr2[i]); //Display arr 2 [] data in 2nd line
while(1);

Vi Microsystems Pvt. Ltd., [ 45 ]


ARM7 LPC2148 STARTER KIT VSK-2148

RS-232 COMMUNICATION

Serial port is a serial communication physical interface through which information transfers in or
out one bit at a time (contrast parallel port). The name "serial" comes from the fact that a serial
port "serializes" data. That is, it takes a byte of data and transmits the 8 bits in the byte one at a
time. The advantage is that a serial port needs only one wire to transmit the 8 bits (while a
parallel port needs 8). The disadvantage is that it takes 8 times longer to transmit the data than it
would if there were 8 wires. Serial ports lower cable costs and make cables smaller.

There are two basic types of serial communications, synchronous and asynchronous. With
synchronous communications, the two devices initially synchronize themselves to each other,
and then continually send characters to stay in sync. Even when data is not really being sent, a
constant flow of bits allows each device to know where the other is at any given time. That is,
each character that is sent is either actual data or an idle character. Synchronous communications
allows faster data transfer rates than asynchronous methods, because additional bits to mark the
beginning and end of each data byte are not required.

Asynchronous means "no synchronization", and thus does not require sending and receiving idle
characters. However, the beginning and end of each byte of data must be identified by start and
stop bits. The start bit indicates when the data byte is about to begin and the stop bit signals when
it ends. The requirement to send these additional two bits causes asynchronous communication to
be slightly slower than synchronous however it has the advantage that the processor does not
have to deal with the additional idle characters.

An asynchronous line that is idle is identified with a value of 1 (also called a mark state). By using
this value to indicate that no data is currently being sent, the devices are able to distinguish
between an idle state and a disconnected line. When a character is about to be transmitted, a start
bit is sent. A start bit has a value of 0 (also called a space state). Thus, when the line switches from
a value of 1 to a value of 0, the receiver is alerted that a data character is about to be sent.

Vi Microsystems Pvt. Ltd., [ 46 ]


ARM7 LPC2148 STARTER KIT VSK-2148

Data-bits

CLK

Start-bit Stop-bit

One of the LPC2148s many powerful features is its integrated UART, otherwise known as a serial
port. The fact that the LPC2148 has an integrated serial port means that you may very easily read
and write values to the serial port. If it were not for the integrated serial port, writing a byte to a
serial line would be a rather tedious process-requiring turning on and off one of the I/O lines in
rapid succession to properly "clock out" each individual bit, including start bits, stop bits, and
parity bits. However, we do not have to do this. Instead, we simply need to configure the serial
ports operation mode and baud rate. Once configured, all we have to do is write to an SFR to
write a value to the serial port or read the same SFR to read a value from the serial port.

The LPC2148 will automatically let us know when it has finished sending the character we wrote
and will also let us know whenever it has received a byte so that we can process it. We do not
have to worry about transmission at the bit level--which saves us quite a bit of coding and
processing time.

UART or Serial ports, also called communication (COM) ports, RS-232 ports are bi-directional.
The LPC2148 contain two UARTs. In addition to standard transmit and receive data lines, the
UART1 also provides a full modem control handshake interface.

Vi Microsystems Pvt. Ltd., [ 47 ]


ARM7 LPC2148 STARTER KIT VSK-2148

// BAUD RATE CALCULATION


// DIVISOR = (PCLK/(16*DESIRED_BAUDRATE))
// For Example
// Peripheral Clock Frequency (PCLK) = 12 Mhz
// Desired Baud Rate = 19200 bps
// Divisor = (12000000/(16*19200)) = 39
#define DESIRED_BAUDRATE 19200
#define CRYSTAL_FREQUENCY_IN_HZ 12000000
#define PCLK CRYSTAL_FREQUENCY_IN_HZ // since VPBDIV=0x01
#define DIVISOR (PCLK/(16*DESIRED_BAUDRATE))
char arr[]=" \n\r Vimicro system Pvt ltd. Chennai - 96. " ;
char serial_tr(char ch)
{
if (ch=='\n')
{
while (!(U0LSR&0x20)); //wait until Transmit Holding Register is empty
U0THR='\r'; //then store to Transmit Holding Register
}
while (!(U0LSR&0x20)) {} //wait until Transmit Holding Register is
empty
U0THR=ch; //then store to Transmit Holding Register
return ch;
}
void Arm_Uart0_Init(void)
{
PINSEL0 = 0x00000005; // (probably not necessary: PINSELs default to zero).
// (lower 4bit selected for UART0 and remaining all bits selected for
GPIO's)
// (frist LSB 2bit(0 and 1 bits) selected 01b for UART0 Tx).
Vi Microsystems Pvt. Ltd., [ 48 ]
ARM7 LPC2148 STARTER KIT VSK-2148

// ( LSB bit(2 and 3 bits) selected 01b for UART0 Rx).

U0LCR=0x83; / / U0LCR: UART0 Line Control Register.


// 0x83: enable Divisor Latch access, set 8-bit word length.
// 1 stop bit, no parity, disable break transmission.
VPBDIV=0x01; // VPBDIV: VPB bus clock divider 0x01:
// PCLK = processor clock.

U0DLL=DIVISOR&0xFF; // U0DLL: UART0 Divisor Latch (LSB).


U0DLM=DIVISOR>>8; // U0DLM: UART0 Divisor Latch (MSB).
U0LCR=0x03 ; // U0LCR: UART0 Line Control Register
// 0x03: disable Divisor Latch access.
U0FCR=0x05 ; // U0FCR: UART0 FIFO Control Register
// 0x05: Clear Tx FIFO and enable Rx and Tx FIFOs
}
void main ()
{
int i;
Arm_Uart0_Init();
while(1)
{
for(i=0;arr[i]!='\0';i++) //arr[] value is send to serial port
{
serial_tr(arr[i]);
}
}
}
A/D CONVERTER INPUT

Analog to Digital converter (ADC) is a device that converts continuously varying analog signals
from instruments that monitor such conditions as movement, temperature, sound, etc., into
binary code for the computer. It may be contained on a single chip or can be one circuit within a
chip. Analog to Digital conversion is the process of changing continuously varying data, such as
voltage, current, or shaft rotation, into discrete digital quantities that represent the magnitude of
the data compared to a standard or reference at the moment the conversion is made. According to
the method of conversion ADCs can be classified into Direct-Conversion ADCs, Successive
Approximation ADCs, Integrating ADC and Sigma-Delta ADCs.

The LPC 2148 has 10-bit successive approximation analog to digital converter. Basic clocking for
the A/D converters is provided by the VPB clock. A programmable divider is included in each
converter, to scale this clock to the 4.5 MHz (max) clock needed by the successive approximation
process. A fully accurate conversion requires 11 of these clocks. The ADC cell can measure the
voltage on any of the ADC input signals. Note that these analog inputs are always connected to
their pins, even if the Pin function Select register assigns them to port pins. A simple self-test of
the ADC can be done by driving these pins as port outputs.

While the ADC pins are specified as 5 V tolerant More than 3.3 V (VDDA) +10 % should not be
applied to any pin that is selected as an ADC input, or the ADC reading will be incorrect. If for
example AD0.0 and AD0.1 are used as the ADC0 inputs and voltage on AD0.0 = 4.5 V while
Vi Microsystems Pvt. Ltd., [ 49 ]
ARM7 LPC2148 STARTER KIT VSK-2148

AD0.1 = 2.5 V, an excessive voltage on the AD0.0 can cause an incorrect reading of the AD0.1,
although the AD0.1 input voltage is within the right range.

VSK-2148 has one potentiometers for working with A/D Converter. Potentiometer outputs are in
the range of 0V to 3.3V. Short the J4 jumper for reading the Potentiometer value by ADC.

// P0.28 - ADC0.1
// ADC VALUE Displayed on UART0
#include<NXP/iolpc2148.h>
#define DESIRED_BAUDRATE 19200
#define CRYSTAL_FREQUENCY_IN_HZ 12000000
#define PCLK CRYSTAL_FREQUENCY_IN_HZ // since VPBDIV=0x01
#define DIVISOR (PCLK/(16*DESIRED_BAUDRATE))
int putchar(int a)
{
while (!(U0LSR&0x20));
return(U0THR=a);
}
void ADC_init()
{
AD0CR_bit.SEL =1; //enable AD0.1 only
AD0CR_bit.CLKDIV = 12000000 / 4500000;
AD0CR_bit.BURST = 1; // put A/D into continuous convert mode
AD0CR_bit.CLKS = 0; //11 clocks/10 bit accuracy
AD0CR_bit.PDN = 1; //power up the unit
AD0CR_bit.START = 0x0001; //start 1st cnvrsn immediately
}
void Arm_Uart0_Init()
{
U0LCR=0x83; / / U0LCR: UART0 Line Control Register.
// 0x83: enable Divisor Latch access, set 8-bit word length.
// 1 stop bit, no parity, disable break transmission.
VPBDIV=0x01; // VPBDIV: VPB bus clock divider 0x01:
// PCLK = processor clock.
U0DLL=DIVISOR&0xFF; // U0DLL: UART0 Divisor Latch (LSB)
U0DLM=DIVISOR>>8; // U0DLM: UART0 Divisor Latch (MSB)
U0LCR=0x03 ; // U0LCR: UART0 Line Control Register
// 0x03: disable Divisor Latch access
U0FCR=0x05 ; // U0FCR: UART0 FIFO Control Register
// 0x05: Clear Tx FIFO and enable Rx and Tx FIFOs
}
void main()
{
unsigned int ADCresult;
PINSEL0 = 0X00000005; // UART0 PIN SELECTION
PINSEL1 = 0x01000000; // ADC0.1 CHANNEL SELECT
Arm_Uart0_Init();
ADC_init();
while(1)
Vi Microsystems Pvt. Ltd., [ 50 ]
ARM7 LPC2148 STARTER KIT VSK-2148

{
while(AD0DR_bit.DONE == 0); //wait until conversion done
ADCresult = (AD0DR>>6)& 0x3ff ; // conversion data holds AD0DR0[6] to
AD0DR0[15]
printf("\n\r ADC VALUE ---->%x",ADCresult); //ADC value send to serial port
}
}
RELAY

A relay is an electrical switch that opens and closes under the control of an other electrical
circuit. In the original form, the switch is operated by an electromagnet to open or close one or
many sets of contacts. When a current flows through the coil, the resulting magnetic field attracts
an armature that is mechanically linked to a moving contact. The movement either makes or
breaks a connection with a fixed contact. When the current to the coil is switched off, the
armature is returned by a force approximately half as strong as the magnetic force to its relaxed
position. Usually this is a spring, but gravity is also used commonly in industrial motor starters.
Most relays are manufactured to operate quickly.

In a low voltage application, this is to reduce noise. In a high voltage or high current application,
this is to reduce arcing. If the coil is energized with DC, a diode is frequently installed across the
coil, to dissipate the energy from the collapsing magnetic field at deactivation, which would
otherwise generate a spike of voltage and might cause damage to circuit components. If the coil is
designed to be energized with AC, a small copper ring can be crimped to the end of the solenoid.
This "shading ring" creates a small out-of-phase current, which increases the minimum pull on
the armature during the AC cycle. By analogy with the functions of the original electromagnetic
device, a solid-state relay is made with a thyristor or other solid-state switching device. To
achieve electrical isolation, a light-emitting diode (LED) is used with a photo transistor.

Vi Microsystems Pvt. Ltd., [ 51 ]


ARM7 LPC2148 STARTER KIT VSK-2148

#include <nxp/iolpc2148.h>
void delay() //delay Routine
{
unsigned int i,j;
for(i=0;i<0xff;i++)
for(j=0;j<0xff;j++);
}
int main (void)
{
PINSEL0= 0X00000000; // Pin Selection for GPIO
PINSEL1= 0X00000000; // Pin Selection for GPIO
IO0DIR = 0Xf0000000; // Pin Select for input (P0.0 to P0.29)
// Output (P0.29 to P0. 31)
while(1)
{
IO0SET = 0XA0000000; //Relay ON
delay(); // Delay
IO0CLR = 0XA0070000; //Relay OFF
delay(); //Delay
}
}

Vi Microsystems Pvt. Ltd., [ 52 ]


ARM7 LPC2148 STARTER KIT VSK-2148

I2C PERIPHERALS

I2C Stands for Inter Integrated Circuit Communications. This module is built into many arm
Controllers. It allows I2C serial communication between two or more devices at a high speed. I2C
is a synchronous protocol that allows a master device to initiate communication with a slave
device. Data is exchanged between these devices. I2C is also Bi-Directional. This is implemented
by an “ Acknowledge” System.

In VSK-2148 there are three I2C based Peripherals.


1. I2C Based Real Time Clock
2. I2C Based Serial EEPROM
3. I2C Based Seven Segment Display

Real Time Clock

Communication : Two Wire Communication


Protocol : I2C
Hardware IC : DS1307
Application : Clock and calendar
#include<nxp/iolpc2148.h>
#include<stdio.h>
#define DESIRED_BAUDRATE 19200
#define CRYSTAL_FREQUENCY_IN_HZ 12000000
#define PCLK CRYSTAL_FREQUENCY_IN_HZ // since VPBDIV=0x01
#define DIVISOR (PCLK/(16*DESIRED_BAUDRATE))
char rtc_data[12];
//FUNCTION DEFINITION
void delay(void ) //Delay Routine
{
volatile int i,j;
for (i=0;i<5;i++)
for (j=0;j<50;j++);
}
void delay1(void )
{
volatile int i,j;
for (i=0;i<25;i++)
for (j=0;j<500;j++);
}
int putchar(int i)
{
while (!(U0LSR&0x20)); //wait until Transmit Holding Register is empty
return(U0THR=i); //then store to Transmit Holding Register
}
void Arm_Uart0_Init()
void Arm_Uart0_Init()
{
U0LCR=0x83; / / U0LCR: UART0 Line Control Register.

Vi Microsystems Pvt. Ltd., [ 53 ]


ARM7 LPC2148 STARTER KIT VSK-2148

// 0x83: enable Divisor Latch access, set 8-bit word length.


// 1 stop bit, no parity, disable break transmission.
VPBDIV=0x01; // VPBDIV: VPB bus clock divider 0x01:
// PCLK = processor clock.
U0DLL=DIVISOR&0xFF; // U0DLL: UART0 Divisor Latch (LSB)
U0DLM=DIVISOR>>8; // U0DLM: UART0 Divisor Latch (MSB)
U0LCR=0x03 ; // U0LCR: UART0 Line Control Register
// 0x03: disable Divisor Latch access
U0FCR=0x05 ; // U0FCR: UART0 FIFO Control Register
// 0x05: Clear Tx FIFO and enable Rx and Tx FIFOs
}
void i2c_write(unsigned int addr,unsigned int data)
{
I2C0CONSET=0x60; //start command to I2c slave device
delay();
while(I2C0STAT!=0x08); //Wait until status register becomes 08
I2C0DAT=0xD0; //RTC ADDRESS(PCF8583)
I2C0CONCLR=0x28;
delay();
while(I2C0STAT!=0x18) //Wait until status register becomes 18
delay();
I2C0DAT=addr; //Initialize the address register
I2C0CONCLR=0x8;
while(I2C0STAT!=0x28)
delay();
delay1();
I2C0DAT=data; //Write the Data in RTC data register
I2C0CONCLR=0x8;
while(I2C0STAT!=0x28) //Wait until status register becomes 0x28
delay();
I2C0CONSET=0x10; // send command to stop I2C slave
I2C0CONCLR=0x8;
delay1();
}
void i2c_read(unsigned int addr)
{
I2C0CONSET=0x10;
I2C0CONCLR=0x8;
delay1();
I2C0CONSET=0x60; // to Initialize the slave address
delay();
while(I2C0STAT!=0x08);
I2C0DAT=0xA0; // Write Slave address
I2C0CONCLR=0x28;
delay();
while(I2C0STAT!=0x18) //wait for slave address write is ok
delay();
I2C0DAT=addr; //To initialize the READ address
Vi Microsystems Pvt. Ltd., [ 54 ]
ARM7 LPC2148 STARTER KIT VSK-2148

I2C0CONCLR=0x8;
while(I2C0STAT!=0x28)
delay();
I2C0CONSET=0x10; //Stop the I2C Slave device
I2C0CONCLR=0x8;
delay();
I2C0CONSET=0x60; //Restart I2C
delay();
while(I2C0STAT!=0x08);
I2C0DAT=0xa1; //write slave address with READ mode
I2C0CONCLR=0x2C;
while(I2C0STAT!=0x40);
I2C0CONSET = 0X04;
I2C0CONCLR = 0X08;
for(int i=0;i<0x03;i++)
{
I2C0CONCLR=0x08;
while(I2C0STAT!=0x50);
delay();
rtc_data[i]=I2C0DAT; //READ the RTC value & Save it to array
I2C0CONCLR = 0X0C;
I2C0CONSET = 0X04;
I2C0CONCLR = 0X08;
}
I2C0CONSET=0x10; //Stop the I2C. slave device
I2C0CONCLR=0x8;
delay();
}
void main()
{
PINSEL0=0x00000055;
Arm_Uart0_Init();
I2C0CONCLR=0x6C; //clear I2C0CONCLR register
I2C0CONSET=0x40; //Enable I2C.
I2C0SCLH=110; //SET CLOCK VALUE
I2C0SCLL=90;
while(1)
{
delay1();
i2c_write(0x02,0X50); //WRITE FOR SECONDS
i2c_write(0x03,0X12); //WRITE FOR MINUTES
i2c_write(0x04,0X12); //WRITE FOR HOURS

Vi Microsystems Pvt. Ltd., [ 55 ]


ARM7 LPC2148 STARTER KIT VSK-2148

while(1)
{
i2c_read(0x02); //READ RTC VALUES
printf("\n\rRTC=%x:%x:%x",rtc_data[2],rtc_data[1],rtc_data[0]);
}
} //send RTC value to serial port
}

Vi Microsystems Pvt. Ltd., [ 56 ]


ARM7 LPC2148 STARTER KIT VSK-2148

EEPROM

Serial-interface EEPROM’s are used in a broad spectrum of consumer, automotive,


telecommunication, medical, industrial and PC related markets. Primarily used to store personal
preference data and configuration/setup data, Serial EEPROM’s are the most flexible type of non-
volatile memory utilized today. Compared to other NVM solutions, Serial EEPROM devices offer
a lower pin count, smaller packages, lower voltages, as well as lower power consumption.

// SDA LINE -P0.3


// SCL LINE -P0.2
// SLAVE ADDRESS WRITE=0XA2,READ =0XA3

#include<nxp/iolpc2148.h>
#include<stdio.h>
#define DESIRED_BAUDRATE 19200
#define CRYSTAL_FREQUENCY_IN_HZ 12000000
#define PCLK CRYSTAL_FREQUENCY_IN_HZ // since VPBDIV=0x01
#define DIVISOR (PCLK/(16*DESIRED_BAUDRATE))
char array[15]="ViMicrosystems";
char addr;

Vi Microsystems Pvt. Ltd., [ 57 ]


ARM7 LPC2148 STARTER KIT VSK-2148

//FUNCTION DEFINTION

static void delay1(void )


{
volatile int i,j; //Delay Routine
for (i=0;i<5;i++)
for (j=0;j<50;j++);
}

static void delay(void )


{
volatile int i,j;
for (i=0;i<100;i++)
for (j=0;j<500;j++);
}

void i2c_write(unsigned char msb_addr,unsigned char lsb_addr ,unsigned char i2c_data)


{

I2C0CONSET=0x60; //start I2C slave device


delay1();
while(I2C0STAT!=0x08); //wait until slave address write

I2C0DAT=0xA2; //write slave address


I2C0CONCLR=0x28;
delay1();
while(I2C0STAT!=0x18)
delay1();

I2C0DAT=msb_addr; //Write higher order address


I2C0CONCLR=0x08;
while(I2C0STAT!=0x28)
delay1();
delay();

I2C0DAT=lsb_addr; //Write lower order address


I2C0CONCLR=0x08;
while(I2C0STAT!=0x28)
delay1();

I2C0DAT=i2c_data; //Write EEPROM data


I2C0CONCLR=0x08;
while(I2C0STAT!=0x28)
delay1();

I2C0CONSET=0x10; //stop the I2C slave Device


Vi Microsystems Pvt. Ltd., [ 58 ]
ARM7 LPC2148 STARTER KIT VSK-2148

I2C0CONCLR=0x8;
delay();

void i2c_read(unsigned char msb_addr,unsigned char lsb_addr,int count)


{
//START CONDITION

I2C0CONSET=0x60; //start I2C Slave device.


delay1();
while(I2C0STAT!=0x08);

//SLAVE ADDRESS

I2C0DAT=0xA2; //EEPROM DEVICE ADDRESS(0XA2)


I2C0CONCLR=0x28;
delay1();
while(I2C0STAT!=0x18);
delay1();

//HIGHER ORDER ADDRESS

I2C0DAT=msb_addr; //WRITE THE EEPROM HIGHER ORDER ADDRESS

Vi Microsystems Pvt. Ltd., [ 59 ]


ARM7 LPC2148 STARTER KIT VSK-2148

I2C0CONCLR=0x8;
while(I2C0STAT!=0x28);
delay1();
delay();
//LOW ORDER ADDRESS

I2C0DAT=lsb_addr; //write the EEPROM lower order address


I2C0CONCLR=0x08;
while(I2C0STAT!=0x28);
delay1();

//STOP CONDITION

I2C0CONSET=0x10; //stop the I2C slave Device


I2C0CONCLR=0x08;
delay1();
I2C0CONSET=0x10;
I2C0CONCLR=0x08;

//RESTART CONDITION

I2C0CONSET=0x60; // start I2C Slave device.


delay1();
while(I2C0STAT!=0x08);

//WRITE SLAVE ADDRESS FOR READ MODE

I2C0DAT=0xa3; //EEPROM read address


I2C0CONCLR=0x2C;
while(I2C0STAT!=0x40);
I2C0CONSET = 0X04;
I2C0CONCLR = 0X08;

// READ THE EEPROM DATA


for(int i=0;i<=count;i++)
{
I2C0CONCLR=0x08;

Vi Microsystems Pvt. Ltd., [ 60 ]


ARM7 LPC2148 STARTER KIT VSK-2148

while(I2C0STAT!=0x50);
delay1();

printf("\n\r%x%x----->%c",msb_addr,lsb_addr+i,I2C0DAT);
addr=addr+1; //Send the value to serial port
I2C0CONCLR = 0X0C;

I2C0CONSET = 0X04;
I2C0CONCLR = 0X08;
}
}
int putchar(int ch)
{
while (!(U0LSR&0x20)) {}
return(U0THR=ch);
}
void UARTInit()
{
U0LCR=0x83; / / U0LCR: UART0 Line Control Register.
// 0x83: enable Divisor Latch access, set 8-bit word
length.
// 1 stop bit, no parity, disable break transmission.
VPBDIV=0x01; // VPBDIV: VPB bus clock divider 0x01:
// PCLK = processor clock.
U0DLL=DIVISOR&0xFF; // U0DLL: UART0 Divisor Latch (LSB)
U0DLM=DIVISOR>>8; // U0DLM: UART0 Divisor Latch (MSB)
U0LCR=0x03 ; // U0LCR: UART0 Line Control Register
// 0x03: disable Divisor Latch access
U0FCR=0x05 ; // U0FCR: UART0 FIFO Control Register
// 0x05: Clear Tx FIFO and enable Rx and Tx FIFOs
}

Vi Microsystems Pvt. Ltd., [ 61 ]


ARM7 LPC2148 STARTER KIT VSK-2148

void main()
{
PINSEL0=0x00000055; //I2C AND UART PORT SELECTION

UARTInit();
printf("Wait for some time...");
I2C0CONCLR=0x6C;
I2C0CONSET=0x40; //Initialization for I2C slave device
I2C0SCLH=110;
I2C0SCLL=90;

//WRITE EEPROM DATA

for(int i=0;i<=13;i++)
i2c_write(0x00,(0x01+i),array[i]); //Write lower address, higher address and data
i2c_read(0x00,0x01,13); //read EEPROM data

while(1);
}

Vi Microsystems Pvt. Ltd., [ 62 ]


ARM7 LPC2148 STARTER KIT VSK-2148

SEVEN SEGMENT DISPLAY

A seven-segment display, less commonly known as a seven-segment indicator, is a form of display


device that is an alternative to the more complex dot-matrix displays. Seven-segment displays are
commonly used in electronics as a method of displaying decimal numeric feedback on the internal
operations of devices.

A seven-segment display, as its name indicates, is composed of seven elements. Individually on or


off, they can be combined to produce simplified representations of the Hindu-Arabic numerals.
Each of the numbers and may be represented by two or more different glyphs on seven-segment
displays.

The seven segments are arranged as a rectangle of two vertical segments on each side with one
horizontal segment on the top and bottom. Additionally, the seventh segment bisects the
rectangle horizontally. There are also fourteen-segment displays and sixteen-segment displays (for
full alphanumeric); however, these have mostly been replaced by dot-matrix displays. Often the
seven segments are arranged in an oblique, or italic, arrangement, which aids readability.

The letters A to G refers to the segments of a 7-segment display.

#include<nxp/iolpc2148.h>
#include<stdio.h>

#define DESIRED_BAUDRATE 19200


#define CRYSTAL_FREQUENCY_IN_HZ 12000000
#define PCLK CRYSTAL_FREQUENCY_IN_HZ // since VPBDIV=0x01
#define DIVISOR (PCLK/(16*DESIRED_BAUDRATE))

int i,temp,Temp1,addr;

unsigned char i2c_data[] = {0x00,0x3f,0x06,0x5b,0x4f,0x66,0x6d,0x7c,0x07,0x7f,0x67};

static void delay(void )


{
volatile int i,j;
for (i=0;i<5;i++)
for (j=0;j<50;j++);
}
static void delay1(void )
{
volatile int i,j;
for (i=0;i<100;i++)
for (j=0;j<500;j++);
}
void i2c_write(char a,char add)
{
I2C0CONSET=0x60; //start I2C slave device
delay();
delay();
Vi Microsystems Pvt. Ltd., [ 63 ]
ARM7 LPC2148 STARTER KIT VSK-2148

temp=I2C0STAT;
while(temp!=0x08)
temp=I2C0STAT;

I2C0DAT=add; //Write slave address


I2C0CONCLR=0x28;
temp=I2C0STAT;
delay();
while(temp!=0x18)
{
temp=I2C0STAT;
delay();
}

I2C0DAT=a; //Data Write


I2C0CONCLR=0x08;
temp=I2C0STAT;
while(temp!=0x28)
{
temp=I2C0STAT; //& 0x28;
delay();
}

I2C0CONSET=0x10; //stop slave device


I2C0CONCLR=0x8;
delay1();
}
int putchar(int ch)
{
while (!(U0LSR&0x20)) {}
return(U0THR=ch);
}
void main()
{
PINSEL0=0x00000055 ;
VPBDIV=0x01 ;
I2C0CONCLR=0x6C; //clear I2C0CONCLR register
I2C0CONSET=0x40; //Enable I2C.
I2C0SCLH=110;
I2C0SCLL=90; //I2C initialization
while(1)
{
for(int i=0;i<=10;i++)
i2c_write(i2c_data[i],0x70); // Write data to segment 1
for(int i=0;i<=10;i++)
i2c_write(i2c_data[i],0x72); // Write data to segment 2
for(int i=0;i<=10;i++)
i2c_write(i2c_data[i],0x74); // Write data to segment 3
Vi Microsystems Pvt. Ltd., [ 64 ]
ARM7 LPC2148 STARTER KIT VSK-2148

for(int i=0;i<=10;i++)
i2c_write(i2c_data[i],0x76); // Write data to segment 4
for(int i=0;i<=10;i++)
i2c_write(i2c_data[i],0x78); // Write data to segment 5
for(int i=0;i<=10;i++)
i2c_write(i2c_data[i],0x7A); // Write data to segment 6

}
}

Vi Microsystems Pvt. Ltd., [ 65 ]


ARM7 LPC2148 STARTER KIT VSK-2148

BUZZER

A buzzer or beeper is a signaling device, usually electronic, typically used in automobiles and
handheld appliances. It most commonly consists of a number of switches or sensors connected to
a control unit that determines if and which button was pushed or a preset time has lapsed, and
usually illuminates a light on the appropriate button or control panel, and sounds a warning in
the form of a continuous or intermittent buzzing or beeping sound. Initially this device was based
on an electro mechanical system which was identical to an electric bell without the metal gong
(which makes the ringing noise). Often these units were anchored to a wall or ceiling and used
the ceiling or wall as a sounding board.

Used Port Lines:

BUZZER: P0.15

#include<nxp/iolpc2148.h>
void delay()
{
for(int i=0;i<=0xff;i++)
for(int j=0;j<=0xff;j++);
}

void main()
{
PINSEL0 = 0X00000000; // P0.15 - GPIO PORT
IO0DIR = 0X00008000; // P0.15 - OUTPUT
while(1)
{
IO0SET = 0X00008000; // Buzzer On
delay();
IO0CLR = 0X00008000; // Buzzer off
delay();
}
}

Vi Microsystems Pvt. Ltd., [ 66 ]


ARM7 LPC2148 STARTER KIT VSK-2148

STEPPER MOTOR

Stepper motors operate differently from normal DC motors, which simply spin when voltage is
applied to their terminals. Stepper motors, on the other hand, effectively have multiple "toothed"
electromagnets arranged around a central metal gear, as shown at right. To make the motor shaft
turn, first one electromagnet is given power, which makes the gear's teeth magnetically attracted
to the electromagnet's teeth. When the gear's teeth are thus aligned to the first electromagnet,
they are slightly offset from the next electromagnet.

So when the next electromagnet is turned on and the first is turned off, the gear rotates slightly to
align with the next one, and from there the process is repeated. Each of those slight rotations is
called a "step." In that way, the motor can be turned a precise angle. There are two basic
arrangements for the electromagnetic coils: bipolar and unipolar.

THEORY

A step motor can be viewed as a DC motor with the number of poles (on both rotor and stator)
increased, taking care that they have no common denominator. Additionally, soft magnetic
material with many teeth on the rotor and stator cheaply multiplies the number of poles
(reluctance motor). Like an AC synchronous motor, it is ideally driven by sinusoidal current,
allowing a step less operation, but this puts some burden on the controller. When using an 8-bit
digital controller, 256 micro steps per step are possible. As a digital-to-analog converter produces
unwanted ohmic heat in the controller, pulse-width modulation is used instead to regulate the
mean current. Simpler models switch voltage only for doing a step, thus needing an extra current
limiter: for every step, they switch a single cable to the motor. Bipolar controllers can switch
between supply voltage, ground, and unconnected. Unipolar controllers can only connect or
disconnect a cable, because the voltage is already hard wired. Unipolar controllers need center
tapped windings.

It is possible to drive unipolar stepper motors with bipolar drivers. The idea is to connect the
output pins of the driver to 4 transistors. The transistor must be grounded at the emitter and the
driver pin must be connected to the base. Collector is connected to the coil wire of the motor.
Stepper motors are rated by the torque they produce. Synchronous electric motors using soft
magnetic materials (having a core) have the ability to provide position holding torque (called
detent torque, and sometimes included in the specifications) while not driven electrically. To
achieve full rated torque, the coils in a stepper motor must reach their full rated current during
each step. The voltage rating (if there is one) is almost meaningless. The motors also suffer from
EMF, which means that once the coil is turned off it starts to generate current because the motor
is still rotating. There needs to be an explicit way to handle this extra current in a circuit
otherwise it can cause damage and affect performance of the motor.

Vi Microsystems Pvt. Ltd., [ 67 ]


ARM7 LPC2148 STARTER KIT VSK-2148

Jumper Position

Closed 1 and 2 - Internal voltage for stepper motor.

Closed 2 and 3 - External voltage for stepper motor.

Vi Microsystems Pvt. Ltd., [ 68 ]


ARM7 LPC2148 STARTER KIT VSK-2148

#include<nxp/iolpc2148.h>
void delay_ms();
void main()
{
IO0DIR=0x000000F0; //Set port line as output port
while(1)
{
IO0PIN = 0X00000090; //0x09, 0x05, 0x06, 0x0A data are send-
delay_ms();
IO0PIN = 0X00000050; //to stepper motor. It rotates
delay_ms();
IO0PIN = 0X00000060; //the motor to forward direction
delay_ms();
IO0PIN = 0X000000A0;
delay_ms();
}
}
void delay_ms() //Delay Routine
{
int i,j;
for(i=0;i<0x0a;i++)
for(j=0;j<750;j++);
}

Vi Microsystems Pvt. Ltd., [ 69 ]


ARM7 LPC2148 STARTER KIT VSK-2148

AC Motor

General thought of people about driving the AC motor using controller is a


complicated one, but it is not like so. We can control the AC motor using controller by using
PWM (Pulse Width Modulation) techniques with some additional hardware setup.

Implementing the PWM is become too easy on nowadays, because all the controllers
have build in PWM module with no of channels, so we can easily generate the PWM output
by configuring the Specified registers.

Here in our example coding we use two PWM channels (PWM2 and PWM6). Channel 6
produce the sinusoidal PWM and channel 2 gave the 180 phase shift PWM output of sinusoidal
wave.

Hardware settings: close 2 and 3 of jumper j5


Remove Jumper J10
Close 1 and 2 of jumper J9

Refer C Files on the AC_MOTOR_C folder

DC Motor

Hardware settings: close 2 and 1 of jumper j5


Connect one of the line of DC motor to M1 of connector P10 and another
line to M2 of P10.

Vi Microsystems Pvt. Ltd., [ 70 ]


ARM7 LPC2148 STARTER KIT VSK-2148

TEMPERATURE SENSOR

// ADC INTERFACE
// P0.28 - ADC0.1
// Temperature Value Displayed on UART0

#include<NXP/iolpc2148.h>
#define DESIRED_BAUDRATE 19200
#define CRYSTAL_FREQUENCY_IN_HZ 12000000
#define PCLK CRYSTAL_FREQUENCY_IN_HZ // since VPBDIV=0x01
#define DIVISOR (PCLK/(16*DESIRED_BAUDRATE))
int putchar(int a)
{
while (!(U0LSR&0x20));
return(U0THR=a);
}
void ADC_init()
{
AD0CR_bit.SEL = 2; //enable AD0.3 only
AD0CR_bit.CLKDIV = 12000000 / 4500000;
AD0CR_bit.BURST = 1; // put A/D into continuous convert mode
AD0CR_bit.CLKS = 0; //11 clocks/10 bit accuracy
AD0CR_bit.PDN = 1; //power up the unit
AD0CR_bit.START = 0x0001; //start 1st cnvrsn immediately
}
void Arm_Uart0_Init()
{
U0LCR=0x83; / / U0LCR: UART0 Line Control Register.
// 0x83: enable Divisor Latch access, set 8-bit word length.
// 1 stop bit, no parity, disable break transmission.
VPBDIV=0x01; // VPBDIV: VPB bus clock divider 0x01:
// PCLK = processor clock.
U0DLL=DIVISOR&0xFF; // U0DLL: UART0 Divisor Latch (LSB)
U0DLM=DIVISOR>>8; // U0DLM: UART0 Divisor Latch (MSB)
U0LCR=0x03 ; // U0LCR: UART0 Line Control Register
// 0x03: disable Divisor Latch access
U0FCR=0x05 ; // U0FCR: UART0 FIFO Control Register
// 0x05: Clear Tx FIFO and enable Rx and Tx FIFOs
}
void main()
{
float ADCresult;

Vi Microsystems Pvt. Ltd., [ 71 ]


ARM7 LPC2148 STARTER KIT VSK-2148

PINSEL0 = 0X00000005; // UART0 PIN SELECTION


PINSEL1 = 0x01000000; // ADC0.1 CHANNEL SELECT
Arm_Uart0_Init();
ADC_init();
while(1)
{
while(AD0DR_bit.DONE == 0); //wait until conversion done
ADCresult = (AD0DR>>6)& 0x3ff ; // conversion data holds AD0DR0[6] to
AD0DR0[15]
printf("\n\r Temperature Value ---->%f", ADC result * 0.097);
} //Display the temperature value in serial port
}

HARDWARE DETAILS

1. Output
2. VCC
3. Ground

Vi Microsystems Pvt. Ltd., [ 72 ]


ARM7 LPC2148 STARTER KIT VSK-2148

µC/OS-II Based Programs

1. To Study and Implement Multitasking

To Write a Simple Program with Two Separate LED Blinking tasks.

TASK

1. Four LED’s are assigned for counter


2. Four LED’s are assigned for blinking

//HEADER FILE DECLARATION


#include <includes.h>
//OS TASK STACK ALLOCATION
OS_STK led_Task1stk[100];
OS_STK led_Task2stk[100];
void led_Task1(void *pdata)
{
for(;;)
{
IO1SET=0XF0000000; //set port line for LED ON
OSTimeDly(150);
IO1CLR=0Xf0000000; //Clear the port line for LED off
OSTimeDly(150);
}
}
void led_Task2(void *pdata)
{
for(;;)
{
for(int i=0;i<0xf;i++)
{
IO1SET=0X00000000 | (i <<24); //Set port line for LED set
OSTimeDly(250);
IO1CLR=0X00000000 | (i <<24); //Clear port line for LED off
} } }

void main (void)


{
PINSEL0=0X00000000; //Pin selection for GPIO
PINSEL1=0X00000000; //Pin selection for GPIO
PINSEL2=0X00000000; //Pin selection for GPIO
IO1DIR=0XFF000000; //Pin selection for output
BSP_IntDisAll(); //Disable all interrupt
BSP_Init(); //Initialize the board support package
OSInit(); //Initialize the µcosII os
OSTaskCreate(led_Task1,0,&led_Task1stk[99],5);//Task1 create with higher priority
OSTaskCreate(led_Task2,0,&led_Task2stk[99],6) );//Task2 create with lower priority

Vi Microsystems Pvt. Ltd., [ 73 ]


ARM7 LPC2148 STARTER KIT VSK-2148

OSStart();
}

2. To Study and Implement Priority Scheduling and OS Time Delay Functions by writing 3
different UART Transmitting Tasks.

#include <includes.h>

//0S TASK STACK ALLOCATION


OS_STK UART_Task1stk[100];
OS_STK UART_Task2stk[100];
OS_STK UART_Task3stk[100];

//FUNCTION DEFINITION

void UART_Task1(void *pdata)


{
for(;;)
{
printf("Task 1.."); // Send value to serial port
putchar(0x0d);
putchar(0x0a);

OSTimeDly(500);
}
}

void UART_Task2(void *pdata)


{
for(;;)
{
printf("Task 2.."); // Send value to serial port
putchar(0x0d);
putchar(0x0a);
OSTimeDly(200);
}
}

void UART_Task3(void *pdata)


{
for(;;)
{
printf("Task 3.."); // Send value to serial port
putchar(0x0d);
putchar(0x0a);

OSTimeDly(300);
Vi Microsystems Pvt. Ltd., [ 74 ]
ARM7 LPC2148 STARTER KIT VSK-2148

}
}

void main (void)


{
BSP_IntDisAll(); //Disable all interrupt
BSP_Init(); //Initialize the board support package
Arm_Uart0_Init();
OSInit(); //Initialize the µcosII os

OSTaskCreate(UART_Task1,0,&UART_Task1stk[99],10);
OSTaskCreate(UART_Task2,0,&UART_Task2stk[99],11);
OSTaskCreate(UART_Task3,0,&UART_Task3stk[99],12);
OSStart();
}

Vi Microsystems Pvt. Ltd., [ 75 ]


ARM7 LPC2148 STARTER KIT VSK-2148

3. Implement OS real Time Multitasking mplement OS real Time Multitasking program


with the tasks.

a. Interface RTC and Display on LCD First Line Continuously


b. Interface ADC and Display on LCD Second Line Continuously

#include <includes.h>
extern char rtc_data[12];
//0S TASK STACK ALLOCATION
OS_STK RTC_Taskstk[1000];
OS_STK ADC_Taskstk[1000];
//FUNCTION DEFINITION
void RTC_Task(void *pdata)
{
for(;;)
{
i2c_read(0x02); //Read RTC Value
OSTimeDly(30);
}
}
void ADC_Task(void *pdata)
{
for(;;)
{
READ_ADC(); //Read ADC Value
OSTimeDly(10);
}
}
void main (void)
{
BSP_IntDisAll(); // Disable all interrupts until we are ready to accept them
BSP_Init(); //Initialize the board support package
Arm_Uart0_Init();
OSInit();
OSTaskCreate(RTC_Task,0,&RTC_Taskstk[999],0);
OSTaskCreate(ADC_Task,0,&ADC_Taskstk[999],1);
OSStart();
}

Vi Microsystems Pvt. Ltd., [ 76 ]


ARM7 LPC2148 STARTER KIT VSK-2148

4. Implement OS real Time Multitasking by Implementing Three Tasks

a. Read the Key and Display on Seven segment LED


b. Read the ADC Analog input and Plot the Corresponding Signal on a Graphical LCD
c. Generate a PWM signal with Xon Time Yoff Time.

#include <includes.h>
unsigned char i2c_data[] =
{0x3f,0x06,0x5b,0x4f,0x66,0x6d,0x7d,0x07,0x7f,0x67,0x77,0x7c,0x39,0x5e,0x79,0x71};
//0S TASK STACK ALLOCATION
OS_STK SEGMENT_Taskstk[1000];
OS_STK ADC_Taskstk[1000];
OS_STK PWM_Taskstk[1000];
//FUNCTION DEFINITION
void SEGMENT_Task(void *pdata)
{
for(;;)
{
i2c_write(i2c_data[KEY_READ()],0x70); //Read key value and display in 7 segment
OSTimeDly(80);
}
}
void ADC_Task(void *pdata)
{
for(;;)
{
READ_ADC(); //Read ADC value
disp(); //Plot ADC in GLCD
write_xy();
graph_ploting();
OSTimeDly(20);
}
}
void PWM_Task(void *pdata)
{
for(;;)
{
PINSEL0 |= 0X00000002; //Enable PWM2
PWMPR = 0X00000001; //Load Prescaller
PWMPCR = 0X00000200; //Pwm channel 2 Double edge control,output enable
PWMMCR= 0X00000003; //On Match with timer reset the counter
PWMMR0 = 1023; //Set cycle rate to sixteen ticcs
PWMMR1 = 512; //Ser rising edge of pwm2 to 5 ticks
PWMMR2 = 0X00000008; //Ser falling edge of pwm2 to 5 ticks
PWMLER = 0X00000007; //Enable shadow latch for match 0 -2
PWMTCR = 0X00000002; //Reset counter and Prescaller
PWMTCR = 0X00000009; //Enable counter and PWM,relese counter from reset

Vi Microsystems Pvt. Ltd., [ 77 ]


ARM7 LPC2148 STARTER KIT VSK-2148

OSTimeDly(20);
}
}

void main (void)


{
BSP_IntDisAll(); //Disable all interrupt
BSP_Init(); //Initialize the board support package
PINSEL2=0x00000000;
IO0DIR |= 0xFFF07FFF;
IO1DIR |= 0xFFFFFFFF;
intlcd(); //Initialize LCD
clear_display();
vimicro();

for(int i=0;i<=0xfff;i++)
for(int i=0;i<=0xff;i++);
clear_display();

OSInit();
OSTaskCreate(SEGMENT_Task,0,&SEGMENT_Taskstk[999],0);
OSTaskCreate(ADC_Task,0,&ADC_Taskstk[999],1);
OSTaskCreate(PWM_Task,0,&PWM_Taskstk[999],2);
OSStart();
}

Vi Microsystems Pvt. Ltd., [ 78 ]


ARM7 LPC2148 STARTER KIT VSK-2148

5. Interface a Stepper Motor and Control the Speed of Rotation by implementing RTOS delay
Functions.

#include <includes.h>
extern int speed;
//OS TASK STACK DECLARATION
OS_STK motor_Task1stk[100];
OS_STK speed_Task2stk[100];
extern int speed;

//OS TASK FUNCTION DEFINITION


void motor_Task1(void *pdata)
{
IO0DIR=0x000000F0; //port selection for output
for(;;)
{
IO0PIN = 0X00000090;
OSTimeDlyHMSM(0,0,0,speed); //Stepper motor’s forward -
IO0PIN = 0X00000050;
OSTimeDlyHMSM(0,0,0,speed); //Direction data move to -
IO0PIN = 0X00000060;
OSTimeDlyHMSM(0,0,0,speed); //Port lines
IO0PIN = 0X000000A0;
OSTimeDlyHMSM(0,0,0,speed);
}
}
void speed_Task2(void *pdata)
{
for(;;)
{
KEY_READ(); //Read key value
OSTimeDly(30);
}
}
void main (void)
{
BSP_IntDisAll(); //Disable all interrupt
OSInit(); //µcosII OS Initialize
OSTaskCreate(motor_Task1,0,&motor_Task1stk[99],1); //OS TASK CREATION
OSTaskCreate(speed_Task2,0,&speed_Task2stk[99],0); // OS TASK CREATION
OSStart();
}

Vi Microsystems Pvt. Ltd., [ 79 ]


ARM7 LPC2148 STARTER KIT VSK-2148

REVISED PROGRAM NO: 1

TIME DELAY PROGRAM USING BUILT-IN TIMER

#include <nxp/ioLPC2148.h>
#include <intrinsics.h>
unsigned int FLAG,i,COUNT;

//---------------------------PLL SETTINGS---------------------------------------//
void LPC2148PLLInit(void)
{
unsigned long loop_ctr; /* Configure PLL0, which determines
the CPU clock */
PLLCFG = 0x00000024; /* Use PLL values of M = 4 and P = 2 */
PLLCON_bit.PLLE = 1; /* Set the PLL Enable bit */
PLLFEED = 0xAA; /* Write to the PLL Feed register */
PLLFEED = 0x55;
loop_ctr = 10000; /* Wait for the PLL to lock into the new
frequency */
while (((PLLSTAT_bit.PLOCK) == 0) && (loop_ctr > 0))
{
loop_ctr--;
}
PLLCON_bit.PLLC = 1; /* Connect the PLL */
PLLFEED = 0xAA; /* Write to the PLL Feed register */
PLLFEED = 0x55;
VPBDIV = 0x00000001; /* Set the VPB frequency to one-half of the CPU
clock */
}

//------------------------------------------------------------------------------//

void timer_1()
{
//Timer 1 Initialisation
T1IR = 0xFF; // reset match and capture event interrupts
T1TC = 0; // Clear timer counter
T1PR = 59; // Timer counter Increments every 0.017 usec
T1MR0 = 1000000;
T1MCR = 3; // Reset Timer Counter & Interrupt on match
}
void main(void)
{
LPC2148PLLInit();
PINSEL2 = 0X00000000; //P1.23 to P1.31 configured as GPIO.
IO1DIR = 0XFF000000; //P1.23 to P1.31 configured as output port

while(1)

Vi Microsystems Pvt. Ltd., [ 80 ]


ARM7 LPC2148 STARTER KIT VSK-2148

{
timer_1(); // Timer 1 Initialisation
T1TCR = 1; // Run the Timer
while(T1TC!=1000000); //wait until Timer counter reaches set value
T1TCR = 0;
IO1SET = 0XFF000000; // LED is ON
T1TC=0;
timer_1();
T1TCR = 1;
while(T1TC!=1000000);
T1TCR = 0;
IO1CLR = 0XFF000000; LED is OFF
T1TC=0;
}
}

Vi Microsystems Pvt. Ltd., [ 81 ]


ARM7 LPC2148 STARTER KIT VSK-2148

REVISED PROGRAM NO: 2

EXTERNAL INTERRUPT

#include <NXP/iolpc2148.h>
#include <intrinsics.h>
#define XTALFREQ 12000000 //XTAL frequency in Hz
#define PCLKFREQ (XTALFREQ/4) //pclk must always be XTALFREQ/4?
int main(void);
__irq __arm void IRQ_ISR_Handler (void);
void Btn2DownISR(void);
void NonVectISR(void);
void feed (void);
int main(void)
{
/* Preliminary setup of the VIC. Assign all interrupt channels to IRQ */
VICIntSelect = 0; // Set all VIC interrupts to IRQ for now
VICIntEnClear = 0xFFFFFFFF; // Diasable all interrupts
VICSoftIntClear = 0xFFFFFFFF; // Clear all software interrutps
VICProtection = 0; // VIC registers can be accessed in User or
// privileged mode
VICVectAddr = 0; // Clear interrupt
VICDefVectAddr = 0; // Clear address of the default ISR
/*Configure the pins that the buttons are hooked up to to be external
interrupts */
PINSEL1_bit.P0_30=0x2; // Set Port pin P0.15 function to EINT3
//LED Conmfiguration
PINSEL2 = 0X00000000; // P1.24 TO P1.31 as GPIO
IO1DIR = 0XFF000000; // p1.24 TO P1.31 Configured as Output port.
VICProtection = 0; // Accesss VIC in USR | PROTECT

// VICDefVectAddr = (unsigned int)&NonVectISR; // Install default ISR addr


/* Set up the button 1 pressed interrupt on EINT0 */
VICIntSelect &= ~(1<<VIC_EINT3); // IRQ on external int 0.
VICVectAddr1 = (unsigned int)&Btn2DownISR; // Install ISR in VIC addr slot
VICVectCntl1 = 0x20 | VIC_EINT3; // Enable vec int for EINT 0.
VICIntEnable |= (1<<VIC_EINT3); // Enable EINT0 interrupt.
__enable_interrupt(); // Global interrupt enable

while(1) // Foreground Loop


{

Vi Microsystems Pvt. Ltd., [ 82 ]


ARM7 LPC2148 STARTER KIT VSK-2148

IO1SET=0XFF000000; // P1.24 TO P1.31 goes to high


state
}
}
__irq __arm void irq_handler (void)
{
void (*interrupt_function)();
unsigned int vector;
vector = VICVectAddr; // Get interrupt vector.
interrupt_function = (void(*)())vector;
(*interrupt_function)(); // Call vectored interrupt function
VICVectAddr = 0; // Clear interrupt in VIC
}
__fiq __arm void fiq_handler (void)
{
while(1);
}
void Btn2DownISR(void)
{
EXTINT_bit.EINT3 = 1; // Try to reset external interrupt flag.
IO1CLR=0XFF000000; // P1.24 TO P1.31 goes to high state
}

Vi Microsystems Pvt. Ltd., [ 83 ]


ARM7 LPC2148 STARTER KIT VSK-2148

REVISED PROGRAM NO: 3

MULTI DIGIT SEVEN SEGMENT DISPLAY

#include<nxp/iolpc2148.h>
#include<stdio.h>
#define DESIRED_BAUDRATE 19200
#define CRYSTAL_FREQUENCY_IN_HZ 12000000
#define PCLK CRYSTAL_FREQUENCY_IN_HZ // since VPBDIV=0x01
#define DIVISOR (PCLK/(16*DESIRED_BAUDRATE))
int i,temp,Temp1,addr;
unsigned char i2c_data[] = {0x00,0x3f,0x06,0x5b,0x4f,0x66,0x6d,0x7c,0x07,0x7f,0x67}
static void delay(void )
{
volatile int i,j;
for (i=0;i<5;i++)
for (j=0;j<50;j++);
}
static void delay1(void )
{
volatile int i,j;
for (i=0;i<10;i++)
for (j=0;j<500;j++);
}
void i2c_write(char a,char add)
{
//START CONDITION
I2C0CONSET=0x60; //start I2C data transmission when set STA flag.
delay();
delay();
temp=I2C0STAT;
while(temp!=0x08)
temp=I2C0STAT;
//SLAVE ADDRESS
I2C0DAT=add;
I2C0CONCLR=0x28;
temp=I2C0STAT;
delay();
while(temp!=0x18)
{
temp=I2C0STAT;
delay();

Vi Microsystems Pvt. Ltd., [ 84 ]


ARM7 LPC2148 STARTER KIT VSK-2148

}
//Data Write
I2C0DAT=a;
I2C0CONCLR=0x08;
temp=I2C0STAT;
while(temp!=0x28)
{
temp=I2C0STAT;//& 0x28;
delay();
}
//STOP CONDITION
I2C0CONSET=0x10;
I2C0CONCLR=0x8;
delay1();
}
int putchar(int ch)
{
while (!(U0LSR&0x20)) {}
return(U0THR=ch);
}
void main()
{
PINSEL0=0x00000055 ;
VPBDIV=0x01 ;
I2C0CONCLR=0x6C; //clear I2C0CONCLR register
I2C0CONSET=0x40; //Enable I2C.
I2C0SCLH=110;
I2C0SCLL=90;
while(1)
{
for(int i=0;i<=10;i++)
{
i2c_write(i2c_data[i],0x40);
i2c_write(i2c_data[i],0x42);
i2c_write(i2c_data[i],0x44);
i2c_write(i2c_data[i],0x46);
i2c_write(i2c_data[i],0x48);
i2c_write(i2c_data[i],0x4a);
}
}}

Vi Microsystems Pvt. Ltd., [ 85 ]


ARM7 LPC2148 STARTER KIT VSK-2148

REVISED PROGRAM NO: 4

PWM GENERATION
#include<NXP/iolpc2148.h>
void main(void)
{
PINSEL0 = 0X00008055; // select Port pins p0.2 and p0.3 as i2c configurable and
// also to select pwm2 as output
PWMPR = 0X00000001;
PWMPCR = 0X00000400;
PWMMCR = 0X00000003;
PWMMR0 = 0X00000010;
PWMMR2 = 0X00000008;
PWMTCR = 0X00000002;
PWMTCR = 0X00000009;
while(1);
}

REVISED PROGRAM NO: 5

SENDING MESSAGES TO MAILBOX BY ONE TASK AND READING THE MESSAGE


FROM MAILBOX BY ANOTHER TASK

#include <includes.h>
#if (APP_CFG_PROBE_OS_PLUGIN_EN == DEF_ENABLED)
volatile CPU_INT32U App_ProbeCnts;
volatile CPU_BOOLEAN App_ProbeB1;
volatile CPU_BOOLEAN App_ProbeB2;
volatile CPU_INT16U App_ProbeADC;
#endif
//HEADER FILE DECLARATION
int a=10,b=20,c;
#include <includes.h>
CPU_INT08U Task1Data;
CPU_INT08U Task2Data;
OS_STK Task1stk[100];
OS_STK Task2stk[100];
OS_EVENT *mailbox;
INT8U Error;
void Task1(void *pdata);
void Task2(void *pdata);
//0S TASK STACK ALLOCATION
OS_STK UART_Task1stk[100];
OS_STK UART_Task2stk[100];
OS_STK UART_Task3stk[100];

Vi Microsystems Pvt. Ltd., [ 86 ]


ARM7 LPC2148 STARTER KIT VSK-2148

void Task1(void *pdata)


{
char *msg;
pdata = pdata;
BSP_Init();
for(;;)
{
msg=OSMboxPend(mailbox,0,&Error);
//Task1 never run before task2 is complete the process.
if(Error==OS_NO_ERR)
if(msg!=(void *)0)
{
printf("\n\r Message :\t");
while(*msg!='\0')
{
printf("%c",*msg);
msg++;
}
}
OSTimeDly(1);
}
}
void Task2(void *pdata)
{
c=a+b;
char data[]={" Message from Task2 "};
pdata = pdata;
BSP_Init();
for(;;)
{
Error=OSMboxPost(mailbox,(void *)&data[0]); // Send the Mail to another task
OSTimeDly(1);
}
}

void main (void)


{
BSP_IntDisAll();
BSP_Init();
Arm_Uart0_Init(); // UART0 Initialisation
OSInit();

mailbox=OSMboxCreate ((void *)0); // create mailbox


OSTaskCreate(Task1,(void *)&Task1Data,&Task1stk[99],1);
OSTaskCreate(Task2,(void *)&Task2Data,&Task2stk[99],0);
OSStart();
}
JUMPER AND CONNECTOR DETAILS
Vi Microsystems Pvt. Ltd., [ 87 ]
ARM7 LPC2148 STARTER KIT VSK-2148

1.Jumper Details

J1(Buzzer Supply selection)


Short 1st and 2nd pin for 12v buzzer.
Short 2nd and 3rd pin for 5V buzzer.

J2(Select Type of the 7segment)


Short 1st and 2nd pin for Common Anode seven 7segment.
Short 2nd and 3rd pin for Common Cathode seven 7segment.

J4(select trimmer output to ADC1)


Trimmer output (0-3.3V) analog voltage was read through ADC1 when J4 jumper
closed.

J5(Stepper motor Supply selection)


Short 1st and 2nd pin for select onboard(+5V) supply to stepper motor.
Short 2nd and 3rd pin for External supply(+5V or +12V) to stepper motor.

J6(Temperature Sensor output to ADC1)


Temperature sensor output was read through ADC1 when J6 jumper closed.
In this time J4 jumper must be in open condition.

J7(Pin function selection of Port0.5)


Port0.5 pin was multiplexed for 2 functions.
Short 1st and 2nd pin, Port0.5 connected with stepper motor coil2.
Short 2nd and 3rd pin, Port0.5 connected with SPI0’s MISO.

J8(Pin function selection of Port0.7)


Port0.7 pin was multiplexed for 2 functions.
Short 1st and 2nd pin, Port0.7 connected with stepper motor coil4.
Short 2nd and 3rd pin, Port0.7 connected with SPI0’s SS.

J9(Pin function selection of Port0.4)


Port0.4 pin was multiplexed for 2 functions.
Short 1st and 2nd pin, Port0.4 connected with stepper motor coil1.
Short 2nd and 3rd pin, Port0.4 connected with SPI0’s SCK.

J9(Pin function selection of Port0.6)

Vi Microsystems Pvt. Ltd., [ 88 ]


ARM7 LPC2148 STARTER KIT VSK-2148

Port0.6 pin was multiplexed for 2 functions.


Short 1st and 2nd pin, Port0.6 connected with stepper motor coil3.
Short 2nd and 3rd pin, Port0.6 connected with SPI0’s MOSI.

2.Connector Details Of VSK-2148


The following is a short list of the connectors available in VSK-2148. The sections
below define more on the pin assignment of the connectors listed below. Each signal referred
to below is given in brief description.
P1 - Power Connector
P2 - RS232 serial port connector
UP1 - USB connector for USB to serial converter
P4 - I2C expansion Connector
P5 - PWM & Capture line expansion connector
P3,P6 - Relay Output line expansion connector
P7 - Two channel ADC line expansion connector
P9 - DAC expansion connector
P8 - Stepper Motor External supply connector
P10 - Stepper motor connector
P11 - SPI Expansion connector
P13 - Switch and Keypad Multiplexed connector
P12 - Keypad Line connector
P14 - Switch Line Connector
5pin Unicon Connetcor(P1)
Signal Description
Pin Details
1 GND
2 -12V
3 +12V

5 Vcc

Vi Microsystems Pvt. Ltd., [ 89 ]


ARM7 LPC2148 STARTER KIT VSK-2148

Serial Port Connector(P2)


Connector Type : 9 Pin ‘D’ Male straight
Signal Description

Pin Details
1 NC
2 RxD
3 TxD
4 NC
5 GND
6 NC
7
8
9 NC
USB Connector(UP1)
Connector Type : USB B type Right Angled Connector.
Pin # Signal Name
1 +5V_USB
2 USB_D-
3 USB_D+
4 GND

I2C Expansion Connector(P4)


Connector Type : 2 Pin RMC connector.

Pin # Signal Name


1 SCL
2 SDA

Vi Microsystems Pvt. Ltd., [ 90 ]


ARM7 LPC2148 STARTER KIT VSK-2148

PWM and Capture Line Expansion Connector(P5)


Connector Type : 3 Pin RMC connector.

Pin # Signal Name


1 PWM
2 Capture
3 Ground
Relay1 Output Line Expansion Connector(P3)
Connector Type : 3 Pin J801 connector(Screw type).

Pin # Signal Name


1 Common Line

2 NC(Normally closed line)


3 NO(Normally opened line)

Relay2 Output Line Expansion Connector(P6)


Connector Type : 3 Pin J801 connector(Screw type).

Pin # Signal Name


1 Common Line

2 NC(Normally closed line)


3 NO(Normally opened line)

Stepper Motor External Supply Connector(P8)


Connector Type : 2 Pin J801 connector(Screw type).
Pin # Signal Name
1 External VCC
2 Ground

Two Channel ADC Line Expansion Connector(P7)


Connector Type : 3Pin J801 connector(Screw type).

Pin # Signal Name


1 ADC2
2 ADC3
3 Analog Ground

Vi Microsystems Pvt. Ltd., [ 91 ]


ARM7 LPC2148 STARTER KIT VSK-2148

DAC Expansion Connector(P9)


Connector Type : 2 Pin J801 connector(Screw type).
Pin # Signal Name
1 AOUT(DAC0)
2 Analog Ground

Stepper Motor Connector(P10)


Connector Type : 5 Pin RMC connector.

PinNo Signal Name


1 Coil1
2 Coil2
3 Coil3
4 Coil4
5 Motor VCC

SPI Expansion Connector(P11)


Connector Type : 5 Pin RMC connector.

PinNo Signal Name


1 SCK0
2 MISO0
3 MOSI0
4 SS
5 +3.3V

Switch & Keypad Multiplexed Connector(P13)


Connector Type : 10 Pin Box Type connector.
P.No Signal Name P.No Signal Name
1 Keypad1/Switch0 2 Keypad5/Switch4
3 Keypad2/Switch1 4 Keypad6/Switch5
5 Keypad3/Switch2 6 Keypad7/Switch6
7 Keypad4/Switch3 8 Keypad8/Switch7
9 No Connection 10 No Connection

Vi Microsystems Pvt. Ltd., [ 92 ]


ARM7 LPC2148 STARTER KIT VSK-2148

Keypad Line Connector(P12)


Connector Type : 10 Pin Box Type connector.
P.No Signal Name P.No Signal Name
1 Keypad1 2 Keypad5
3 Keypad2 4 Keypad6
5 Keypad3 6 Keypad7
7 Keypad4 8 Keypad8
9 No Connection 10 No Connection

Switch Line Connector(P14)


Connector Type : 10 Pin Box Type connector.

P.No Signal Name P.No Signal Name


1 Switch0 2 Switch4
3 Switch1 4 Switch5
5 Switch2 6 Switch6
7 Switch3 8 Switch7
9 No Connection 10 No Connection

Vi Microsystems Pvt. Ltd., [ 93 ]


ARM7 LPC2148 STARTER KIT VSK-2148

CIRCUIT DIAGRAM

Vi Microsystems Pvt. Ltd., [ 94 ]


ARM7 LPC2148 STARTER KIT VSK-2148

Vi Microsystems Pvt. Ltd., [ 95 ]


ARM7 LPC2148 STARTER KIT VSK-2148

Vi Microsystems Pvt. Ltd., [ 96 ]


ARM7 LPC2148 STARTER KIT VSK-2148

Vi Microsystems Pvt. Ltd., [ 97 ]


ARM7 LPC2148 STARTER KIT VSK-2148

Vi Microsystems Pvt. Ltd., [ 98 ]


ARM7 LPC2148 STARTER KIT VSK-2148

Vi Microsystems Pvt. Ltd., [ 99 ]


ARM7 LPC2148 STARTER KIT VSK-2148

Vi Microsystems Pvt. Ltd., [ 100 ]


ARM7 LPC2148 STARTER KIT VSK-2148

Vi Microsystems Pvt. Ltd., [ 101 ]


ARM7 LPC2148 STARTER KIT VSK-2148

Vi Microsystems Pvt. Ltd., [ 102 ]

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy