stop mode and LIN wake up problem is s12zvl32

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

stop mode and LIN wake up problem is s12zvl32

3,210 Views
deepakchandra
Contributor III

dear sir ,

this is very urgent as our team is stuck in stop mode . in our project we required stop mode current is 100uA. we are unable to achieve this please suggest all the application detail are give below.

1.we are using s12zvl32 controller it is LIN based application we have to achieve 100uA of current when sleep command is 

received from LIN master or LIN time out condition .presently i have implemented below condition but this condition when i send sleep command it is taking 8 mA and on wake up 15mA , but when it goes 1 time sleep it took 2mA ,and it not going sleep in time out.

 

if ((SLEEP_MODE == lin_lld_get_state()) & (~cpu_stop_mode_flg))
{

 

HallSensorOFF();//hall sensor supply through uCPIN 

/* Set enter stop mode flag */
cpu_stop_mode_flg = 1;
/* Enable wakeup feature of LIN Physical*/
LP0CR_LPWUE = 1;
asm(andcc #0x6f);
/* Enable Active Edge Detect Circuit in stop mode*/
psci->sciacr1.byte |= SCIACR1_RXEDGIE_MASK;
asm(stop);

}

if(IDLE == lin_lld_get_state())
{
if (cpu_stop_mode_flg)
{
/* Clear stop mode flag */
cpu_stop_mode_flg = 0;
/* Disable Active Edge Detect Circuit in stop mode*/
psci->sciacr1.byte &= ~SCIACR1_RXEDGIE_MASK;

 

HallSensorON();//hall sensor supply through uCPIN 

}

}

here i am also attaching my clock setting file and lin setting file .LIN stack we are using FSL LIN 2.x Stack Package 4.5.7.

Original Attachment has been moved to: TIMER_INT.c.zip

Original Attachment has been moved to: CPU.c.zip

Original Attachment has been moved to: LIN_INT.c.zip

Original Attachment has been moved to: ADC.c.zip

Labels (1)
0 Kudos
Reply
6 Replies

2,142 Views
deepakchandra
Contributor III

dear sir ,

i have try as per your recommendation , but i didn't get any success .please go though my above  post please if there any problem in register setting which i have set wrong ,in above post i have send u all the necessary setting of lin, timer ,adc,clock .please help me out ,this problem have struck my project from completion from last 6 month .

please this is very urgent in this we have to achieve 100uA of current .

first time after programming it is going in sleep mode ok(current is about 500uA) after wake frame when i resend the sleep command it is not going correctly in stop mode it is taking 2mA of current after wake up it is take 15mA (as  i think  it is going in pseudo stop mode ),i am attached my code api below .

if u need my complete project code , i will send u.

if ((SLEEP_MODE == lin_lld_get_state()) & (~cpu_stop_mode_flg))
{

DDRS_DDRS0=1;// set output mode of pin 
DDRS_DDRS1=1;
DDRS_DDRS2=1;
DDRS_DDRS3=1;

PTS_PTS2=0;//set output value to zero
PTS_PTS3=0;
PTS_PTS0=0;
HallSensorOFF();
/* Set enter stop mode flag */
/* Enable wakeup feature of LIN Physical*/
LP0CR_LPWUE = 1;
vMotor_eSetPWMDuty_exe(0, 2);

/* Enable Active Edge Detect Circuit in stop mode*/
psci->sciacr1.byte |= SCIACR1_RXEDGIE_MASK;

PTP_PTP5=0;//INA
//TIM0TIOS_IOS2 = 0;

PTP_PTP3=0;//INB
PTP_PTP1=0;
PTS_PTS1=0;
cpu_stop_mode_flg = 1;

asm(andcc #0x6f);
asm(stop);

}

if(IDLE == lin_lld_get_state())
{
if (cpu_stop_mode_flg)
{
/* Clear stop mode flag */
cpu_stop_mode_flg = 0;
/* Disable Active Edge Detect Circuit in stop mode*/
psci->sciacr1.byte &= ~SCIACR1_RXEDGIE_MASK;
HallSensorON();
}

}

0 Kudos
Reply

2,142 Views
RadekS
NXP Employee
NXP Employee

Hi Deepak,

according to your description, something change between the first and the second enter into stop mode.

I suppose that most probable reason may be ADC measuring.

 

I cannot see the e8188 errata workaround code snippet in your stop mode enter code (the ADC state machine has to be reset prior enter into stop mode, otherwise it consume additional current).

 

Are you really sue that you followed my recommendations?

Best Regards

Radek

0 Kudos
Reply

2,142 Views
deepakchandra
Contributor III

dear samyuktha ,

thanks for your previous support .

As per yesterday discussion with anoop sir regarding sleep mode(stop mode

) problem in s12zvl32 controller with LIN communication based ,problem is

described below.

1.we have to achieve less than 100uA of current in our project during sleep

mode, when go to sleep command is received from LIN frame(master) .which

we can't achieve yet.

presently list of peripheral used are.

1. internal clock (bus clock at 8 mhz)

2. timer counter 1channel 1

3.ADC 3 channel(current sense , battery sense , temperature sense)

4.port interrupt for hall interrupt

5.watchdog

6.internal LIN phy (LIN stack FSL LIN 2.x Stack Package 4.5.7)

our observation are as per below .

1.our controller in sleep mode first time ok with LIN time out not with

sleep command (but with higher current 270uA).

2.sending next time command it is not going perfectly in nither in sleep

mode

mode nor in wake up properly.

sleep condition .

1.3c 00 00 00 00 00 00 00 00

2.LIN timeout.

wake up frame

3c ff ff ff ff 00 00 00 00.

3. we have try today basic example code(attached file in rar format please

convert )of stop mode without any peripheral

but is shows 150 uA of current.

please suggest ASAP .

please send if u have some reference code of stop mode with LIN stack.

thanks and regards

deepak chandra bhatt

mob. no. 8506094119

0 Kudos
Reply

2,142 Views
zaighamgb
Contributor I

Hi,

I am facing the same problem. Did you find a solution?

0 Kudos
Reply

2,142 Views
deepakchandra
Contributor III

thanks ,

i have implement with errata workaround code snippet but the problem still

persist i have disable my application code and implemented only stop mode

but i have found the after wake up timer ,rtc does not work properly and

after wake up it does not go in sleep mode .is there any problem with

controller or LIN stack ,in intialization i am totally struck i cannot see

the way to solve this problem from last 6 month so please short out this

problem because from december this product has to come in production with

100000 qty we have to solve this problem ASAP other wise we have to change

controller .if u want to my complete code for analysis purpose i will send

u.

if ((SLEEP_MODE == lin_lld_get_state())&&(~cpu_stop_mode_flg))

{

DDRS_DDRS0=1;

DDRS_DDRS1=1;

DDRS_DDRS2=1;

DDRS_DDRS3=1;

HallSensorOFF();

/* Set enter stop mode flag */

/* Enable wakeup feature of LIN Physical*/

LP0CR_LPWUE = 1;

vMotor_eSetPWMDuty_exe(0, 2);

/* Enable Active Edge Detect Circuit in stop mode*/

psci->sciacr1.byte |= SCIACR1_RXEDGIE_MASK;

PTS_PTS2=0;

PTS_PTS3=0;

PTS_PTS0=0;

PTP_PTP5=0;//INA

PTP_PTP3=0;//INB

PTP_PTP1=0;

PTS_PTS1=0;

cpu_stop_mode_flg = 1;

ADC0_stop_current_workaround ();

asm(andcc #0x6f);

asm(stop);

}

if(IDLE == lin_lld_get_state())

{

if (cpu_stop_mode_flg)

{

/* Clear stop mode flag */

cpu_stop_mode_flg = 0;

/* Disable Active Edge Detect Circuit in stop mode*/

psci->sciacr1.byte &= ~SCIACR1_RXEDGIE_MASK;

HAL_Init(); //LIN Node initialisation

HallSensorON();

// ADC0CTL_0_ADC_EN=1;

// Middle_LIN_NODE_Init();// Clock initialisation at 8MHz

}

}

On Wed, Oct 26, 2016 at 12:32 AM, RadekS <admin@community.freescale.com>

0 Kudos
Reply

2,142 Views
RadekS
NXP Employee
NXP Employee

Hi Deepak,

I would like to recommend to look at three main areas:

  1. There e8188 errata for ADC at S12ZVL “ADC: High current in Stop Mode”. Please look at http://www.nxp.com/files/microcontrollers/doc/errata/MSE9S12ZVL_0N22G.pdf

with errata description and workaround.

  1. The GPIO pins levels stay unchanged when MCU enters into STOP mode. Please check schematic whether there are any external loads powered via MCU pins.
  2. The floating pins may increase power consumption when they work near the linear area (around VDD/2). The unused pins have to be configured into any of known states (input with internal/external pull-up/down, digital output) for achieving lowest power consumption in STOP mode. Please look at Table 1-6. Pin Summary and column “Reset State” – the “Off” means floating input.

Note: This is not valid for port AD until we enable appropriate digital input buffer in DIENAD register. The unused floating AD pins don't increase power consumption, despite on fact, that we should rather connect them to GND for minimizing the noise influence on neighborhood channels.

I hope it helps you.

Have a great day,
Radek

-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------

0 Kudos
Reply