| 전자부품 데이터시트 검색엔진 |
|
PIC17C752-08/CL 데이터시트(PDF) 72 Page - Microchip Technology |
|
|
|||||||||||||||||||||||||||||
PIC17C752-08/CL 데이터시트(HTML) 72 Page - Microchip Technology |
|
72 / 328 page ![]() PIC17C7XX DS30289A-page 72 © 1998 Microchip Technology Inc. 10.2 PORTB and DDRB Registers PORTB is an 8-bit wide bi-directional port. The corre- sponding data direction register is DDRB. A '1' in DDRB configures the corresponding port pin as an input. A '0' in the DDRB register configures the corresponding port pin as an output. Reading PORTB reads the status of the pins, whereas writing to PORTB will write to the port latch. Each of the PORTB pins has a weak internal pull-up. A single control bit can turn on all the pull-ups. This is done by clearing the RBPU (PORTA<7>) bit. The weak pull-up is automatically turned off when the port pin is configured as an output. The pull-ups are enabled on any reset. PORTB also has an interrupt on change feature. Only pins configured as inputs can cause this interrupt to occur (i.e. any RB7:RB0 pin configured as an output is excluded from the interrupt on change comparison). The input pins (of RB7:RB0) are compared with the value in the PORTB data latch. The “mismatch” out- puts of RB7:RB0 are OR’ed together to set the PORTB Interrupt Flag bit, RBIF (PIR1<7>). This interrupt can wake the device from SLEEP. The user, in the interrupt service routine, can clear the inter- rupt by: a) Read-Write PORTB (such as; MOVPF PORTB, PORTB ). This will end mismatch condition. b) Then, clear the RBIF bit. A mismatch condition will continue to set the RBIF bit. Reading then writing PORTB will end the mismatch condition, and allow the RBIF bit to be cleared. This interrupt on mismatch feature, together with soft- ware configurable pull-ups on this port, allows easy interface to a keypad and make it possible for wake-up on key-depression. For an example, refer to Applica- tion Note AN552, “Implementing Wake-up on Key- stroke.” The interrupt on change feature is recommended for wake-up on operations where PORTB is only used for the interrupt on change feature and key depression operations. Note: On a device reset, the RBIF bit is indeter- minate since the value in the latch may be different than the pin. FIGURE 10-5: BLOCK DIAGRAM OF RB5:RB4 AND RB1:RB0 PORT PINS Note: I/O pins have protection diodes to VDD and VSS. Data Bus Q D CK Q D CK Weak Pull-Up Port Input Latch Port Data OE WR_PORTB (Q4) WR_DDRB (Q4) RD_PORTB (Q2) RD_DDRB (Q2) RBIF RBPU Match Signal from other port pins (PORTA<7>) Peripheral Data in |
|
링크 URL |
| ALLDATASHEET 가 귀하에 도움이 되셨나요? [ DONATE ] |
Alldatasheet는? | 광고문의 | 운영자에게 연락하기 | 개인정보취급방침 | 링크 투 데이터시트 | 링크교환 | 제조사별 검색 All Rights Reserved©Alldatasheet.com |
| 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 |