What is the difference between writing 1 to clear 0 and writing 0 to clear 0 in the microcontroller?

In the MCU documentation, the general register is rw type, and some are r or w. The setting of some special registers is automatically realized by hardware, such as the flag bit flag, interrupt int; but clearing to 0 still needs to be operated by software. There are two ways to clear to 0, write 1 to clear 0, and write 0 to clear 0. What is the difference between these two ways? What is the difference in hardware implementation?

In the MCU documentation, the general register is rw type, and some are r or w. The setting of some special registers is automatically realized by hardware, such as the flag bit flag, interrupt int; but clearing to 0 still needs to be operated by software. There are two ways to clear to 0, write 1 to clear 0, and write 0 to clear 0. What is the difference between these two ways? What is the difference in hardware implementation?

There are registers with various functions inside the microcontroller, such as PIC, C51 series 8-bit microcontrollers, the width of the register is eight binary bits, generally the high bits are in the front and the low bits are in the back, for example: 11000011, a total of eight bits, high four bits of data is 1100, and the lower four digits are 0011.

What is the difference between writing 1 to clear 0 and writing 0 to clear 0 in the microcontroller?

The single-chip microcomputer can perform bit operations. For an 8-bit register, we can only operate on one of the bits or some bits, and assign the corresponding bit of the register to 1 (high level) as set, and assign 0 (low power) on the contrary. level) is cleared. This is an easier way to understand.

But there are several ways to write 1 to 0:

1) From the circuit point of view, write 1 to a bit, that is, input a high level, make an internal transistor conduct grounding, and clear the capacitor discharge to 0.

2) Writing a 1 generates a reset pulse in hardware. If you can write 0 to clear, it is very likely that you can also write 1 in, which does not meet the functional requirements. If you want to control only write 0 but not write 1, the hardware is more complicated.

3) From the perspective of application convenience, after reading the register data, it can be cleared to 0 by writing it back without changing the data again.

What is the difference between writing 1 to clear 0 and writing 0 to clear 0 in the microcontroller?

There are also registers that generally support byte, half word, and word operations. In the case of several flag bits on the register, the clearing of a single flag bit is completed without affecting other flag bits, but other bits must be cleared. Write, so it can only be effective by writing 1 or writing 0 to clear 0, only one way.

The Links:   ESM4016 CM1000DUC-34SA