Unit-II CIP51 Architecture
Unit-II CIP51 Architecture
CIP-51 Architecture
CIP-51 Architecture
• Reset sources
• Oscillator options
• Port structure
• Timers
• Timer programming
• Interrupt handler
• Power management modes
Microcontroller Components
Typical Structure diagram of C8051F34X Family
On-Chip Memory Map for 64 KB C8051F34x MCUs
C8051F34X MEMORY
There are two separate memory spaces: program memory (ROM or FLASH) and data memory (RAM).
Program Memory
The C8051F340 CPU has a 64 KB FLASH memory in system programming. The C8051F340
implements 64k of this program memory space as in-system, re-programmable Flash memory. Note
that on the 64k versions of the C8051F340/2/4/6, addresses above 0xFBFF are reserved.
Data Memory
The C8051F34X CPU includes 256 of internal RAM mapped into the data memory space from 0x00 through
0xFF. The lower 128 bytes of data memory are used for general purpose registers (SFR) and temporary storage.
Either direct or indirect addressing may be used to access the lower 128 bytes of data memory. Locations 0x00
through 0x1F are addressable as four banks of general purpose registers, each bank consisting of eight byte-wide
registers. The next 16 bytes, locations 0x20 through 0x2F, may either be addressed as bytes or as 128 bit locations
accessible with the direct addressing mode.
The upper 128 bytes of data memory are accessible only by indirect addressing. This region occupies the same
address space as the SFR, but is physically separate from the SFR space. The addressing mode used by an
instruction when accessing locations above 0x7F determines whether the CPU accesses the upper 128 bytes of
data memory space or the SFRs. Instructions that use direct addressing will access the SFR space.
Instructions using indirect addressing above 0x7F access the upper 128 bytes of data memory.
C8051F34X MEMORY
Special Function Registers (SFR)
The direct addressing memory spaces from 80H to FFH constitute SFRs; The SFRs
provide control of the resources and peripherals of the C8051F34X family of single-
chip microcomputer.
In addition to the 21 SFR in standard 8051, the C8051F34X family adds some SFR
to configure and access proprietary subsystems.
Use of Flash for programming
• All modern microcontrollers have volatile (SRAM) memory and non-volatile, reprogrammable flash
memory. The flash memory contains the code, so no external integrated circuits are needed.
• The flash memory can be reprogrammed by special programming devices using a few (from 2 to 6-
8) pins of the microcontroller (in-circuit programming, JTAG) or can even be overwritten by the
microcontroller itself in some cases.
• Additional separate flash or EEPROM may also be integrated to support non-volatile data storage
(configuration data, calibration data, statistical data, etc.).
• The flash memory can be rewritten about 100000 times, and the typical data retention time is
longer than 20 years. The flash memory can be protected, i.e., the code can be prevented from being
read by the user.
Processor Support Peripherals
• Power on reset (POR) generator. After switching the power on, the supply voltage may rise a bit
slowly due to the fact that the supply decoupling and filtering capacitors must be charged and the
supply current is limited. At the same time, the digital circuitry needs a certain minimum supply
voltage for proper operation, so the start-up of the microcontroller must be delayed until the supply
voltage reaches the safe operating level. Having detected the crossing of this level, the POR
generates an additional short delay
• Power supply monitor (Brown-out detector). In some cases, the supply voltage may go below the
safe operating level even during operation (for example, when sudden heavy current loading
occurs). This may result in erroneous code execution, therefore the supply monitor circuit will
generate a reset in this case.
• Watchdog timer (WDT). Even properly powered processors can fall into infinite loops or get
disturbed by electromagnetic or conducted interference (for example, in the case of lightning or
power line transients), which may cause serious problems in several applications (motor control,
heating control, healthcare devices, etc.).
• The watchdog timer refresh register needs to be written within a certain amount of time (that can be
typically programmed from tens of milliseconds to several seconds); otherwise, a reset will be
generated.
• Oscillator, PLL. All processors need a clock signal to schedule instruction execution. Modern
microcontrollers have on-chip oscillators but also support the use of external quartz crystals or
external clock signals. Optional phase-locked loop (PLL) clock multipliers often combined with clock
dividers allow the generation of a wide range of higher processor clock frequencies.
C8051C340 Reset Sources
Reset sources
Reset circuitry allows the controller to be easily placed in a
predefined default condition. On entry to this reset state, the
following occur:
❖ CIP-51 halts program execution
❖ Special Function Registers (SFRs) are initialized to their defined
reset values
❖External Port pins are forced to a known state(Ports=0xFF)
❖ Interrupts and timers are disabled
❖Contents of internal data memory are unaffected
Reset sources
• Power-On Reset (POR)
• Power-Fail Reset / VDD Monitor
• External Reset
• Missing Clock Detector Reset
• Comparator0 Reset
• PCA Watchdog Timer Reset
• Flash Error Reset
• Software Reset
• USB Reset
Each reset source except for the POR, Reset Input Pin, or Flash error may be disabled by
the user in software.
The WDT may be permanently enabled in software after a power-on reset during MCU
initialization.
Reset sources
SFR: RSTSRC- Reset Source Register
•The choice of the clock source is often configured through the device configuration registers.
Frequency Control:
•The oscillator subsystem allows you to control the frequency of the clock signal. This can be crucial for power
management and adjusting the performance of the microcontroller to meet the application's requirements.
•Frequency control may involve setting the oscillator to run at a specific frequency or configuring it to change
dynamically based on the system's needs.
Crystal Oscillator:
The C8051F340 supports an external crystal oscillator for more accurate and stable clock generation. This is commonly
used when precise timing is required in applications.
The crystal oscillator is connected to the microcontroller's crystal pins, and its frequency is typically specified by the
crystal used.
Low-Frequency Oscillator (LFO):
Some microcontrollers, including the C8051F340, may include a low-frequency oscillator for low-power modes. This
oscillator provides a clock source during low-power states to keep certain functions active while the main oscillator is
turned off.
PLL (Phase-Locked Loop):
The C8051F340 may include a PLL for frequency multiplication. The PLL can be used to generate higher-frequency clock
signals from a lower-frequency reference, providing flexibility in achieving desired operating frequencies.
Clock Divider:
The oscillator subsystem may also include a clock divider that allows you to further divide the clock frequency to achieve
specific timing requirements or to reduce power consumption.
Oscillator Fail-Safe: Some microcontrollers, including the C8051F340, may incorporate features such as oscillator fail-safe
mechanisms. These features ensure that the microcontroller can detect and respond to issues with the oscillator to
prevent system malfunctions.
Oscillator options
Four Oscillator options
• 4x Clock Multiplier.
Oscillator Diagram
Task of oscillator subsystem is to
generate stable clock signal
• System Clock
• USB Clock
Oscillator Registers
Register Name Short form Function
Programmable Internal High OSCICN Default value after reset 12MHz/8 bit.,
Frequency Oscillator control
Register (Internal H-F The internal oscillator period can be programmed
Oscillator Control) via the OSCICL register
Internal High Frequency OSCICL Decides Oscillator Period. Setting OSCCAL bits to
Oscillator Calibration 00000b oscillator operates at its fastest setting.
When set to 11111b the oscillator operates at
slowest setting. The contents of this register are
factory calibrated to produce 12MHz internal
oscillator frequency.
Programmable Internal Low OSCLCN Operates at nominal frequency of 80 KHz can be
Frequency (L-F) Oscillator Control divided by 1,2,4,8
Register
System Clock Selection Register CLKSEL First three bits select system clock source
SFR: CLKSEL - Clock Select(Bit 7-Bit 4)
• The system clock (SYSCLK) can be derived from either of the internal
oscillators, the external oscillator circuit, or the 4x Clock Multiplier divided
by 2.
• The USB clock (USBCLK) can be derived from the internal oscillator,
external oscillator, or 4x Clock Multiplier.
SFR: OSCICN - Internal H-F Oscillator Control
SFR: OSCLCN- Internal L-F Oscillator Control
Oscillator Programming Setting high frequency clock to 12MHz
1 1 1
C8051C340 Port Structure
Port structure of C8051F340
Ports are represented by registers inside the microcontroller, and
allow the program (firmware) to control the state of the pins, or
conversely, read the state of the pins if they are configured as
inputs. There is a one-to-one correspondence between the pins on
the microcontroller and the bits in its registers.
• Five ports - P0 to P4 (8 bit each) – 40 Pins GPIO
• Solution: Pick and choose the peripherals that are necessary for an application, and assign only
those to external pins
• This is the function of the crossbar
• Based on the application, the system designer makes the decision as to which peripherals are
enabled, and which pins are used
• The C8051F340 has a rich set of digital resources like UARTs, system management bus (SMBus),
timer control inputs and interrupts
• These peripherals do not have dedicated pins through which they may be accessed
• They are available through the four lower I/O ports (P0, P1, P2 and P3)
• Each of the pins on P0, P1, P2 and P3 can be defined as a general purpose input/output
(GPIO) pin or can be assigned to a digital peripheral
• Lower ports have dual functionalities
• This flexibility makes the MCU very versatile
Crossbar Pin Assignment and Allocation of Priority
• The crossbar has a priority order in which peripherals are assigned to pins
• UART0 has the highest priority and UART1 has the lowest priority
• There are three configuration registers, XBR0, XBR1 and XBR2, which are
programmed to accomplish the pin allocations
• If the corresponding enable bits of the peripheral are set to a logic 1 in the crossbar registers,
then the port pins are assigned to that peripheral
• Pin assignments to associated functions are done in groups
• For example, TX0 and RX0 for UART0 are assigned together
• Example: If the UART0EN bit (XBR0.0) is set to logic 1, the TX0 and RX0 pins will be
mapped to the port pins P0.4 and P0.5, respectively.
• Since UART0 has the highest priority, its pins will always be mapped to P0.4 and
P0.5 when UART0EN is set to logic 1 and will have precedence over any other
peripheral allocation
• Registers XBR0 and XBR1
must be loaded with the
appropriate values to
select the digital I/O
functions required by the
design.
• All Port pins must be configured as either analog or digital inputs. Any pins to be used as Comparator or
ADC inputs should be configured as an analog inputs. When a pin is configured as an analog input, its
weak pull-up, digital driver, and digital receiver are disabled.
• To configure a Port pin for digital input, write ‘0’ to the corresponding bit in register PnMDOUT, and write
‘1’ to the corresponding Port latch (register Pn).
• Until the Crossbar is enabled, the external pins remain as standard Port I/O (in input mode), regardless of
the XBRn Register settings.
Port I/O Initialization
Port I/O initialization consists of the following steps:
Step 1. Select the input mode (analog or digital) for all Port pins, using the Port Input Mode register
(PnMDIN).
Step 2. Select the output mode (open-drain or push-pull) for all Port pins, using the Port Output Mode
register (PnMDOUT).
Step 3. Select any pins to be skipped by the I/O Crossbar using the Port Skip registers (PnSKIP).
Step 4. Assign Port pins to desired peripherals (XBR0, XBR1).
Step 5. Enable the Crossbar (XBARE = ‘1’).
General Purpose Port I/O
• Port pins that remain unassigned by the Crossbar and are not used by
analog peripherals can be used for general purpose I/O. Ports 3-0 are
accessed through corresponding special function registers (SFRs) that are
both byte addressable and bit addressable.
• When all of the outputs of the devices connected to the line are in Hi-Z state,
the line is driven to a default logic 1 level by a pull-up.
• Any device can pull the line to logic 0 using its open drain output and all devices
can see this level.
Port structure
• Designer has complete control over which functions are assigned, limited only by
the number of physical I/O pins.
• The Digital Crossbar allows mapping of internal digital system resources to Port
I/O pins. On-chip counter/timers, serial buses, HW interrupts, comparator
outputs, and other digital signals in the controller can be configured to appear on
the Port I/O pins specified in the Crossbar Control registers. This allows the user
to select the exact mix of general purpose Port I/O and digital resources needed for
the end application.
• This resource assignment flexibility is achieved through the use of a Priority
Crossbar Decoder.
• State of a Port I/O pin can always be read in the corresponding Port latch,
regardless of the Crossbar settings.
• The Crossbar assigns the selected internal digital resources to the I/O pins based
on the Priority Decoder
• The registers XBR0, XBR1, and XBR2 defined in SFR definition
• These SFRs used to select internal digital functions
Port I/O -Functional block diagram
Priority Crossbar Decoder
• The Priority Crossbar Decoder assigns a priority to each I/O function, starting at
the top with UART0. When a digital resource is selected, the least-significant
unassigned Port pin is assigned to that resource (excluding UART0, which is
always at pins 4 and 5).
• If a Port pin is assigned, the Crossbar skips that pin when assigning the next
selected resource. Additionally, the Crossbar will skip Port pins whose associated
bits in the PnSKIP registers are set.
• The PnSKIP registers allow software to skip Port pins that are to be used for
analog input, dedicated functions, or GPIO.
Important Note on Crossbar Configuration: If a Port pin is claimed by a peripheral
without use of the Crossbar, its corresponding PnSKIP bit should be set.
The Crossbar must be enabled to use Ports P0, P1, P2, and P3 as standard Port I/O
in output mode. These Port output drivers are disabled while the Crossbar is
disabled.
Port 4 always functions as standard GPIO.
Port I/O Initialization
• Port I/O initialization consists of the following steps:
Step 1. Select the input mode (analog or digital) for all Port pins,
using the Port Input Mode register (PnMDIN).
Step 2. Select the output mode (open-drain or push-pull) for all Port
pins, using the Port Output Mode register (PnMDOUT).
Step 3. Select any pins to be skipped by the I/O Crossbar using the
Port Skip registers (PnSKIP).
Step 4. Assign Port pins to desired peripherals (XBR0, XBR1).
Step 5. Enable the Crossbar (XBARE = ‘1’).
Important points to configure the crossbar
• Analog Input-
Any pins to be used as Comparator or ADC inputs should be configured as an analog
inputs. When a pin is configured as an analog input, its weak pull-up, digital driver,
and digital receiver are disabled. This process saves power and reduces noise on the
analog input.
Additionally, all analog input pins should be configured to be skipped by the Crossbar
(accomplished by setting the associated bits in PnSKIP).
• Digital input-
Port input mode is set in the PnMDIN register, where a ‘1’ indicates a digital input,
and a ‘0’ indicates an analog input.
All pins default to digital inputs on reset.
General Purpose Port I/O
• Port pins that remain unassigned by the Crossbar and are not used by
analog peripherals can be used for general purpose I/O.
• Ports 3-0 are accessed through corresponding special function registers
(SFRs) that are both byte addressable and bit addressable.
• Port 4 uses an SFR which is byte-addressable.
• When writing to a Port, the value written to the SFR is latched to
maintain the output data value at each pin.
• When reading, the logic levels of the Port's input pins are returned
regardless of the XBRn settings
Port0 Latch
Port0 Input Mode
Port0 Output Mode
Port0 Skip
Port SFRs
• Port 0 to Port 3
Portx Latch
Portx Input Mode
Portx Output Mode
Portx Skip
}
Interfacing of LED, Relay, Buzzer, Switch
Interfacing Diagram
Hardware board connections for LED , Relay, Buzzer
if(KEY2 == 0)
{
break;
}
Program….
while(1)
{
if(KEY2 == 0) /* Key2 pressed*/
{
while(1)
{
LED = 0xFF;
RELAY = 1; /* LED, Relay, Buzzer OFF */
BUZZER = 0;
if(KEY1 == 1)
{
break;
}
}
}
LCD Interfacing
• E – Enable
• Used to latch the data present on the data pins. A High to low pulse is required on Enable line
• D0 – D7
• Bi-directional data/command pins.
• Alphanumeric characters are sent in ASCII format.
• After writing to the LCD, it takes some time for it to complete its internal operations. During this time, it will
not accept any new commands or data.
• We need to insert time delay between any two commands or data sent to LCD
Command Codes
Interfacing Diagram
E communications
Microcontroller bus
R/W
RS
DB7–DB0
8
LCD
controller
LCD Module
Interfacing Diagram
Program for LCD (8-bit mode)
{
LCD_RS = 1;
LCD_RW = 0;
P2 = character;
LCD_EN = 1;
Delay(15);
LCD_EN=0;
}
Unit-III
DSO
DAC Calculations
Converting Digital Input to Analog Output
• Equation for converting Digital Input into its equivalent Analog output
is,
• Square
• Triangular
• Sawtooth
• Trapezoidal Wave
• Sine
Square Wave
FFH
00H
void DelayMs(unsigned int Ms)
#include "c8051F340.h"
void DelayMs(unsigned int Ms); {
void main() unsigned int n;
{ unsigned int i;
P4MDOUT = 0xFF; /* All P4 pins configured as
Output*/ for (n=0; n < Ms; n++)
while(1) {
{
for (i=0; i < 165; i++);
P4 = ~P4;
DelayMs(10); }
} }
}
Triangular Wave #include "c8051F340.h"
int main()
{
P4MDOUT = 0xFF; // All data lines Output
int i;
255 255
while (1)
{
for (i = 0; i =< FE; i++)
0 0 0 {
P4 = i;
}
for (i = FF; i > 0; i--)
{
P4 = i;
}
}
}
#include "c8051F340.h"
Sawtooth Wave int main()
{
P4MDOUT = 0xFF; // All data lines Output
int i;
255 255 while (1)
{
for (i = 0; i =< FE; i++)
0 0 0 {
P4 = i;
}
}
}
Trapezoidal Wave
255
Complete program of it as
Homework
0
Generating a Sine Wave
180o
0o 90o 360o
Generating a Sine Wave
• We first need a table whose values represent the magnitude of the sine of
angles between 0 and 360 degrees
• The table values are integer numbers representing the voltage magnitude
for the sine of theta
• This method ensures that only integer numbers are output to the DAC by
the 8051 microcontroller
• Full-scale output of the DAC is achieved when all the data inputs of the
DAC are high. Therefore, to achieve the full-scale 10 V output, we use
the following equation:
• To find the value sent to the DAC for various angles, we simply multiply the
Vout voltage by 25.60 because there are 256 steps and full-scale Vout is 10
volts. Therefore, 256 steps /10 V = 25.6 steps per volt.
Angle vs. Voltage Magnitude for Sine Wave
i Angle (ѳ) Sine ѳ Voltage out Vo = 5+(5*Sine ѳ) DAC count =
Vo * 25.6
0 0 0 5 128
1 30 0.5 7.5 192
2 60 0.866 9.33 238
3 90 1.0 10 255
4 120 0.866 9.33 238
5 150 0.5 7.5 192
6 180 0 5 128
7 210 -0.5 2.5 64
8 240 -0.866 0.669 17
9 270 -1.0 0 0
10 300 -0.866 0.669 17
11 330 -0.5 2.5 64
12 360 0 5 128
Waveform
Sine w
Sine wave generation using DACC8051F340
#include "c8051F340.h"
unsigned char x[12] = {128,192,238,255,238,192,128,64,17,0,17,64};
int i;
int main(void)
{
P4MDOUT = 0xFF;
while(1)
{
for(i=0;i<12;i++)
{
P4=x[i]; Note: You should use more samples i.e. higher
} value of i so that you will get smoother wave.
}
}
C8051F340 TIMERS
Difference between Timer and Counter
Counter: Uses External Clock Timer: Uses Internal Oscillator Clock
T0 T1
T0 T1
T2 T3
T2 T3 Fosc
Timers
• Timers are used for: interval timing, event counting or baud rate generation
• In interval timing applications, a timer is programmed to overflow at a regular
interval and the following:
• Set the timer overflow flag or
• Generate an interrupt
• This can also be used to generate waveforms at set frequencies
• Event counting is used to determine the number of occurrences of an event, rather
than to measure the elapsed time between events. In this case, the timer functions
as a counter.
• An “event” is any external stimulus that provides a high-to-low transition at
the selected input pin
• The timers can also function as the baud rate generators for the C8051F340’s
internal serial ports (UART0 and UART1)
• “Baud rate” is the bit rate of the serial port
(the time period of a bit)
Timers
• C8051F340 has four counter/timers: Timer 0, Timer 1,
Timer 2 and Timer 3
• Timer 0 and Timer 1 are nearly identical and have four primary
modes of operation.
• Timer 2 and Timer 3 offer 16-bit and split 8-bit timer functionality
with auto-reload.
TO and T1 Mode 0
• Timer 0 and Timer 1 operate as 13-bit counter/timers in Mode 0.
• The TH0 register holds the eight MSBs of the 13-bit counter/timer. TL0 holds the five LSBs in bit positions
TL0.4-TL0.0.
• The three upper bits of TL0 (TL0.7-TL0.5) are indeterminate and should be ignored.
• As the 13-bit timer register increments and overflows from 0x1FFF (all ones) to 0x0000, the timer overflow
flag TF0 (TCON.5) is set and an interrupt will occur if Timer 0 interrupts are enabled.
• Timer 0 and Timer 1 Modes: Timer 2 Modes: Timer 3 Modes: 13-bit counter/timer 16-bit timer with auto-
reload 16-bit timer with auto-reload 16-bit counter/timer 8-bit counter/timer with auto-reload Two 8-bit timers
with auto-reload Two 8-bit timers with auto-reloadTwo 8-bit counter/timers (Timer 0 only)
• TL1 and TH1 form the 13-bit register for Timer 1 in the same manner as described above for TL0 and TH0.
One of the clock inputs
Timer/ Counter Registers
Description Register Function
Name
Timer Control Register TCON Enables and disables Timer0 and Timer1, Also has overflow flag and
interrupt related bits
Timer Mode Register TMOD Selects the timer or counter operation with C/T0 and C/T1 bits, Also
has mode selection for timer0 and timer1
Clock Control CKCON Controls clock supplied to timer0 and timer 1 if configured to use
prescaled clock inputs, or system clock
Timer 0 low byte TL0 Lower byte of timer0
Timer 0 high byte TH0 Higher byte of timer0
• TH0 and TL0 holds the count. When the count in TH0 and TL0 overflows
from all ones to 0x00, the timer overflow flag is set. The count in TH0 and
TL0 should be loaded for next iteration.
• If Timer 0 interrupts are enabled, an interrupt will occur when the TF0
flag is set. The count in TH0 and TL0 should be loaded for next iteration.
T0 Mode 1 Block Diagram
1
Timer 0 & 1 Mode 2: 8bit Counter/Timer with Auto-Reload
• Mode 2 configures Timer 0 and Timer 1 to operate as 8-bit
counter/timers with automatic reload of the start value.
• TL0 holds the count and TH0 holds the reload value. When the counter
in TL0 overflows from all ones to 0x00, the timer overflow flag TF0
(TCON.5) is set and the counter in TL0 is reloaded from TH0.
• Timer 1 in mode 1
• Timer 1 in mode 2
• Timer 0 in mode 1
• Timer 0 in mode 2
• Timer 1 in mode 2 and Timer 0 in mode 1
Configure TMOD register for the following:
• Timer 0 in mode 1 - 0x01H
Gate1 C/T1 T1M1 T1M0 Gate0 C/T0 T0M1 T0M0
0 0 0 0 0 0 0 1
• Timer 1 in mode 2 –?
• Timer 0 in mode 2 –?
• Timer 1 in mode 2 and Timer 0 in mode 2 – ?
Gate1 C/T1 T1M1 T1M0 Gate0 C/T0 T0M1 T0M0
Time Delay Calculations – For Mode 1
Time period of 1clock cycle = (1/SystemClock)
Delay Required=
3mSec
Procedure for Time to Count Calculation– For Mode 2
Time period of 1clock cycle = (1/SystemClock)
• Software Interrupt
A software interrupt is caused either by an exceptional condition or a special
instruction in the instruction set which causes an interrupt when it is
executed by the processor. For example, if the processor's arithmetic logic
unit runs a command to divide a number by zero, to cause a divide-by-zero
exception, thus causing the computer to abandon the calculation or display
an error message. Software interrupt instructions work similar to subroutine
calls.
What is Polling?
• The (sub) program that deals with an interrupt is called an interrupt service
routine (ISR) or interrupt handler
Interrupt Service Routine
• The ISR executes, performs the desired operation, and terminates with a “return
from interrupt” (RETI) instruction
• The RETI instruction is different from the normal “RET” instruction
• Starts to execute the interrupt service routine until RETI (return from interrupt).
• Upon executing the RETI the microcontroller returns to the place where it was
interrupted. Get pop PC from stack
Execution Flow Reset
Push PC
on Stack
Execute Push
Main Code Registers
on Stack
Timer Overflow
Interrupt Occurs
At This Time Execute
ISR Code
Pop
Registers
from Stack
Continue to
Execute Pop PC
Main Code from Stack
Interrupt handler
• Interrupt handler provides 16 interrupt sources into the CIP-51, allowing
numerous analog and digital peripherals to interrupt the controller.
• Upon Reset, all the interrupts are disabled even if they are
activated. The interrupts must be enabled using software in
order for the microcontroller to respond to those interrupts.
1. Idle
2. Stop.
Power Control Register (PCON)
Power Control Register (PCON) is used to control the CIP-51's
power management modes.
SFR Definition PCON: Power Control
Idle mode
• Idle mode-
• Halts the CPU
• internal registers and memory maintain their original data
• Peripherals and clocks active.
• Setting the Idle Mode Select bit (PCON.0) causes the CIP-51 to halt the
CPU and enter Idle.
• Idle mode is terminated when an enabled interrupt is asserted or a
reset occurs. The assertion of an enabled interrupt will cause the Idle
Mode Selection bit (PCON.0) to be cleared and the CPU to resume
operation.
• If enabled, the Watchdog Timer (WDT) will eventually cause an
internal watchdog reset and thereby terminate the Idle mode.
Stop mode
• CPU is halted
• All interrupts inactive
• Internal oscillator is stopped
• All digital & analog peripherals stopped
• External oscillator circuit is not affected
• Setting the Stop Mode Select bit (PCON.1) causes the CIP-51 to enter Stop mode as soon
as the instruction that sets the bit completes execution.
• Stop mode can only be terminated by an internal or external reset.
• If enabled, the Missing Clock Detector will cause an internal reset and there by terminate
the Stop mode.
• The Missing Clock Detector should be disabled if the CPU is to be put to in STOP mode
for longer than the MCD timeout of 100 μsec
Reference
Datasheet:
https://www.silabs.com/documents/public/datasheets/C8051F34x.pdf