32.6.8 Channel n Control

Important: For PIC32CM LS00/LS60 Non-Secure accesses, read and write accesses (RW*) are allowed only if the security attribution for the corresponding channel (CHANNELn) is set as Non-Secured in the NONSECCHAN register.

This register allows the user to configure channel n. To write to this register, do a single, 32-bit write of all the configuration data.

Name: CHANNELn
Offset: 0x20 + n*0x08 [n=0..11]
Reset:  0x00008000 (CHANNEL0-7), 0x00000000 (CHANNEL8-11)
Property: PAC Write-Protection, Mix-Secure

Bit 3130292827262524 
          
Access  
Reset  
Bit 2322212019181716 
          
Access  
Reset  
Bit 15141312111098 
 ONDEMANDRUNSTDBY  EDGSEL[1:0]PATH[1:0] 
Access RW/RW*/RWRW/RW*/RWRW/RW*/RWRW/RW*/RWRW/RW*/RWRW/RW*/RW 
Reset x00000 
Bit 76543210 
  EVGEN[6:0] 
Access RW/RW*/RWRW/RW*/RWRW/RW*/RWRW/RW*/RWRW/RW*/RWRW/RW*/RWRW/RW*/RW 
Reset 0000000 

Bit 15 – ONDEMAND Generic Clock On Demand

This bit is used to determine whether the generic clock is requested.

This bit has no effect for channels when asynchronous path is selected or for channels with asynchronous support only.

This bit is always read zero for channels with asynchronous support only.

ValueDescription
0Generic clock for a channel is always on, if the channel is configured and generic clock source is enabled.
1Generic clock is requested on demand while an event is handled

Bit 14 – RUNSTDBY Run in Standby

This bit is used to define the behavior during Standby Sleep mode, for a resynchronized channel.

This bit has no effect for channels when asynchronous path is selected or for channels with asynchronous support only.

This bit is always read zero for channels with asynchronous support only.

ValueDescription
0The channel is disabled in Standby Sleep mode.
1The channel is not stopped in Standby Sleep mode and depends on the CHANNEL.ONDEMAND bit.

Bits 11:10 – EDGSEL[1:0] Edge Detection Selection

These bits set the type of edge detection to be used on the channel.

These bits must be written to zero when using the asynchronous path.

ValueNameDescription
0x0NO_EVT_OUTPUTNo event output when using the resynchronized or synchronous path
0x1RISING_EDGEEvent detection only on the rising edge of the signal from the event generator
0x2FALLING_EDGEEvent detection only on the falling edge of the signal from the event generator
0x3BOTH_EDGESEvent detection on rising and falling edges of the signal from the event generator

Bits 9:8 – PATH[1:0] Path Selection

These bits are used to choose which path will be used by the selected channel.

Note: The path choice can be limited by the channel source, see the table in USERm.
Important: Only EVSYS channel 0 to 7 can be configured as synchronous or resynchronized.
ValueNameDescription
0x0SYNCHRONOUSSynchronous path
0x1RESYNCHRONIZEDResynchronized path
0x2ASYNCHRONOUSAsynchronous path
Other-Reserved

Bits 6:0 – EVGEN[6:0] Event Generator Selection

These bits are used to choose the event generator to connect to the selected channel.

Table 32-3. Event Generators (PIC32CM2532 and PIC32CM5164 devices)
ValueEvent GeneratorDescription
0 (0x00)NONENo event generator selected
1 (0x01)CFDXOSC clock failure detection (OSCCTRL)
2 (0x02)CFDXOSC32K clock failure detection (OSC32KCTRL)
3 (0x03)BOD33DETSUPC BOD33 detection
4-11 (0x04-0x0B)PER0-7RTC period
4 (0x04)ALARM0RTC alarm (Clock/Calendar mode)
12-13 (0x0C-0x0D)CMP0-1RTC comparison (COUNT16 and COUNT32 modes)
14 (0x0E)TAMPERRTC tamper detection
15 (0x0F)OVFRTC overflow
16 (0x10)PERDRTC periodic interval daily
17-32 (0x11-0x20)EXTINT0-15EIC external interrupt
33- 40 (0x21-0x28)CH0-7DMAC channel
41 (0x29)OVFTC0 overflow
42-43 (0x2A-0x2B)MC0-1TC0 match/compare
44 (0x2C)OVFTC1 overflow
45-46 (0x2D-0x2E)MC0-1TC1 match/compare
47 (0x2F)OVFTC2 overflow
48-49 (0x30-0x31)MC0-1TC2 match/compare
50 (0x32)TRGTCC0 trigger
51 (0x33)CNTTCC0 counter
52-55 (0x34-0x37)MC0-3TCC0 match/compare
56 (0x38)OVFTCC0 overflow/underflow
57 (0x39)TRGTCC1 trigger
58 (0x3A)CNTTCC1 counter
59-50 (0x3B-0x3C)MC0-1TCC1 match/compare
61 (0x3D)OVFTCC1 overflow/underflow
62 (0x3E)TRGTCC2 trigger
63 (0x3F)CNTTCC2 counter
64-65 (0x40-0x41)MC0-1TCC2 match/compare
66 (0x42)OVFTCC2 overflow/underflow
67 (0x43)TRGTCC3 trigger
68 (0x44)CNTTCC3 counter
69-72 (0x45-0x48)MC0-3TCC3 match/compare
73 (0x49)OVFTCC3 overflow/underflow
74 (0x4A)RESRDYADC resolution ready
75 (0x4B)WINMONADC window monitor
76-79 (0x4C-0x4F)COMP0-3AC comparator
80-81 (0x50-0x51)WIN0-1AC window
82-83 (0x52-0x53)EMPTY0-1DAC empty
84 (0x54)EOCPTC end of conversion
85 (0x55)WCOMPPTC window comparator
86 (0x56)DATARDYTRNG Data Ready
87-90 (0x57-0x5A)LUT0-3CCL LUT output
91 (0x5B)ERRPAC access error
Table 32-4. Event Generators (PIC32CM1216 devices)
ValueEvent GeneratorDescription
0 (0x00)NONENo event generator selected
1 (0x01)CFDXOSC clock failure detection
(OSCCTRL)
2 (0x02)CFDXOSC32K clock failure detection
(OSC32KCTRL)
3 (0x03)BOD33DETSUPC BOD33 detection
4-11 (0x04-0x0B)PER0-7RTC period
4 (0x04)ALARM0RTC alarm (Clock/Calendar mode)
12-13 (0x0C-0x0D)CMP0-1RTC comparison (COUNT16 and
COUNT32 modes)
14 (0x0E)TAMPERRTC tamper detection
15 (0x0F)OVFRTC overflow
16 (0x10)PERDRTC periodic interval daily
17-24 (0x11-0x18)EXTINT0-7EIC external interrupt
25-32 (0x19-0x20)CH0-7DMAC channel
33 (0x21)OVFTC0 overflow
34-35 (0x22-0x23)MC0-1TC0 match/compare
36 (0x24)OVFTC1 overflow
37-38 (0x25-0x26)MC0-1TC1 match/compare
39 (0x27)OVFTC2 overflow
40-41 (0x28-0x29)MC0-1TC2 match/compare
42 (0x2A)RESRDYADC resolution ready
43 (0x2B)WINMONADC window monitor
44-45 (0x2C-0x2D)COMP0-1AC comparator
46 (0x2E)WIN0AC window
47-48 (0x2F-0x30)EMPTY0-1DAC empty
49 (0x31)EOCPTC end of conversion
50 (0x32)WCOMPPTC window comparator
51 (0x33)DATARDYTRNG Data Ready
52-53 (0x34-0x35)LUT0-1CCL LUT output
54 (0x36)ERRPAC access error