S12ZVLA96 STOP MODE not working

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

S12ZVLA96 STOP MODE not working

1,635 Views
vyshakhj
Contributor II

Hi All,

               I am using S12ZVLA96 MCU for my Auto motive project.Its a battery powered unit so I want to put the MCU in STOP mode and wake it up through LIN. I have tried to put the MCU in stop mode but its not at all going to STOP mode. The following steps are done my in my test software. Please go through it and help me

1. I am using internal clock source of 1MHz

2. In main , I am toggling one pin with a delay of 750ms.

3. After 15sec , I am setting one variable and executing the following line of code

            CPMUCOP = 0;

             asm(stop);

    After executing this two lines of code, I am expecting my MCU should be in STOP mode and there should not be any pin toggling. But unfortunately , this piece of code is not working as expected and even after executing asm(stop), the pins are toggling continuously with the same delay.

                                                           Please help me with, whats wrong with my code , appart from this what else I have to do.

Thanks,

Vyshakh J

Labels (1)
12 Replies

1,142 Views
vyshakhj
Contributor II

Thanks Daniel, this document was really helpful.

Regards,

Vyshakh J

0 Kudos

1,142 Views
vyshakhj
Contributor II

Hi Daniel,

           I need information regarding the precise calculation of ADC sampling time, please go through the controller and configuration that I am using:

Controller: S12ZVLA96

f_bus(bus frequency): 32Mhz

ADC : 6-channel 10 bit

ADC operating mode: Restart Mode, Single access mode

ADC Command sequence list length: 36

Please help me with the information on, what will be the time required for completing conversion of one channel, once a command in command list has been loaded.

As per data sheet I found two calculation related to ADC sampling time, below I mentioned those two formula,

 

1)  Conversion time = 5 Bus cycles + 2 ADC conversion cycles  

2) Total Sample time = Buffer sample time + Final Sample time

                                 = 2 ADC CLK + 2 ADC CLK

                 Can you provide how to correlate these two equations, and  what will be the total time required for completing the 36 commands , for the above configuration?

 

 

Thanks ,

Vyshakh J

0 Kudos

1,142 Views
danielmartynek
NXP TechSupport
NXP TechSupport

Hi Vyshakh,

See my comment here:

https://community.nxp.com/thread/469497 

Regards,

Daniel

0 Kudos

1,142 Views
danielmartynek
NXP TechSupport
NXP TechSupport

Hi,

You can use ECLK (external bus clock on ECLK pin) instead of toggling the GPIO pin. Since the bus clock is disabled in the stop mode, this can show you precisely when the MCU enters and leaves the stop mode.

Please be aware that CPMUCOP register is a write-once register in Normal mode. So, only the first write to the register takes effect.

To put the MCU into Stop mode, execute the below code.

asm ANDCC  #0x7F;    // Clear S bit
asm STOP;            // MCU STOP mode

 

Clearing the S bit enables the STOP instruction. Execution of a STOP instruction normally causes the

on-chip oscillator to stop. This may be undesirable in some applications. If the S12Z CPU encounters a

STOP instruction while the S bit is set (or while in user state) it is treated like a no-operation (NOP)

instruction and continues to the next instruction. Reset sets the S bit.

 

Regards,

Daniel

1,142 Views
vyshakhj
Contributor II

Hi Daniel,

                      This suggestion helped me a lot. Now my software is working as expected. Thanks a lot for your quick response. Here I have 2 more queries regarding the LIN sleep wake of S12ZVLA96

1. Is there any way to put the LIN PHY in stand-by mode immediately, with out putting the MCU in STOP mode?

2. What are the things to be done to achieve a minimum power consumption during STOP mode (<100uA)? My software needs the following peripherals and it is running with external clock (ACLK),

        i)ADC

       ii)EEPROM

      iii)PTS0 as output

                                                             

Thanks,

Vyshakh J

0 Kudos

1,142 Views
danielmartynek
NXP TechSupport
NXP TechSupport

Hi,

Sorry for the late response.

No, the LIN PHY is in Stand-by mode only when the controller is in Stop mode.

These peripherals are not clocked in Stop mode, so they don’t increase consumption.

Only the state of PTS0 will be not affected by Stop mode, it will source/sink current.

To lower the consumption, put the MCU to full stop mode (PSTP = 0 or OSCE=0).

 

Regards,

Daniel

1,142 Views
vyshakhj
Contributor II

Hi Daniel,

                 Here I have one more query regarding the STOP mode operation of MCU.

Q: What should be the status of unused pins(GPIOs), to achieve minimum current consumption in STOP mode?

Thanks,

Vyshakh J

0 Kudos

1,142 Views
danielmartynek
NXP TechSupport
NXP TechSupport

Hi Vyshakh,

This is discussed in AN5084 Hardware Design Guidelines for the S12ZVL Microcontrollers.

https://www.nxp.com/docs/en/application-note/AN5084.pdf 

Chapter 12, Unused pins.

Regards,

Daniel

1,142 Views
vyshakhj
Contributor II

Thanks for the suggestion.

0 Kudos

1,142 Views
vyshakhj
Contributor II

Hi Daniel,

I need one confirmation on LIN-Standby mode operation of S12ZVLA96, please check whether my following understanding is correct or not,

1. LIN PHY will be in standby mode , only when controller is in stop mode.

2. LIN PHY will not enter to standby mode , if there is a bus Idle condition for more than 4-10 seconds.

Please go through the above two points, and let me know its correct or not.

Regards,

Vyshakh J

0 Kudos

1,142 Views
danielmartynek
NXP TechSupport
NXP TechSupport

Hi Vyshakh,

 

1. Yes, LIN PHY enters Standby mode only if the MCU enters Stop mode. It is described in Figure 21-11 of the RM.

2. Yes, LIN PHY does not enter Standby mode if the bus is idle for 4 – 10s.

 

Regards,

Daniel  

1,142 Views
vyshakhj
Contributor II

OK, thanks Daniel

0 Kudos