2
\$\begingroup\$

I'm looking at the user guide for the MSP430x5xx family. It says there in section 9.1 that:

The RCCTL0 register is protected with a key. Only if the correct key is
written during a word write, the RCCTL0 register content can be modified.   
Byte write accesses or write accesses with a wrong key are ignored.

And in section 9.3.1 that:

Field RCKEY: RAM controller key. Always read as 69h. Must be written as
5Ah, otherwise the RAMCTL write is ignored.
  1. Can anyone explain to me what a strange protection if the password (code) 5Ah is known? For what purpose it was made?

  2. Why RCKEY always read as 69h (not 5Ah)?

\$\endgroup\$
9
\$\begingroup\$

Can anyone explain to me what a strange protection if the password(code) 5Ah is known?

It protects you from random modification by runaway code, e.g. on stack overflow.

Why RCKEY always read as 69h(not 5Ah)?

So you cannot simply read->write it - part of the protection mentioned above.

Microcontroller code often contains code that read-modify-writes a memory location to set or clear some bit. With the values 69h and 5Ah it is highly unlikely that such code path triggers a sucessful write in a runaway case.

\$\endgroup\$

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.