STOP MODE

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

STOP MODE

1,190 Views
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.
Labels (1)
0 Kudos
1 Reply

272 Views
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 Kudos