Electronic Components Datasheet Search
  Indian  ▼
ALLDATASHEET.IN

X  

PIC17C752 Datasheet(PDF) 42 Page - Microchip Technology

Part # PIC17C752
Description  High-Performance 8-bit CMOS EPROM Microcontrollers with 10-bit A/D
PDF  306 Pages
Scroll/Zoom Zoom In 100%  Zoom Out
Manufacturer  MICROCHIP [Microchip Technology]
Direct Link  http://www.microchip.com
Logo MICROCHIP - Microchip Technology

PIC17C752 Datasheet(HTML) 42 Page - Microchip Technology

Back Button PIC17C752 Datasheet HTML 38Page - Microchip Technology PIC17C752 Datasheet HTML 39Page - Microchip Technology PIC17C752 Datasheet HTML 40Page - Microchip Technology PIC17C752 Datasheet HTML 41Page - Microchip Technology PIC17C752 Datasheet HTML 42Page - Microchip Technology PIC17C752 Datasheet HTML 43Page - Microchip Technology PIC17C752 Datasheet HTML 44Page - Microchip Technology PIC17C752 Datasheet HTML 45Page - Microchip Technology PIC17C752 Datasheet HTML 46Page - Microchip Technology Next Button
Zoom Inzoom in Zoom Outzoom out
 42 / 306 page
background image
PIC17C7XX
DS30289C-page 42
 1998-2013 Microchip Technology Inc.
EXAMPLE 6-2:
SAVING STATUS AND WREG IN RAM (NESTED)
; The addresses that are used to store the CPUSTA and WREG values must be in the data memory
; address range of 1Ah - 1Fh. Up to 6 locations can be saved and restored using the MOVFP
; instruction. This instruction neither affects the status bits, nor corrupts the WREG register.
; This routine uses the FRS0, so it controls the FS1 and FS0 bits in the ALUSTA register.
;
Nobank_FSR
EQU
0x40
Bank_FSR
EQU
0x41
ALU_Temp
EQU
0x42
WREG_TEMP
EQU
0x43
BSR_S1
EQU
0x01A
; 1st location to save BSR
BSR_S2
EQU
0x01B
; 2nd location to save BSR (Label Not used in program)
BSR_S3
EQU
0x01C
; 3rd location to save BSR (Label Not used in program)
BSR_S4
EQU
0x01D
; 4th location to save BSR (Label Not used in program)
BSR_S5
EQU
0x01E
; 5th location to save BSR (Label Not used in program)
BSR_S6
EQU
0x01F
; 6th location to save BSR (Label Not used in program)
;
INITIALIZATION
;
CALL
CLEAR_RAM
; Must Clear all Data RAM
;
INIT_POINTERS
; Must Initialize the pointers for POP and PUSH
CLRF
BSR, F
; Set All banks to 0
CLRF
ALUSTA, F
; FSR0 post increment
BSF
ALUSTA, FS1
CLRF
WREG, F
; Clear WREG
MOVLW
BSR_S1
; Load FSR0 with 1st address to save BSR
MOVWF
FSR0
MOVWF
Nobank_FSR
MOVLW
0x20
MOVWF
Bank_FSR
:
:
; Your code
:
:
; At Interrupt Vector Address
PUSH
BSF
ALUSTA, FS0
; FSR0 has auto-increment, does not affect status bits
BCF
ALUSTA, FS1
; does not affect status bits
MOVFP
BSR, INDF0
; No Status bits are affected
CLRF
BSR, F
; Peripheral and Data RAM Bank 0 No Status bits are affected
MOVPF
ALUSTA, ALU_Temp
;
MOVPF
FSR0, Nobank_FSR
; Save the FSR for BSR values
MOVPF
WREG, WREG_TEMP
;
MOVFP
Bank_FSR, FSR0
; Restore FSR value for other values
MOVFP
ALU_Temp, INDF0
; Push ALUSTA value
MOVFP
WREG_TEMP, INDF0
; Push WREG value
MOVFP
PCLATH, INDF0
; Push PCLATH value
MOVPF
FSR0, Bank_FSR
; Restore FSR value for other values
MOVFP
Nobank_FSR, FSR0
;
;
:
; Interrupt Service Routine (ISR) code
;
POP
CLRF
ALUSTA, F
; FSR0 has auto-decrement, does not affect status bits
MOVFP
Bank_FSR, FSR0
; Restore FSR value for other values
DECF
FSR0, F
;
MOVFP
INDF0, PCLATH
; Pop PCLATH value
MOVFP
INDF0, WREG
; Pop WREG value
BSF
ALUSTA, FS1
; FSR0 does not change
MOVPF
INDF0, ALU_Temp
; Pop ALUSTA value
MOVPF
FSR0, Bank_FSR
; Restore FSR value for other values
DECF
Nobank_FSR, F
;
MOVFP
Nobank_FSR, FSR0
; Save the FSR for BSR values
MOVFP
ALU_Temp, ALUSTA
;
MOVFP
INDF0, BSR
; No Status bits are affected
;
RETFIE
; Return from interrupt (enable interrupts)



Html Pages

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100  ...More


Datasheet Download

Go To PDF Page


Link URL



Does ALLDATASHEET help your business so far?  [ DONATE ] 

About Alldatasheet   |   Advertisement   |   Contact us   |   Privacy Policy   |   Link to Datasheet    |   Link Exchange   |   Manufacturer List
All Rights Reserved©Alldatasheet.com


Mirror Sites
English : Alldatasheet.com  |   English : Alldatasheet.net  |   Chinese : Alldatasheetcn.com  |   German : Alldatasheetde.com  |   Japanese : Alldatasheet.jp
Russian : Alldatasheetru.com  |   Korean : Alldatasheet.co.kr  |   Spanish : Alldatasheet.es  |   French : Alldatasheet.fr  |   Italian : Alldatasheetit.com
Portuguese : Alldatasheetpt.com  |   Polish : Alldatasheet.pl  |   Vietnamese : Alldatasheet.vn
Indian : Alldatasheet.in  |   Mexican : Alldatasheet.com.mx  |   British : Alldatasheet.co.uk  |   New Zealand : Alldatasheet.co.nz
Family Site : ic2ic.com  |   icmetro.com