Unit_2 Embproc Jsw
Unit_2 Embproc Jsw
NXP LPC2148
LPC2148 development board
Bus Structure
In LPC2148 three types of buses are used to
connect the core with other peripherals on chip.
The PLL is enabled by software only. The program must configure and activate the PLL,
wait for the PLL to Lock, then connect to the PLL as a clock source.
PLL Registers
PLLCON
• The PLLCON register contains the bits that enable and connect the PLL.
• Enabling the PLL allows it to attempt to lock to the current settings of the
multiplier and divider values.
• Connecting the PLL causes the processor and all chip functions to run from
the PLL output clock.
• Changes to the PLLCON register do not take effect until a correct PLL feed
sequence has been given
• The PLL must be set up, enabled, and Lock established before it may be
used as a clock source.
• When switching from the oscillator clock to the PLL output or vice versa,
internal circuitry synchronizes the operation in order to ensure that glitches
are not generated.
PLLCFG
• The PLLCFG register contains the PLL multiplier and divider values.
• Changes to the PLLCFG register do not take effect until a correct PLL
feed sequence has been given.
PLLSTAT
• The read-only
PLLSTAT register
provides the actual
PLL parameters that
are in effect at the
time it is read, as
well as the PLL
status.
PLLFEED
• A correct feed sequence must be written to the PLLFEED register in order
for changes to the PLLCON and PLLCFG registers to take effect.
• The feed sequence is:
– 1. Write the value 0xAA to PLLFEED.
– 2. Write the value 0x55 to PLLFEED.
• The two writes must be in the correct sequence, and must be consecutive
APB bus cycles.
• The latter requirement implies that interrupts must be disabled for the
duration of the PLL feed operation.
• If either of the feed values is incorrect, or one of the previously mentioned
conditions is not met, any changes to the PLLCON or PLLCFG register will
not become effective.
VPB Divider(VLSI Peripheral Bus Divider)
• The VPB Divider determines the relationship between the
processor clock (CCLK) and the clock used by peripheral
devices (PCLK).
• The VPB Divider serves two purposes.
– The first is to provides peripherals with desired PCLK via APB bus so
that they can operate at the speed chosen for the ARM processor.
The
– second purpose of the VPB Divider is to allow power savings when an
application does not require any peripherals to run at the full
processor rate.
Now , PLL output clock is given by the
formula: => Frequency from the crystal
FOSC
CCLK = M x FOSC or oscillator(XTAL)/external clock
CCLK = FCCO / (2 x P)
=> Frequency Of The PLL Current
FCCO
CCO output clock is given by: Controlled Oscillator(CCO)
FCCO = CCLK x 2 x P or => PLL output frequency (CPU
CCLK
FCCO = FOSC x M x 2 x P Clock)
• The PLL inputs and settings must meet the following: => PLL Multiplier value from the
M MSEL bits in the PLLCFG
• FOSC is in the range of 10 MHz to 25 MHz.
register
• CCLK is in the range of 10 MHz to Fmax (the
=> PLL Divider value from the PSEL
maximum allowed frequency for the microcontroller P
– determined by the system microcontroller is bits in the PLLCFG register
embedded in).
=> Peripheral Clock which is
• FCCO is in the range of 156 MHz to 320 MHz.
PCLK
derived from CCLK
The Order of setting up PLLs is strictly as follows :
1. Setup PLL
2. Apply Feed Sequence
3. Wait for PLL to lock and then Connect PLL
4. Apply Feed Sequence
Baud rate using UART0
Memory Map
• To access any peripheral
we need its address.
The entire address
space can be divided in
to several sections.
Memory Access Module
The MAM block in the LPC2148 maximizes the
performance of the ARM processor when it is running
code in Flash memory,
Two general methods for achieving code execution
performance.
Using RAM for code execution.
Using Cache memory.
Pin Connect Block
For LPC2000 Series the Bootloader can be activated by maintaining low level on
P0.14 while reset.
Bootloader
ISP
Philips microcontroller have a great feature called ISP
(In System Programming).
It enables the user to flash the microcontroller with an ease. In
LPC2148 the ISP mode can be activated by maintaining low level on
P0.14 while reset.
TIMERS
• A Timer Has A
– Timer Counter(TC) and
– Prescale Register(PR) associated
with it.
Timers
When Timer is Reset and Enabled TC is set to 0
and incremented by 1 every ‘PR+1’ clock cycles.
When it reaches its maximum value it gets reset to
0 and hence restarts counting.