PIC18F27J53T-I/SO Microchip Technology, PIC18F27J53T-I/SO Datasheet - Page 85

no-image

PIC18F27J53T-I/SO

Manufacturer Part Number
PIC18F27J53T-I/SO
Description
28-pin, USB, 128KB Flash, 4KB RAM, 12 MIPS, 12-bit ADC, NanoWatt XLP 28 SOIC .30
Manufacturer
Microchip Technology
Series
PIC® XLP™ 18Fr
Datasheets

Specifications of PIC18F27J53T-I/SO

Core Processor
PIC
Core Size
8-Bit
Speed
48MHz
Connectivity
I²C, LIN, SPI, UART/USART, USB
Peripherals
Brown-out Detect/Reset, POR, PWM, WDT
Number Of I /o
22
Program Memory Size
128KB (64K x 16)
Program Memory Type
FLASH
Ram Size
3.8K x 8
Voltage - Supply (vcc/vdd)
2.15 V ~ 3.6 V
Data Converters
A/D 10x10b/12b
Oscillator Type
Internal
Operating Temperature
-40°C ~ 85°C
Package / Case
*
Processor Series
PIC18F
Core
PIC
Data Bus Width
8 bit
Data Ram Size
3.8 KB
Interface Type
I2C, SPI, USART
Maximum Clock Frequency
48 MHz
Number Of Programmable I/os
16
Number Of Timers
8
Operating Supply Voltage
2.15 V to 3.6 V
Maximum Operating Temperature
+ 85 C
Mounting Style
SMD/SMT
Minimum Operating Temperature
- 40 C
Lead Free Status / RoHS Status
Lead free / RoHS Compliant
Eeprom Size
-
Lead Free Status / Rohs Status
 Details
6.1.4.4
Device Resets on stack overflow and stack underflow
conditions are enabled by setting the STVREN bit in
Configuration register 1L. When STVREN is set, a full
or underflow condition sets the appropriate STKFUL or
STKUNF bit and then causes a device Reset. When
STVREN is cleared, a full or underflow condition sets
the appropriate STKFUL or STKUNF bit, but does not
cause a device Reset. The STKFUL or STKUNF bits
are cleared by the user software or a POR.
6.1.5
A Fast Register Stack (FRS) is provided for the
STATUS, WREG and BSR registers to provide a “fast
return” option for interrupts. This stack is only one level
deep and is neither readable nor writable. It is loaded
with the current value of the corresponding register
when the processor vectors for an interrupt. All inter-
rupt sources push values into the Stack registers. The
values in the registers are then loaded back into the
working registers if the RETFIE, FAST instruction is
used to return from the interrupt.
If both low-priority and high-priority interrupts are
enabled, the Stack registers cannot be used reliably to
return from low-priority interrupts. If a high-priority
interrupt occurs while servicing a low-priority interrupt,
the Stack register values stored by the low-priority
interrupt will be overwritten. In these cases, users must
save the key registers in software during a low-priority
interrupt.
If interrupt priority is not used, all interrupts may use the
FRS for returns from interrupt. If no interrupts are used,
the FRS can be used to restore the STATUS, WREG
and BSR registers at the end of a subroutine call. To
use the Fast Register Stack for a subroutine call, a
CALL label, FAST instruction must be executed to
save the STATUS, WREG and BSR registers to the
Fast Register Stack. A RETURN, FAST instruction is
then executed to restore these registers from the FRS.
Example 6-1 provides a source code example that
uses the FRS during a subroutine call and return.
EXAMPLE 6-1:
 2010 Microchip Technology Inc.
CALL SUB1, FAST
SUB1
RETURN FAST
FAST REGISTER STACK (FRS)
Stack Full and Underflow Resets
FAST REGISTER STACK
CODE EXAMPLE
;STATUS, WREG, BSR
;SAVED IN FAST REGISTER
;STACK
;RESTORE VALUES SAVED
;IN FAST REGISTER STACK
Preliminary
PIC18F47J53 FAMILY
6.1.6
There may be programming situations that require the
creation of data structures or look-up tables in program
memory. For PIC18 devices, look-up tables can be
implemented in two ways:
• Computed GOTO
• Table Reads
6.1.6.1
A computed GOTO is accomplished by adding an offset
to the PC. An example is shown in Example 6-2.
A look-up table can be formed with an ADDWF PCL
instruction and a group of RETLW nn instructions. The
W register is loaded with an offset into the table before
executing a call to that table. The first instruction of the
called routine is the ADDWF PCL instruction. The next
executed instruction will be one of the RETLW
instructions that returns the value, ‘nn’, to the calling
function.
The offset value (in WREG) specifies the number of
bytes that the PC should advance and should be
multiples of 2 (LSb = 0).
In this method, only one byte may be stored in each
instruction location, but room on the return address
stack is required.
EXAMPLE 6-2:
6.1.6.2
A better method of storing data in program memory
allows two bytes to be stored in each instruction
location.
Look-up table data may be stored two bytes per
program word while programming. The Table Pointer
(TBLPTR) specifies the byte address, and the Table
Latch (TABLAT) contains the data that is read from the
program memory. Data is transferred from program
memory, one byte at a time.
Table
Section 7.1 “Table Reads and Table Writes”.
ORG
TABLE
read
MOVF
CALL
nn00h
ADDWF
RETLW
RETLW
RETLW
.
.
.
LOOK-UP TABLES IN PROGRAM
MEMORY
Computed GOTO
Table Reads
operation
OFFSET, W
TABLE
PCL
nnh
nnh
nnh
COMPUTED GOTO USING
AN OFFSET VALUE
is
discussed
DS39964B-page 85
further
nn
in

Related parts for PIC18F27J53T-I/SO