1 / 24

Mikroprotsessorid

Mikroprotsessorid. PIC PORDID. PORDID. Enamuses väljaviikudes on võimalik valida, kas ta on port või mingi teine signaal. TRIS määrab pordi suuna: input või output. Iga individuaalse biti jaoks on oma TRIS. Write TRIS. 0 – Out 1 – In. TRIS-i saab ka lugeda. Write TRIS. Porti kirjutamine.

tavita
Download Presentation

Mikroprotsessorid

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Mikroprotsessorid PIC PORDID

  2. PORDID Enamuses väljaviikudes on võimalik valida, kas ta on port või mingi teine signaal

  3. TRIS määrab pordi suuna: input või output.Iga individuaalse biti jaoks on oma TRIS Write TRIS 0 – Out1 – In

  4. TRIS-i saab ka lugeda Write TRIS

  5. Porti kirjutamine 0 – Out1 – In

  6. Pordist lugemine Pordi olekut saab lugeda isegi juhul kui ta on output 0 – Out1 – In

  7. Registrid PORTD, PORTE

  8. 17.0 ELECTRICAL CHARACTERISTICS Absolute Maximum Ratings lk. 175 Maximum output current sunk by any I/O pin..............................................................25 mA Maximum output current sourced by any I/O pin.........................................................25 mA Maximum current sunk by PORTA, PORTB and PORTE (combined) .......................200 mA Maximum current sourced by PORTA, PORTB and PORTE (combined)..................200 mA Maximum current sunk by PORTC and PORTD (combined) .....................................200 mA Maximum current sourced by PORTC and PORTD (combined)................................200 mA

  9. Sisendpinge nivood Pinge hukkub vältimatult VDD+0,3V VDD Loogika 1 2V 0,8V Loogika 0 0V -0,3V hukkub vältimatult

  10. PORT B B0 – B3 RBPU=1 : Pull-up puudub RBPU=0 : Pull-up on olemas IPURB ~ 250 μA

  11. Port B katkestus

  12. Application Note AN552: Implementing Wake Up on Keystroke http://www.microchip.com/stellent/idcplg?IdcService=SS_GET_PAGE&nodeId=1824&appnote=en011041

  13. Pordi B initialiseerimine POR ja BOR ajal saavad PORTB sisenditeks BCF STATUS,RP0 BCF STATUS,RP1 ; Vali Bank0 CLRF PORTB ; PORTB kõik outputid nulliks BSF STATUS, RP0 ; Select Bank1 MOVLW 0x0F ; 0000 1111 MOVWF TRISA ; RA<3..0> input, RA<7:4> output

  14. PortA: RA0 - RA3 ja RA5 on multipleksitud analoogsisenditega

  15. PortA PortA 0..3

  16. PortA PCFG<3..0>0110 – kõik PortA-d digital1110 – RA0 analog, teised digital ADFM – A/D conversion formatADCS2 – A/D conversion clock

  17. Pordi A initialiseerimine POR ja BOR ajal saavad PORTA analoogsisenditeks BCF STATUS, RP0 BCF STATUS, RP1 ; Vali Bank0 CLRF PORTA ; PORTA kõik outputid nulliks BSF STATUS, RP0 ; Select Bank1 MOVLW 0x06 MOVWF ADCON1 ; ADCON1=0x06 – RA<5:0> Digital MOVLW 0xCF ; 1100 1111 MOVWF TRISA ; RA<3..0> input, RA<5:4> output

  18. PortA PortA 0..3, 5 VDD PortA4 Open Drain (Avatud kollektor)

  19. PortC Sisend-väljundseade saab mõjutada väljundi seisu sõltumata registrist PORTC Sisend-väljundseade saab mõjutada pordi suunda (I/O) sõltumata registrist TRISC Iga PortC on ka mingi sisend-väljundseade.

  20. Portide B ja C initialiseerimine BCF STATUS,RP0 BCF STATUS,RP1 ; Vali Bank0 CLRF PORTB ; PORTB kõik outputid nulliks BSF STATUS, RP0 ; Select Bank1 MOVLW 0xCF ; 1100 1111 MOVWF TRISB ; RB<3:0> input, ; RB<5:4> output, ; RB<7:6> input POR ja BOR : PortB ja PortC saavad sisenditeks

  21. Parallel Slave Port PIC16F876A –l puudub aga PIC16F877A –l on olemas Töötab välisseadme initsiatiivil

  22. Parallel Slave Port WRITE – välisseade kirjutab READ – välisseade loeb PIC sisemised lipukesed: IBF – Input Buffer Full IBOV – Input Buffer Overflow OBF – Output Buffer Full PSPIF – Parallel Slave Port Interrupt Flag – tekitab katkestuse

More Related