STOP MODE

取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 

STOP MODE

1,293 次查看
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 回复

375 次查看
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 项奖励
回复