Freelance Electronics Components Distributor
Closed Dec 25th-26th
800-300-1968
We Stock Hard to Find Parts

C8051F321-GMR

Part # C8051F321-GMR
Description 16KB,10ADC,USB,28PIN MCU (LEAD FREE) MLP28 -40 TO 85 DEG.
Category IC
Availability In Stock
Qty 560
Qty Price
1 - 24 $10.41286
25 - 60 $8.28296
61 - 128 $7.80964
129 - 275 $7.25745
276 + $6.46859
Manufacturer Available Qty
SILICON LABS
Date Code: 0603
  • Shipping Freelance Stock: 560
    Ships Immediately



Technical Document


DISCLAIMER: The information provided herein is solely for informational purposes. Customers must be aware of the suitability of this product for their application, and consider that variable factors such as Manufacturer, Product Category, Date Codes, Pictures and Descriptions may differ from available inventory.

C8051F320/1
88 Rev. 1.4
9.3.2. External Interrupts
The /INT0 and /INT1 external interrupt sources are configurable as active high or low, edge or level sensi-
tive. The IN0PL (/INT0 Polarity) and IN1PL (/INT1 Polarity) bit
s in the IT01CF register select active high or
active low; the IT0 and IT1 bits in TCON (Section “19.1. Timer 0 and Timer 1” on page 209) select level or
edge sensitive. The table below lists
the possible configurations.
Active low, edge sensitive Active low, edge sensitive
Active high, edge sensitive
Active high, edge sensi-
tive
Active low, level sensitive Active low, level sensitive
Active high, level sensitive Active high, level sensitive
/INT0 and /INT1 are assigned to Port pins as defined in the IT01CF register (see Figure 9.13). Note that
/INT0 and /INT0 Port pin assignments are independent of any Cros
sbar
assignments. /INT0 and /INT1 will
monitor their assigned Port pins without disturbing the peripheral that was assigned the Port pin via the
Crossbar. To assign a Port pin only to /INT0 and/or /INT1, configure the Crossbar to skip the selected
pin(s). This is accomplished by setting the associated bit in register XBR0 (see Section “14.1. Priority
Crossbar Decoder” on page 128 for complete details on configuring the Crossbar).
IE0 (TCON.1) and IE1 (TCON.3) serve as the interrupt-
pen
ding flags for the /INT0 and /INT1 external
interrupts, respectively. If an /INT0 or /INT1 external interrupt is configured as edge-sensitive, the corre-
sponding interrupt-pending flag is automatically cleared by th
e hardware when the CPU vectors to the ISR.
When configured as level sensitive, the interrupt-pending flag remains logic 1 while the input is active as
defined by the corresponding polarity bit (IN0PL or IN1PL); the flag remains logic 0 while the input is inac-
tive. The external interrupt source must hold the input a
c
tive until the interrupt request is recognized. It
must then deactivate the interrupt request before execution of the ISR completes or another interrupt
request will be generated.
9.3.3. Interrupt Priorities
Each interrupt source can be individually programmed to one of two priority levels: low or high. A low prior-
ity interrupt service routine can be preempted b
y a high priority interrupt. A high priority interrupt cannot be
preempted. Each interrupt has an associated interrupt priority bit in an SFR (IP or EIP2) used to configure
its priority level. Low priority is the default. If two interrupts are recognized simultaneously, the interrupt with
the higher priority is serviced first. If both interrupts have the same priority level, a fixed priority order is
used to arbitrate, given in Table 9.4.
IT0 IN0PL /INT0 Interrupt IT1 IN1PL /INT1 Interrupt
10 10
11 11
00 00
01 01
Rev. 1.4 89
C8051F320/1
9.3.4. Interrupt Latency
Interrupt response time depends on the state of the CPU when the interrupt occurs. Pending interrupts are
sampled and priority decoded each system clock cycle. Therefore, the fastest possible response time is 5
system clock cycles: 1 clock cycle to detect the interrupt and 4 clock cycles to complete the LCALL to the
ISR.
If an interrupt is pending when a RETI is executed, a single instruction is executed before an LCALL
is made to service the pending interrupt. Therefore, the maximum response time for an interrupt (when no
other interrupt is currently being serviced or the new interrupt is of greater priority) occurs when the CPU is
performing an RETI instruction followed by a DIV as the next instruction. In this case, the response time is
18 system clock cycles: 1 clock cycle to detect the interrupt, 5 clock cycles to execute the RETI, 8 clock
cyc
les to complete the DIV instruction and 4 clock cycles to execute the LCALL to the ISR. If the CPU is
ex
ecuting an ISR for an interrupt with equal or higher priority, the new interrupt will not be serviced until the
current ISR completes, including the RETI and following instruction.
Note that the CPU is stalled durin
g Flash write/erase operations and USB FIFO MOVX accesses (see Sec-
tion “12.2. Accessing USB FIFO Space” on page 114). Interrupt service latency
will be increased for inter-
rupts occuring while the CPU is stalled.
The latency for these situations will be determined by the standard
interrupt service procedure (as described above) and the amount of time the CPU is stalled.
Table 9.4. Interrupt Summary
Interrupt Source
Interrupt
Vector
Priority
Order
Pending Flag
Bit addressable?
Cleared by HW?
Enable
Flag
Priority
Control
Reset 0x0000 Top None N/A N/A
Always
Enabled
Always
Highe
st
External Interrupt 0
(/
INT0)
0x0003 0 IE0 (TCON.1) Y Y EX0 (IE.0)
PX0
(IP
.0)
Timer 0 Overflow 0x000B 1 TF0 (TCON.5) Y Y ET0 (IE.1) PT0 (IP.1)
External Interrupt 1
(/
INT1)
0x0013 2 IE1 (TCON.3) Y Y EX1 (IE.2)
PX1
(IP
.2)
Timer 1 Overflow 0x001B 3 TF1 (TCON.7) Y Y ET1 (IE.3) PT1 (IP.3)
UART0 0x0023 4
RI0 (SCON0.0)
TI0 (SCON0.1)
Y N ES0 (IE.4)
PS0
(IP
.4)
Timer 2 Overflow 0x002B 5
TF2H (TMR2CN.7)
TF2L (TMR2CN.6)
Y N ET2 (IE.5) PT2 (IP.5)
SPI0 0x0033 6
SPIF (SPI0CN.7)
WCOL (S
PI0CN.6)
MODF (SPI0CN.5)
RXOVRN
(S
PI0CN.4)
Y N
ESPI0
(IE.6)
PSPI0
(IP
.6)
SMB0 0x003B 7 SI (SMB0CN.0) Y N
ESMB0
(EIE1.0)
PSMB0
(EIP1.0)
USB0 0x0043 8 Special N N
EUSB0
(EIE1.1)
PUSB0
(EIP1.1)
ADC0 Window
Comp
are
0x004B 9
AD0WINT
(A
DC0CN.3)
Y N
EWADC0
(EIE1.2)
PWADC0
(EIP1.2)
C8051F320/1
90 Rev. 1.4
9.3.5. Interrupt Register Descriptions
The SFRs used to enable the interrupt sources and set their priority level are described below. Refer to the
datasheet section associated with a particular on-chip peripheral for information regarding valid interrupt
conditions for the peripheral and the behavior of its interrupt-pending flag(s).
ADC0 Conversion
Complete
0x0053 10 AD0INT (ADC0CN.5) Y N
EADC0
(EIE1.3)
PADC0
(EIP1.3)
Programmable
Counter Array
0x005B 11
CF (PCA0CN.7)
CCFn (PCA0CN.n)
Y N
EPCA0
(EIE1.4)
PPCA0
(EIP1.4)
Comparator0 0x0063 12
CP0FIF (CPT0CN.4)
CP0RIF (CPT0CN.5)
N N
ECP0
(EIE1.5)
PCP0
(EIP1.5)
Comparator1 0x006B 13
CP1FIF (CPT1CN.4)
CP1RIF (CPT1CN.5)
N N
ECP1
(EIE1.6)
PCP1
(EIP1.6)
Timer 3 Overflow 0x0073 14
TF3H (TMR3CN.7)
TF3L (TMR3CN.6)
N N
ET3
(EIE1.7)
PT3
(EIP1.7)
VBUS Level 0x007B 15 N/A N/A N/A
EVBUS
(EIE2.0)
PVBUS
(EIP2.0)
Table 9.4. Interrupt Summary (Continued)
Interrupt Source
Interrupt
Vector
Priority
Order
Pending Flag
Bit addressable?
Cleared by HW?
Enable
Flag
Priority
Control
PREVIOUS2324252627282930313233343536NEXT