数据搜索系统,热门电子元器件搜索
  Chinese  ▼
ALLDATASHEETCN.COM

X  

DVR 数据表(PDF) 128 Page - Microchip Technology

部件名 DVR
功能描述  16-Bit General Purpose Microcontrollers with 256-Kbyte Flash and 16-Kbyte RAM in Low Pin Count Packages
PDF  416 Pages
Scroll/Zoom Zoom In 100%  Zoom Out
制造商  MICROCHIP [Microchip Technology]
网页  http://www.microchip.com
标志 MICROCHIP - Microchip Technology

DVR 数据表(HTML) 128 Page - Microchip Technology

Back Button DVR Datasheet HTML 124Page - Microchip Technology DVR Datasheet HTML 125Page - Microchip Technology DVR Datasheet HTML 126Page - Microchip Technology DVR Datasheet HTML 127Page - Microchip Technology DVR Datasheet HTML 128Page - Microchip Technology DVR Datasheet HTML 129Page - Microchip Technology DVR Datasheet HTML 130Page - Microchip Technology DVR Datasheet HTML 131Page - Microchip Technology DVR Datasheet HTML 132Page - Microchip Technology Next Button
Zoom Inzoom in Zoom Outzoom out
 128 / 416 page
background image
PIC24FJ256GA705 FAMILY
DS30010118D-page 128
 2016-2018 Microchip Technology Inc.
11.3
Interrupt-on-Change (IOC)
The Interrupt-on-Change function of the I/O ports
allows the PIC24FJ256GA705 family of devices to gen-
erate interrupt requests to the processor in response to
a Change-of-State (COS) on selected input pins. This
feature is capable of detecting input Change-of-States,
even in Sleep mode, when the clocks are disabled.
Interrupt-on-Change functionality is enabled on a pin
by setting the IOCPx and/or IOCNx register bit for that
pin. For example, PORTC has register names, IOCPC
and IOCNC, for these functions. Setting a value of ‘1’ in
the IOCPx register enables interrupts for low-to-high
transitions, while setting a value of ‘1’ in the IOCNx
register enables interrupts for high-to-low transitions.
Setting a value of ‘1’ in both register bits will enable
interrupts for either case (e.g., a pulse on the pin will
generate two interrupts). In order for any IOC to be
detected, the global IOC Interrupt Enable bit (IEC1<3>)
must be set, the PADCON<15> bit set (IOCON) and the
associated ISFx flag cleared.
When an interrupt request is generated for a pin, the
corresponding status flag (IOCFx register bit) will be
set, indicating that a Change-of-State occurred on that
pin. The IOCFx register bit will remain set until cleared
by writing a zero to it. When any IOCFx flag bit in a
given port is set, the corresponding IOCPxF bit in the
IOCSTAT register will be set. This flag indicates that a
change was detected on one of the bits on the given
port. The IOCPxF flag will be cleared when all
IOCFx<15:0> bits are cleared.
Multiple individual status flags can be cleared by writing
a zero to one or more bits using a Read-Modify-Write
operation. If another edge is detected on a pin whose
status bit is being cleared during the Read-Modify-
Write sequence, the associated change flag will still be
set at the end of the Read-Modify-Write sequence.
The user should use the instruction sequence (or
equivalent) shown in Example 11-1 to clear the
Interrupt-on-Change Status registers.
At the end of this sequence, the W0 register will contain
a zero for each bit for which the port pin had a change
detected. In this way, any indication of a pin changing
will not be lost.
Due to the asynchronous and real-time nature of the
Interrupt-on-Change, the value read on the port pins
may not indicate the state of the port when the change
was detected, as a second change can occur during
the interval between clearing the flag and reading the
port. It is up to the user code to handle this case if it is
a possibility in their application. To keep this interval to
a minimum, it is recommended that any code modifying
the IOCFx registers be run either in the interrupt
handler or with interrupts disabled.
Each Interrupt-on-Change (IOC) pin has both a weak
pull-up and a weak pull-down connected to it. The pull-
ups act as a current source connected to the pin, while
the pull-downs act as a current sink connected to the
pin. These eliminate the need for external resistors
when push button or keypad devices are connected.
The pull-ups and pull-downs are separately enabled
using the IOCPUx registers (for pull-ups) and the
IOCPDx registers (for pull-downs). Each IOC pin has
individual control bits for its pull-up and pull-down. Set-
ting a control bit enables the weak pull-up or pull-down
for the corresponding pin.
EXAMPLE 11-1:
IOC STATUS READ/CLEAR IN ASSEMBLY
EXAMPLE 11-2:
PORT READ/WRITE IN ASSEMBLY
EXAMPLE 11-3:
PORT READ/WRITE IN ‘C’
Note:
Pull-ups and pull-downs on pins should
always be disabled whenever the pin is
configured as a digital output.
MOV
0xFFFF, W0
; Initial mask value 0xFFFF -> W0
XOR
IOCFx, W0
; W0 has '1' for each bit set in IOCFx
AND
IOCFx
; IOCFx & W0 ->IOCFx
MOV
0xFF00, W0
; Configure PORTB<15:8> as inputs
MOV
W0, TRISB
; and PORTB<7:0> as outputs
NOP
; Delay 1 cycle
BTSS
PORTB, #13
; Next Instruction
TRISB = 0xFF00;
// Configure PORTB<15:8> as inputs and PORTB<7:0> as outputs
Nop();
// Delay 1 cycle
If (PORTBbits.RB13){ };
// Next Instruction



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


数据表 下载

Go To PDF Page


链接网址



ALLDATASHEET是否为您带来帮助?  [ DONATE ] 

关于 Alldatasheet   |   广告服务   |   联系我们   |   隐私政策   |   数据表链接    |   链接交换   |   制造商名单
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