MPC-55xx - Write 1 to clear.
"Praveenmuthu, E " <[email protected]> Tue, 3 Jul 2007 16:23:17 +0530
| Newsgroups | gmane.comp.hardware.motorola.microcontrollers |
|---|---|
| Message-ID | <08A8D4CDCC2576409FBCC99AB460C6F6015D3F3E@INKARBLR-EX01.Asia.DelphiAuto.net> |
Hi All,
I have questions regarding the "w1c" flag bits.
From the MPC5554 manual, "w1c" flags are cleared by writing a 1 to it.
1) The manual (MPC5553/MPC5554 Microcontroller Reference Manual Devices
Supported: MPC5553 MPC5554 MPC5554RM Rev. 3.1 11/2005) refers to preface
section as shown below:
"Note: w1c means "write 1 to clear" and is explained in the Preface."
But there is no preface section in the document. Please provide the
same.
2) Now there are two methods to clear the flag. Method one is writing 1
to the bitfield. Method two, writing the 32 bit value into the status
register. Both methods are shown below.
In method one, the assembly code reads the status register and sets this
particular bit and writes back. But the side effect is if the status of
other "w1c" bits is also 1, then it is reading and writing back a 1 to
other "w1c" bits. Thereby it clears other "w1c" bits (which may not be
intentional).
In method two, we are writing 1 to the "w1c" bit of our interest and
zero for the rest. Hence we do not have side effect for the other "w1c"
bits (writing 0 has no effect). But not sure on the impact on "non-w1c"
bits as in the registers ETPU_CnSCR's (FM) and FLASH_MCR's (STOP bit).
So the question is what is the recommended way to clear only "w1c" bit
of interest without affecting other (w1c or non-w1c bit) in the same
register?
Method 1: (complied with Windriver Diab)
EQADC.FISR[RFIFONUM].B.CFUF = 1;
80060000 lwz r0,0x0(r6) ; r0,0(r6)
3D404001 lis r10,0x4001 ; r10,16385
5160D908 insrwi r0,r11,0x1,0x4 ; r0,r11,1,4
90060000 stw r0,0x0(r6) ; r0,0(r6)
Method 2:
EQADC.FISR[RFIFONUM].R = 0x08000000;
3CA00800 lis r5,0x800 ; r5,2048
90A60000 stw r5,0x0(r6) ; r5,0(r6)
Regards
Praveen
****************************************************************************************
Note: If the reader of this message is not the intended recipient, or an employee or agent responsible for delivering this message to the intended recipient, you are hereby notified that any dissemination, distribution or copying of this communication is strictly prohibited. If you have received this communication in error, please notify us immediately by replying to the message and deleting it from your computer. Thank you.
****************************************************************************************
[Non-text portions of this message have been removed]