Microcontrollers[BCS402]

SYLLABUS

LPC_2148_EMBEDDED_SYSTEM







The LPC2148 microcontrollers are based on a 32-bit ARM7TDMI-S CPU with real-time emulation and embedded trace support, that combine microcontroller with embedded high-speed flash memory ranging from 32 kB to 512 kB. A 128-bit wide memory interface and a 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. Serial communications interfaces ranging from a USB 2.0 Full-speed device, multiple UARTs, SPI, SSP to I 2 C-bus 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 suitable for industrial control and medical systems.
The meaning of LPC is Low Power Low Cost microcontroller. This is 32 bit microcontroller manufactured by Philips semiconductors (NXP) .
Features of ARM Microcontroller
  •  16-bit/32-bit ARM7TDMI-S microcontroller in a tiny LQFP64 package.
  •  8 kB to 40 kB of on-chip static RAM and 32 kB to 512 kB of on-chip flash memory; 128-bit wide interface/accelerator enables high-speed 60 MHz operation.
  • In-System Programming/In-Application Programming (ISP/IAP) via on-chip boot loader software, single flash sector or full chip erase in 400 ms and 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 2kB of endpoint RAM. In addition, the LPC2148 provides 8 kB of on-chip RAM accessible to USB by DMA.
  • One or two (LPC2141/42 vs, LPC2144/46/48) 10-bit ADCs provide a total of 6/14 analog inputs, with conversion times as low as 2.44 ms per channel.
  •  Single 10-bit DAC provides variable analog output (LPC2148 only)
  •  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 (RTC) with independent power and 32 kHz clock input. 
  • Multiple serial interfaces including two UARTs , two Fast I2C-bus (400 kbit/s),SPI and SSP with buffering and variable data length capabilities. 
  • Vectored Interrupt Controller (VIC) with configurable priorities and vector addresses. 
  • Up to 45 of 5 V tolerant fast general purpose I/O pins in a tiny LQFP64 package. 
  • Up to nine edge or level sensitive external interrupt pins available. 
  • 60 MHz maximum CPU clock available from programmable on-chip PLL with settling time of 100 ms.
  • 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 or BOD. 
  • Single power supply chip with POR and BOD circuits
 CPU operating voltage range of 3.0 V to 3.6 V (3.3 V ± 10 %) with 5 V tolerant I/O.

BLOCK DIAGRAM
LPC2148 Pin Diagram


DATA SHEET FOR LPC 2148 CLICK Here: DATASHEET_LPC2148
USER MANUAL FOR ALS-SDA-ARM7-06



Introduction

General-purpose input/output (GPIO) is a pin on an IC (Integrated Circuit). It can be either input pin or output pin, whose behaviour can be controlled at the run time. A group of these pins is called a port (Example, Port 0 of LPC2148 has 32 pins).
LPC2148 has two 32-bit General Purpose I/O ports.
1.  PORT0
2.  PORT1
PORT0 is a 32-bit port
  • Out of these 32 pins, 28 pins can be configured as either general purpose input or output.
  • 1 of these 32 pins (P0.31) can be configured as general-purpose output only.
  • 3 of these 32 pins (P0.24, P0.26 and P0.27) are reserved. Hence, they are not available for use. Also, these pins are not mentioned in pin diagram.
PORT1 is also a 32-bit port. Only 16 of these 32 pins (P1.16 – P1.31) are available for use as general-purpose input or output.
Almost every pin of these two ports has some alternate function available. For example, P0.0 can be configured as the TXD pin for UART0 or as PWM1 pin as well. The functionality of each pin can be selected using the Pin Function Select Registers.

Note : The Port 0 pins do not have built-in pull-up or pull-down resistors. Hence, while using GPIOs on Port 0, in some cases,  we need to connect pull-up or pull-down resistors externally.

Fast and Slow GPIO Registers

There are 5 Fast (also called Enhanced GPIO Features Registers) GPIO Registers and 4 Slow (also called Legacy GPIO Registers) GPIO Registers available to control PORT0 and PORT1.
The Slow Registers allow backward compatibility with earlier family devices using the existing codes.

Slow GPIO Registers
There are 4 Slow GPIO registers :
1.  IOxPIN (GPIO Port Pin value register): This is a 32-bit wide register. This register is used to read/write the value on Port (PORT0/PORT1). But care should be taken while writing. Masking should be used to ensure write to the desired pin.
                  Examples :
                  a) Writing 1 to P0.4 using IO0PIN
                       IO0PIN = IO0PIN | (1<<4)
                  b) Writing 0 to P0.4 using IO0PIN
                       IO0PIN = IO0PIN & (~(1<<4) )
                  c) Writing F to P0.7-P0.4
                       IO0PIN = IO0PIN | (0x000000F0)

2.  IOxSET (GPIO Port Output Set register) : This is a 32-bit wide register. This register is used to make pins of Port (PORT0/PORT1) HIGH. Writing one to specific bit makes that pin HIGH. Writing zero has no effect.

3.  IOxDIR (GPIO Port Direction control register) : This is a 32-bit wide register. This register individually controls the direction of each port pin. Setting a bit to ‘1’ configures the corresponding pin as an output pin. Setting a bit to ‘0’ configures the corresponding pin as an input pin.

4.  IOxCLR (GPIO Port Output Clear register) : This is a 32-bit wide register. This register is used to make pins of Port LOW. Writing one to specific bit makes that pin LOW. Writing zeroes has no effect.
                  Examples :
                  a)  Configure pin P0.0 to P0.3 as input pins and P0.4 to P0.7 as output pins.
                        IO0DIR = 0x000000F0;
                  b)  Configure pin P0.4 as an output. Then set that pin HIGH.
                        IO0DIR = 0x00000010; OR IO0DIR = (1<<4);
                        IO0SET = (1<<4);
                  c)  Configure pin P0.4 as an output. Then set that pin LOW.
                        IO0DIR = 0x00000010; OR IO0DIR = (1<<4);
                        IO0CLR = (1<<4);


About Keil - CLICK HERE   KEIL_Intro
About Assembly Code Click here- arm assembly
Steps to execute ARM assembly programs Click here-  Video_Steps
Some Programs- Example Programs for Practice

PART A: ASSEMBLY PROGRAMS

PART B: INTERFACING PROGRAMS


Wheel Game For Instruction: https://pickerwheel.com/pw?id=BAgzT







NEW FEATURES ADDED TO MY APP DOWNLOAD APP BY CLICKING LINK





No comments:

Post a Comment