Download as pdf or txt
Download as pdf or txt
You are on page 1of 8

ADVANCED RISE MACHINE (LPC2148)

INTRODUCTION:
 flash memory ranging from 32 kB to 512 Kb.

 serial communications interfaces ranging from a USB 2.0


Full Speed device, multiple UARTs, SPI, SSP to I2Cs.
 on-chip SRAM of 8 kB up to 40 kB.

 32-bit timers, single or dual 10-bit ADC(s),10-bit DAC,


PWM channels and 45 fast GPIO lines.
 The standard 32-bit ARM instruction set.

 A 16-bit THUMB instruction set.


PIN DIAGRAM:
INSTRUCTIONS:
 PINSEL //Pin function Selection
 PINSEL0 //Two bits for Selecting one pin Operation
 PINSEL1
 PINSEL2
 IODIR //Choose Input or Output
 IODIR0 //Single bit for Single Pin
 IODIR1
 IOSET //Set the Pin to High
 IOSET0 //Single bit for Single Pin
 IOSET1
 IOCLR //Set the Pin to Low
 IOCLR0 //Single bit for Single Pin
 IOCLR1

 IOPIN //Status of the Pin


 IOPIN0 //Single bit for Single Pin
 IOPIN1
Ex.Program(Digital Output Control)
#include<LPC214X.H> //Header File

void delay_fun(unsigned int delay) //Delay Function


{
while(delay--);
}
int main()
{
PINSEL0=0X00000000; //Pin selection for Normal or Special Function
IODIR0=0X0000FFFF; //Set the Pin for Input or Output
IOCLR0=0X0000FFFF; //Clear the Pins
while(1)
{
IOSET0=0X00000001; //Set the pins
delay_fun(65000); //Delay Set for your Requirement

IOCLR0=0X00000001; //Clear the Pins


delay_fun(65000);

}
}
Ex.Program(Digital I/O Control)
#include <LPC214X.H> //Header File
#define led 1<<0 //Define the pin

int main()
{
IODIR0=0XFFFFFFF0; //Set the Pin for Input or Output
PINSEL0=0X00000000; //Pin selection for Normal or Special Function
IOCLR0=0XFFFFFFF0; //Clear the Pins
while(1)
{
if(IOPIN0&0X00000002) //Check the Pin Status
{ //Condition True loop will be executed
IOSET0=led; //Set the Pin
}
if(IOPIN0&0X00000004) //Check the Pin Status
{ //Condition True loop will be executed
IOCLR0=led; //Set the Pin
}
}
}

You might also like