arm programming (1)

2
LPC2148 Block Diagram………………. LPC214x Pin Diagram……………….. Pin Connect Block Most of the pins on LPC2148 are multiplexed so we can use the same pin for different purpose. Pin connect Block is used to configure the microcontroller pins to the desired function. Configuration registers (PINSEL0, PINSEL1 and PINSEL2) control the multiplexers to allow connection between the pin and the on chip peripherals. LPC214x User Manual PAGE 75 for table General Purpose Input/Output LPC2148 has two ports P0 32 Pins and P1 16 Pins and can be operated in two modes legacy mode and fast GPIO mode. Legacy / slow GPIO mode is the general way of usage and has backward compatibility with earlier family devices. The register set used are IOPIN, IOSET, IOCLR and IODIR. Gen. Name Description Access PORT0 PORT1 IOPIN To read the current state of the PIN regardless of pin direction R/W 0xE002 8000 IO0PIN 0xE002 8010 IO1PIN IODIR Controls the direction of pin R/W 0xE002 8008 IO0DIR 0xE002 8018 IO1DIR IOSET Writing 1’s sets the port pins R/W 0xE002 8004 IO0SET 0xE002 8014 IO1SET

Upload: crsarin

Post on 18-Nov-2015

213 views

Category:

Documents


1 download

DESCRIPTION

kljljlljlj

TRANSCRIPT

LPC2148 Block Diagram.LPC214x Pin Diagram..Pin Connect BlockMost of the pins on LPC2148 are multiplexed so we can use the same pin for different purpose. Pin connect Block is used to configure the microcontroller pins to the desired function.Configuration registers (PINSEL0, PINSEL1 and PINSEL2) control the multiplexers to allow connection between the pin and the on chip peripherals.

LPC214x User Manual PAGE 75 for tableGeneral Purpose Input/Output LPC2148 has two ports P0 32 Pins and P1 16 Pins and can be operated in two modes legacy mode and fast GPIO mode.Legacy / slow GPIO mode is the general way of usage and has backward compatibility with earlier family devices. The register set used are IOPIN, IOSET, IOCLR and IODIR. Gen. NameDescriptionAccessPORT0PORT1

IOPINTo read the current state of the PIN regardless of pin directionR/W0xE002 8000

IO0PIN0xE002 8010

IO1PIN

IODIRControls the direction of pinR/W0xE002 8008

IO0DIR0xE002 8018

IO1DIR

IOSETWriting 1s sets the port pinsR/W0xE002 8004

IO0SET0xE002 8014

IO1SET

IOCLRWriting 1s clear the port pinsR/W0xE002 800C

IO0CLR0xE002 801C

IO1CLR

Enhanced / Fast GPIO mode is the new feature available in LPC214x family controllers. FIODIR, FIOMASK, FIOPIN, FIOSET, FIOCLR and FIODIR. All of these registers are located directly on the local bus of the CPU for

the fastest possible read and write timing.A mask register allows treating groups of bits in a single GPIO port separately from other bits on the same port.Writing 0 on MASK register gives access to that bit.