Setting peripheral configuration registers in code
Posted: 16 Jun 2021 10:34
So, I'm looking to use a PIC16F1768/9 in a new project as it contains built in DAC and analog Comparators.
The configuration of these peripherals is done via registers. For instance if I want to invert the output of Comparator C1 I would write 1 to the C1POL bit in the CM1CON0 register (according to 19.2.3 COMPARATOR OUTPUT POLARITY in the datasheet)
Can this configuration register bit value be changed during code execution, or can it only be configured as part of the compiled program i.e. static configuration ?
The configuration of these peripherals is done via registers. For instance if I want to invert the output of Comparator C1 I would write 1 to the C1POL bit in the CM1CON0 register (according to 19.2.3 COMPARATOR OUTPUT POLARITY in the datasheet)
Can this configuration register bit value be changed during code execution, or can it only be configured as part of the compiled program i.e. static configuration ?