PIC16F1937-I/ML Microchip Technology, PIC16F1937-I/ML Datasheet - Page 12

IC PIC MCU FLASH 512KX14 44-QFN

PIC16F1937-I/ML

Manufacturer Part Number
PIC16F1937-I/ML
Description
IC PIC MCU FLASH 512KX14 44-QFN
Manufacturer
Microchip Technology
Series
PIC® XLP™ 16Fr

Specifications of PIC16F1937-I/ML

Core Size
8-Bit
Program Memory Size
14KB (8K x 14)
Core Processor
PIC
Speed
32MHz
Connectivity
I²C, LIN, SPI, UART/USART
Peripherals
Brown-out Detect/Reset, LCD, POR, PWM, WDT
Number Of I /o
36
Program Memory Type
FLASH
Eeprom Size
256 x 8
Ram Size
512 x 8
Voltage - Supply (vcc/vdd)
1.8 V ~ 5.5 V
Data Converters
A/D 14x10b
Oscillator Type
Internal
Operating Temperature
-40°C ~ 85°C
Package / Case
44-QFN
Controller Family/series
PIC16F
No. Of I/o's
36
Eeprom Memory Size
256Byte
Ram Memory Size
512Byte
Cpu Speed
32MHz
No. Of Timers
5
Lead Free Status / RoHS Status
Lead free / RoHS Compliant
If your application needs to return without restoring the
context, the following code can be used:
Your application must handle context. This instruction
sequence will work because the instruction after setting
the GIE will always execute.
INDIRECT MEMORY ACCESS
Indirect memory accessing is using the FSR/INDF
registers to access parts of memory. In the legacy
PIC12/16, the FSR is 9 bits wide with the 9th bit stored
in STATUS as IRP. The enhanced PIC12/16 has a 16-
bit wide FSR with the Most Significant bits stored in the
FSRnH register. To access the entire RAM, the Most
Significant bits need to be adjusted. This is often done
with the BANKISEL macro. The BANKISEL macro
would set or clear the IRP bit as required. On the
enhanced PIC12/16, the BANKISEL macro will set or
clear each bit in FSRnH as required. This will take 8
instruction cycles. If you are willing to write to W, then
the update can be done in two cycles by MOVLW and
MOVWF or use ADDFSR, or MOVIW/WI with relative
offset.
MOVING FROM PIC18FXXX TO
PIC1XF1XXX
Moving back from the PIC18 to the enhanced PIC12/16
is different than moving forward from the legacy PIC12/
16. The enhanced PIC12/16 lacks some resources:
• 16 stack locations instead of 31
• Different FSR relative addressing mechanism
• No Multiply instructions
• Shorter CALL/GOTO reach
• 2 FSRs vs 3
Banking
Banking on the PIC18 is often misunderstood. The
PIC18 does have banking for the RAM accesses. It
also has a special bank that contains nearly all of the
SFRs. Each bank on the PIC18 is larger (256 bytes), so
the amount of time spent banking is reduced. The
enhanced PIC12/16 still has the 128-byte bank size
and no Access Bank. Converting the software requires
that the BANKSEL macro be used for many SFR
accesses and RAM accesses to assure the bank is
correctly configured.
DS41375A-page 12
(instructions instead of registers)
bsf INTCON,GIE
return
Paging
Paging is eliminated on the PIC18 by making the CALL
and
instruction payload gives CALL and GOTO the ability to
reach any instruction in memory. Simply adding a
PAGESEL before all CALLs and GOTOs will provide the
same capability to the enhanced PIC12/16 at the cost
of one cycle. The PIC18 relative branch (BRA) is also
present on the enhanced PIC12/16. In some cases, the
BRA will need to be replaced with a GOTO because the
reach of the PIC18 BRA is longer than the reach of the
PIC12/16 BRA.
All instruction addresses on a PIC18 are even because
the 16-bit instruction memory is byte addressed. This
may have an effect on the enhanced PIC12/16 conver-
sion as its program memory is word-addressed, so all
instructions are sequentially addressed.
INTERRUPTS
The PIC18 has a 2-level interrupt structure. The
interrupts have a fast context-save but the restore is
optional, depending upon the use of a fast return from
interrupt instruction. All interrupts will need to be
adjusted to understand the flat interrupt structure of the
enhanced PIC12/16 and all context restores will need
to be removed.
INDIRECT MEMORY ACCESS
The PIC18 has 3 FSRs, special registers for
addressing, and INDF SFRs for increment and
decrement. These can be replaced with the appropriate
use of the MOVIW
enhanced PIC12/16.
PROGRAM MEMORY TABLES
The PIC18 has table read instruction to retrieve 2 bytes
from program memory.
The enhanced PIC12/16 can retrieve 1 byte from pro-
gram memory by using the FSR/INDF to access the
program memory.
SOFTWARE OPTIMIZATION
After the software has been migrated to the enhanced
PIC12/16, the opportunity exists to increase the
performance by taking full advantage of the new
features. Software optimization for the enhanced
PIC12/16 can be classified as changes to the following
areas:
1.
2.
3.
4.
Arithmetic
ROM Table Access
RAM Buffer Access
Data Structures
GOTO two word instructions. The additional
and MOVWI instructions on the
© 2009 Microchip Technology Inc.

Related parts for PIC16F1937-I/ML