Looking at the datasheet of the MSP430, it says writing to read-only registers results in increased current consumption. MSP430 Datasheet screenshot

Why is that? What is happening when trying to write to a read-only section of memory that increases current consumption? For reference, here is the family datasheet for the MPS430.

Edit: Further, are there other devices that exhibit similar behavior? It seems like I've seen this in datasheets before, but maybe not.

  • 2
    \$\begingroup\$ This probably can only be answered by speculation. They key point is that they are implicitly telling you not to do it. \$\endgroup\$ Jan 22 '19 at 17:45
  • \$\begingroup\$ That's a funny thing. So instead of throwing some kind of failure or ignoring the attempt they are doing some stuff which is increasing the current consumption... I would call it a major bug in the design. \$\endgroup\$
    – Eugene Sh.
    Jan 22 '19 at 17:48
  • \$\begingroup\$ @EugeneSh. That was my thoughts exactly. I would normally expect a device to just ignore the write, but I was surprised to read that it increases current consumption. \$\endgroup\$ Jan 22 '19 at 17:52
  • \$\begingroup\$ Maybe try reading it then writing back the exact same value to see if it is clash of logic levels for each bit? Then try inverting the read value to see if it gets worse. \$\endgroup\$
    – Andy aka
    Jan 22 '19 at 17:59
  • 1
    \$\begingroup\$ I think the key wording is "while the write attempt is active". Seems like it might spin its wheels for a while and then time out. You could test this by timing writes to a read only register versus writes to a writeable register. \$\endgroup\$
    – crj11
    Jan 22 '19 at 17:59

All the other GPIO registers are writable, so I guess somebody just copied+pasted this part of the hardware design, and did not bother to remove the write access.

The PxIN register always shows the current value at the pin. This implies that the register is continuously updated, i.e., the pin always writes to the register.

If you try to write from the CPU, both the CPU and the pin try to write at the same time, which means that both try to drive the same signal as the same time. And if you connect two active driver outputs with opposite levels together, you get a short between VCC and ground. (This short is only for a clock cycle, and through two MOSFETs that do not need to have a low RDS(on), so it's apparently not very harmful.)


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.