XMC4200 USIC Bit Protection

Tip / Sign in to post questions, reply, level up, and achieve exciting badges. Know more

cross mob
Not applicable
Hello,
does someone of you know how the Bit Protection configuration for the KSCFG register works?

The documentations says:

"1b ... is updated with the written value."

Does this 1 denotes the current state of the bit when writing to the configured bit or to value to be written when writing to the configured bit? Do I have to issue two writes, one to set the Bit Protection bit to enable writes to the protected bit? Or can I simple write the protected bit, by setting the bit and (bitwise or) the protection bit?


/* first write protection bit, then the protected bit; reset protection bit */
channel->KSCFG |= 1 << USIC_CH_KSCFG_BPMODEN_Pos;
channel->KSCFG |= 1 << USIC_CH_KSCFG_MODEN_Pos;
channel->KSCFG &= channel->KSCFG & ~USIC_CH_KSCFG_MODEN_Mask;

/* or simply write both flags at once */
channel->KSCFG |= ( 1 << USIC_CH_KSCFG_BPMODEN_Msk ) | ( 1 << USIC_CH_KSCFG_MODEN_Pos );



Is there any other documentation regarding the USIC available, than the Reference Manual?

Cheers and thanks in advance,

Torsten

P.S. I tried the second approach and watched at channel->KSCFG with a debugger and got 0xffffffff.
0 Likes
4 Replies
User8819
Level 4
Level 4
BPMODEN and MODEN must be written simultaneously. As manual states MODEN is updated only when BPMODEN is 1.

rum
0 Likes
Not applicable
Thank you. But in my opinion one can read "MODEN is updated only when BPMODEN is 1" as: "BPMODEN must already be 1", not as "BPMODEN has to become 1 with the current write". So I think it's not very clear in the documentation.

cheers,
Torsten
0 Likes
chismo
Employee
Employee
First like received
Hi Torsten,

I believe you have already seen also that both BPMODEN and MODEN must be written simultaneously, as mentioned by rum.
BPMODEN is a write-only bit and hence it takes effect only with each new write.

We will look at improving the wording at the very next opportunity.
Thanks for your inputs.

Regards,
Min Wei
0 Likes
Not applicable
Hello Min Wei,
that would be fantastic. I think this construct is there so that it is possible to manipulate a single bit without the need for a read-modify-write cycle. If you would put an additional sentence into the document, why there is this protection bit, it would be very clear how to use it.

kind regards,
Torsten
0 Likes