PIC16F1937-I/P Microchip Technology, PIC16F1937-I/P Datasheet

IC PIC MCU FLASH 512KX14 40-PDIP

PIC16F1937-I/P

Manufacturer Part Number
PIC16F1937-I/P
Description
IC PIC MCU FLASH 512KX14 40-PDIP
Manufacturer
Microchip Technology
Series
PIC® XLP™ 16Fr

Specifications of PIC16F1937-I/P

Program Memory Type
FLASH
Program Memory Size
14KB (8K x 14)
Package / Case
40-DIP (0.600", 15.24mm)
Core Processor
PIC
Core Size
8-Bit
Speed
32MHz
Connectivity
I²C, LIN, SPI, UART/USART
Peripherals
Brown-out Detect/Reset, LCD, POR, PWM, WDT
Number Of I /o
36
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
Processor Series
PIC16F
Core
PIC
Data Bus Width
8 bit
Data Ram Size
512 B
Interface Type
EUSART/MI2C/SPI
Maximum Clock Frequency
32 MHz
Number Of Programmable I/os
36
Number Of Timers
5
Maximum Operating Temperature
+ 85 C
Mounting Style
Through Hole
3rd Party Development Tools
52715-96, 52716-328, 52717-734
Development Tools By Supplier
PG164130, DV164035, DV244005, DV164005
Minimum Operating Temperature
- 40 C
On-chip Adc
14-ch x 10-bit
A/d Bit Size
10 bit
A/d Channels Available
14
Height
4.95 mm
Length
53.21 mm
Supply Voltage (max)
5.5 V
Supply Voltage (min)
1.8 V
Width
14.73 mm
Lead Free Status / RoHS Status
Lead free / RoHS Compliant
Lead Free Status / RoHS Status
Lead free / RoHS Compliant, Lead free / RoHS Compliant

Available stocks

Company
Part Number
Manufacturer
Quantity
Price
Part Number:
PIC16F1937-I/PT
Manufacturer:
CYPRESS
Quantity:
460
Part Number:
PIC16F1937-I/PT
Manufacturer:
Microchip Technology
Quantity:
10 000
Part Number:
PIC16F1937-I/PT
Manufacturer:
MICROCHIP/微芯
Quantity:
20 000
Part Number:
PIC16F1937-I/PT
0
INTRODUCTION
After years of success, the PIC12/16 mid-range
microcontroller has been refreshed to be more suited
for C and increase the performance for many typical
applications.
These changes include:
• Additional instructions
• More memory
• New indirect addressing modes
Every effort was taken to assure the forward
compatibility of the legacy code base but in a few
cases, there are differences that must be reconciled by
adjustments to the software. This PIC1XF1XXX
Software Migration document has three sections
describing the new design, teaching how to migrate
existing software and introducing many software
optimizing techniques.
© 2009 Microchip Technology Inc.
Note:
Note:
This device has been designed to
perform to the parameters of its data
sheet. It has been tested to an electri-
cal specification designed to deter-
mine its conformance with these
parameters. Due to process differ-
ences in the manufacture of this
device, this device may have different
performance characteristics than its
earlier version. These differences
may cause this device to perform
differently in your application than the
earlier version of this device.
The user should verify that the device
oscillator starts and performs as
expected.
capacitor values and/or the oscillator
mode may be required.
PIC1XF1XXX Software Migration
Adjusting
the
loading
ARCHITECTURE
New Features
The enhanced PIC12/16 extends the architecture with
the following features:
• Program memory extended to 32KW (56KB)
• Data memory extended to 2KB
• 14 new instructions
• Linear mapping
• Simplified core register map
• Enhanced indirect addressing functions
• Automatic interrupt context save
These enhancements can increase the performance of
many applications while remaining largely compatible
with existing software.
Core Registers
The PIC12/16 has always had a core set of registers
that are present in every device. One of the goals for
the enhanced version was to collect the core registers
into a standard location. The first 12 SFR addresses of
every bank are now the core registers, as shown in
Table 1.
DS41375A-page 1

Related parts for PIC16F1937-I/P

PIC16F1937-I/P Summary of contents

Page 1

... The user should verify that the device oscillator starts and performs as expected. Adjusting capacitor values and/or the oscillator mode may be required. © 2009 Microchip Technology Inc. ARCHITECTURE New Features The enhanced PIC12/16 extends the architecture with the following features: • Program memory extended to 32KW (56KB) • ...

Page 2

... Call Absolute with W Logical Shift Right Logical Shift Left Move Literal to BSR Move Literal to PCLATH Move INDFn to W Move W to INDFn CPU Reset Status (1) Cycles Affected 1 — 1 C,DC,Z 1 C,DC — 2 — 2 — — 1 — — 1 C,DC,Z © 2009 Microchip Technology Inc. ...

Page 3

... Bank 31. STACK OPERATION The Stack Pointer always points at the last value placed on the stack call or an interrupt occurs, the stack is incremented and then the next Program Counter (PC) value is saved. © 2009 Microchip Technology Inc. DS41375A-page 3 ...

Page 4

... STKPTR 0X1F This figure shows the stack configuration after the first call or a single interrupt return instruction is executed, the return address will be placed in the Program Counter and the Stack Pointer decremented to empty state (0x1F). STKPTR 0X00 © 2009 Microchip Technology Inc. the ...

Page 5

... Return Address 0x02 Return Address 0x01 Return Address 0x00 Return Address © 2009 Microchip Technology Inc. After seven calls or six calls and one interrupt, the stack looks like the figure on the left. A instructions will repeatedly place the return addresses into the Program Counter ...

Page 6

... BRW RETLW ‘a’ RETLW ‘ ‘ RETLW ‘s’ RETLW ‘t’ RETLW ‘r’ RETLW ‘i’ RETLW ‘n’ RETLW ‘g’ In the example above, the letter ‘t’ is returned to the calling function. © 2009 Microchip Technology Inc. ...

Page 7

... Lastly, the low byte of each program memory address is also mapped into the FSR address space. These two addi- © 2009 Microchip Technology Inc. Indirect Addressing Indirect addressing allows an address to be computed at run time and the data modified. Accessing arrays and other memory buffers often requires indirect addressing ...

Page 8

... The GPRs and SFRs are mapped into the first 2 Kbytes of address space in the FSR. Following the GPR/SFR mapping, there is a reserved area (read as ‘0’) and then comes a new view of the GPR data space at address 0x2000, as shown in Figure 4. Core SFRs Device SFRs GPRs Common © 2009 Microchip Technology Inc. ...

Page 9

... RP0, RP1 bits in the STATUS register. These bits were removed and replaced with a BSR register. Along with BSR, a new instruction was added to load © 2009 Microchip Technology Inc. the BSR from a literal. The MOVLB instruction does in one cycle what the BANKSEL macro currently does in one or two instructions depending upon the device memory size ...

Page 10

... If the context needs to be dynamically adjusted, then the context-save registers are necessary to accomplish this. HARDWARE CONTEXT SHADOW LOCATIONS Context-Saved Bank 31 Register Address 0xFE5 WREG_SHAD 0xFE4 STATUS_SHAD 0xFE8 FSR0L_SHAD 0xFE9 FSR0H_SHAD 0xFEA FSR1L_SHAD 0xFEB FSR1H_SHAD 0xFE6 BSR_SHAD 0xFE7 PCLATH_SHAD © 2009 Microchip Technology Inc. ...

Page 11

... Stack Overflow • Stack Underflow • Reset by Instruction • Reset by POR • Reset by MCLR © 2009 Microchip Technology Inc. SOFTWARE MIGRATION Software migration can be a tricky problem. Every effort was made to minimize the complexities of converting legacy code to run correctly on the enhanced PIC12/ 16 ...

Page 12

... 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. Arithmetic 2. ROM Table Access 3. RAM Buffer Access 4. Data Structures © 2009 Microchip Technology Inc. ...

Page 13

... Sub16 MOVF lsb_a,w SUBWF lsb_b,f MOVF msb_a,w BTFSS STATUS,C ADDLW 0xFF SUBWF msb_b,f © 2009 Microchip Technology Inc. The enhanced version is as follows: Sub16_enhanced MOVF lsb_a,w SUBWF lsb_b,f MOVF msb_a,w SUBWFB msb_b,f The enhanced version of subtract saves two instructions ...

Page 14

... HIGH data_table FSROH LOW data_table data_index FSR0L FSR0H INDF0, W ‘m’ ‘y’ ‘ ‘ ‘d’ ‘a’ ‘t’ ‘a’ The HIGH directive will automatically set the MSB if the label references an address in program memory. © 2009 Microchip Technology Inc. ...

Page 15

... PCLATH and “calling” the resulting address. Locating the block of RETLW instructions on a 256-word boundary (low address byte as zero) allows a CALLW to retrieve the data. This can be a very fast table lookup. © 2009 Microchip Technology Inc. code MOVLP MOVLW CALLW ...

Page 16

... The software supplied herewith by Microchip Technology Incorporated (the “Company”) is intended and supplied to you, the Company’s customer, for use solely and exclusively with products manufactured by the Company. The software is owned by the Company and/or its supplier, and is protected under applicable copyright laws. All rights are reserved. ...

Page 17

... SKPNC INCFSZ INDF,W ADDWF NewFilter+1,F DECF FSR,F MOVF INDF,W ; get msb SKPNC INCFSZ INDF,W ADDWF NewFilter,F ENDM © 2009 Microchip Technology Inc. of the new ADD_FSR0_FILTER MACRO ; 8 instructions ; add value pointed to by FSR to filter moviw 0[INDF0] ADDWF NewFilter+3,F lowest byte MOVIW ...

Page 18

... NewSample with MUL_NEWOLD_BY2 MACRO ; 8 instructions ; right shift filter value i.e. divide multiply old value with 2 LSLF OldFilter+3,F RLF OldFilter+2,F RLF OldFilter+1,F RLF OldFilter,F ; multiply new value with 2 LSLF NewSample+3,F RLF NewSample+2,F RLF NewSample+1,F RLF NewSample,F ENDM © 2009 Microchip Technology Inc. ...

Page 19

... ADDWF NewFilter+2,F SKPNC ADDWF NewFilter+1,F SKPNC ADDWF NewFilter,F © 2009 Microchip Technology Inc. The switch is performed by changing the address pointed to by the FSR. This requires a load FSR, test and reload FSR combination 8 times in the main function. A faster method is to conditionally execute an ADDFSR of 4 ...

Page 20

... UpdateCounter = 1 byte, how many samples between 'global' updates ; AD_NewValue = 3 byte ram, last 24 bit reading from AD/or similar ( copied ; to NewSample, in case AD_NewValue should be used for other purposes ) ; AD_DataVal = 3 byte ram, filtered value updated after UpdateCounter samples ; _AD_DataReady = 1 bit, set when AD_DataVal is updated ; DS41375A-page 20 © 2009 Microchip Technology Inc. ...

Page 21

... ADDWF NewFilter+1,F DECF FSR,F MOVF INDF,W ; get msb SKPNC INCFSZ INDF,W ADDWF NewFilter,F ENDM ;++++++++++++ ; ; DIV_FILTER_BY2 - Divide NewFilter DIV_FILTER_BY2 MACRO ; 5 instructions ; right shift filter value i.e. divide © 2009 Microchip Technology Inc samples between global updates ; filterweight, i.e. 'A' in example above if overflow DS41375A-page 21 ...

Page 22

... BCF _AD_DataReady ; Note, this will inilialize the filter to gradually use ; no filtering to 'full' filtering ( increase once for each sample ) ; MOVLW FILTER_WEIGHT MOVWF FilterCounter DS41375A-page 22 ; clear carry ; clear carry ; clear carry ; not included ! ; clear data ready flag © 2009 Microchip Technology Inc. ...

Page 23

... Copy previous filtered value ( note previous value is multiplied by 256 ; i.e. only copy top three bytes of source to lowest three bytes of dest. ) MOVF NewFilter,W MOVWF OldFilter+1 MOVF NewFilter+1,W MOVWF OldFilter+2 MOVF NewFilter+2,W MOVWF OldFilter+3 ; copy new value from AD to 'local' variable and add it it © 2009 Microchip Technology Inc. DS41375A-page 23 ...

Page 24

... FSR ; get adress for old value check if value that should be added is new or old ; old value added to filter, adress add it ; upshift old and new value, 10 instr. © 2009 Microchip Technology Inc. ...

Page 25

... GOTO TWIST24_EXIT ; add one to filter to have proper rounding MOVLW 0x01 ADDWF NewFilter+2,F SKPNC ADDWF NewFilter+1,F SKPNC ADDWF NewFilter,F ; 245 - 278 instructions to get here TWIST24_EXIT ; check for update DECFSZ UpdateCounter,F RETURN © 2009 Microchip Technology Inc. DS41375A-page 25 ...

Page 26

... MOVF NewFilter+2,W MOVWF AD_DataVal+2 MOVF NewFilter+1,W MOVWF AD_DataVal+1 MOVF NewFilter,W MOVWF AD_DataVal ; set data ready flag BSF _AD_DataReady ; reinitialise update counter MOVLW UPDATE_COUNT MOVWF UpdateCounter RETURN DS41375A-page 26 ; number of samples between global update © 2009 Microchip Technology Inc. ...

Page 27

... NewSample, in case AD_NewValue should be used for other purposes ) ; AD_DataVal = 3 byte ram, filtered value updated after UpdateCounter samples ; _AD_DataReady = 1 bit, set when AD_DataVal is updated ; #define UPDATE_COUNT 0x20 #define FILTER_WEIGHT 0x80 CBLOCK 0x020 AD_NewValue:3 © 2009 Microchip Technology Inc samples between global updates ; filterweight, i.e. 'A' in example above DS41375A-page 27 ...

Page 28

... Microchip Technology Inc. ...

Page 29

... PowerInfo, PowerMate, PowerTool, REAL ICE, rfLAB, Select Mode, Total Endurance, TSHARC, WiperLock and ZENA are trademarks of Microchip Technology Incorporated in the U.S.A. and other countries. SQTP is a service mark of Microchip Technology Incorporated in the U.S.A. All other trademarks mentioned herein are property of their respective companies. ...

Page 30

... Fax: 886-3-6578-370 Taiwan - Kaohsiung Tel: 886-7-536-4818 Fax: 886-7-536-4803 Taiwan - Taipei Tel: 886-2-2500-6610 Fax: 886-2-2508-0102 Thailand - Bangkok Tel: 66-2-694-1351 Fax: 66-2-694-1350 © 2009 Microchip Technology Inc. EUROPE Austria - Wels Tel: 43-7242-2244-39 Fax: 43-7242-2244-393 Denmark - Copenhagen Tel: 45-4450-2828 Fax: 45-4485-2829 France - Paris Tel: 33-1-69-53-63-20 ...

Related keywords