Hello,
There are many register bits in the MC33772C device which can be cleared by writing 0 to them.
My question is what happens if we write 1 to these bits?
Is the write ignored? Or will it have the same effect as the device setting the bit to 1.
Example: ADC2_OFFSET_COMP register has bits CC_P_OVF, CC_N_OVF, SAMP_OVF, CC_OVT which are marked as w0c.
Hello David,
Thanks for the reply.
I understand your recommendation about not writing to such bits.
But I am in a dilemma about what to do in cases where I want to clear only one of the multiple such bits in a register.
Example: suppose both CC_N_OVF and CC_P_OVF bits are set (in a hypothetical scenario), and I want to acknowledge CC_P_OVF only and clear it in one SPI message. But I still want to keep CC_N_OVF flag set, because I intend to clear it at a later point in time.
So, in this scenario, how would I recommend I only clear CC_P_OVF without clearing the other indication bits in that register?
Hello Sahyadri,
Please accept my apologies for the delayed response.
Have you tried to write 0 only to the interested bit (from the w0c bits)?
For example, if you pretend to clear the CC_N_OVF bit, you may write 0x5C00.
Could you please share your results?
Hello Sahyadri,
I hope all is great with you.
Please note that these register bits are “flags” and they are related to the device status.
Writing 1 to them will have no effect, but I personally recommended not to write to such bits, unless you intend to clear them.
I hope this information helps.
Regards,
David