Χάρτης μνήμης PIC16F887

download Χάρτης μνήμης PIC16F887

If you can't read please download the document

  • date post

    06-Jan-2016
  • Category

    Documents

  • view

    32
  • download

    2

Embed Size (px)

description

Χάρτης μνήμης PIC16F887. KATAΧΩΡΗΤΕΣ ΕΙΔΙΚΗΣ/ΓΕΝΙΚΗΣ ΧΡΗΣΗΣ. Οι καταχωρητές ειδικής χρήσης (Special Function Registers – SFRs) είναι καταχωρητές οι οποίοι καθορίζουν ειδικές λειτουργίες του μικροελεγκτή. - PowerPoint PPT Presentation

Transcript of Χάρτης μνήμης PIC16F887

  • STATUSbit 7IRP: Bit (Bank) 1= Bank2, Bank30= Bank0, Bank1bit 6-5RP1:RP0: Bit (Bank) 11= Bank310= Bank201= Bank100= Bank0bit 4TO: Bit WDT1= , clrwdt sleep0= Watchdog Timerbit 3PD: Bit 1= clrwdt0= sleepbit 2Z: 1= 0= bit 1DC: 4 bits 1= 4 bits 0= 4 bits bit 0C: 1= bit 0= .: . C=0 C=1

  • PIC16F887

  • KATA / (Special Function Registers SFRs) . STATUS, o FSR o INDF.

    SFRs (General Purpose Registers GPRs) . Bank0, Bank1, Bank2 Bank3.

    RAM , , Bank bits STATUS Bank. Bank bits o bit5 (RP0) bit6 (RP1).

  • Bank bits STATUS RP1=0, RP0=0 RAM Bank0. RP1=0, RP0=1 RAM Bank1. RP1=1, RP0=0 RAM Bank2. RP1=1, RP0=1 RAM Bank3. Bank . , Bank bits. STATUS ( ), FSR ( ), INTCON ( ).

  • BANKReg1 equ h'020' ; Bank0Reg2 equ h'0A0' ; Bank1Reg3 equ h'120' ; Bank2Reg4 equ h'1A0' ; Bank3bcf STATUS,RP0bcf STATUS,RP1 ; : = 00 (Bank0)movlw d'10'movwf Reg1 ; Reg1
  • / PIC16F887 . : A: 6 bit (RA0 RA6) B: 8 bit (RB0 RB7) C: 8 bit (RC0 RC7) D: 8 bit (RD0 RD7) E: 4 bit (RE0 RE3) .

  • / . TRISA PORTA. B TRISB PORTB. C TRISC PORTC. D TRISD PORTD. E TRISE PORTE. TRISx PORTx (x=A, B, C, D, E) bit . TRISx . , bit TRISx '0' x . bit TRISx '1' x . TRISB=b'00110011' :RB0: , RB1: , RB2: , RB3: RB4: , RB5: , RB6: , RB7:

  • / PORTx (x=A, B, C, D, E) '0' '1' TRISx . bit PORTx '0' x '0' () bit TRISx '0'. bit PORTx '1' x '1' ( ) bit TRISx '0'. TRISB=b'00000000' PORTB=b'11110000' PORTB :RB0='0', RB1='0', RB2='0', RB3='0',RB4='1', RB5='1', RB6='1', RB7='1'

  • /1. 8 D PIC16F887 RD0, RD3, RD5 RD7 '1' '0'. RD0 '0' RD1 '1'.bsf STATUS, RP0 ; RP0
  • /2. RC0, RC1, RC2 RC3 '1'. RC4, RC5, RC6 RC7 .1 :bsf STATUS,RP0bcf STATUS,RP1 ; Bank1 TRISCmovlw b'11110000'andwf TRISC,f ; TRISC
  • /2o :bsf STATUS,RP0bcf STATUS,RP1 ; Bank1 TRISCbcf TRISC,RC0 ; TRISC
  • /3. RD7 RD0 . RD7 '0' RD0 '0'. RD7 '1' RD0 '1'. bsf STATUS,RP0 bcf STATUS,RP1 ; Bank1 bsf TRISD,RD7 ;TRISD
  • /, , . LED. RB4='0' ILED=0A ( LED ). RB4='1' :

  • . pushbutton. S1 RB4 '0'. S1 RB4 5V '1'.

  • 3 /. RD7 o S1 . RD0 LED1 . RE3 Master Clear (MCLR) pull-up . RESET . . PIC16F887.