STOP MODE

キャンセル
次の結果を表示 
表示  限定  | 次の代わりに検索 
もしかして: 

STOP MODE

1,371件の閲覧回数
fignon
Contributor I
Hello,
I'm working on MC1321x and I have some troubles with the stop modes.

I can't set the SPMSC2_PPDC bit. When I read it, it is always clear.

SPMSC1 = 0x00 ;
SPMSC2_PDC = 1;
SPMSC2_PPDC = 1 ;

When I read SPMSC2 register (SCI Transmission) the result is 0x02.

Do you have any idea ?

Regards.
ラベル(1)
0 件の賞賛
返信
1 返信

453件の閲覧回数
fabio
Contributor IV
Hi Fignon,

This problem is related to the SPMSC2 being a write-once register (at least bits PDC and PPDC are write-once).

When you write:

SPMSC2_PDC = 1;

The compiler generates a read-modify-write BSET instruction that reads the whole SPMSC2 register, sets bit PDC and writes the result back into SPMSC2. Note that PPDC will be written zero, because that is the reset value for the PPDC bit.

When you attempt to modify the PPDC bit, the second write in SPMSC2 produces no effect (PDC is set and PPDC is reset).

To avoid such problems you need to write both bits in a single operation:

SPMSC2 = 0x03;

Best regards,

0 件の賞賛
返信