Hello,
I try to implement the switch off function with KL-15 input.
It works with your example but the device never restart when KL-15 is on.
What we need to do?
regards
KL-15 function
-
- Hardware Development
- Posts: 87
- Joined: Fri 10. Sep 2010, 13:11
Re: KL-15 function
Hi,
are you sure that the module is really switched off? Is there any CAN traffic on your bus when you switch off the module? If so this might keep the module awake. If you use the unmodified example code it might happen in rare cases that the module has already entered the while(1) loop after hardware_Off(); command but is not totally switched off when a CAN message arrives. The CAN message might enable the power supply again without a proper reset of the controller. You could e.g. force the module to reset if it stays in this loop too long. This could be done e.g. calling void hardware_reset(void) function manually or setting the controllers watchdog timer before entering the loop.
BR,
Stephan
are you sure that the module is really switched off? Is there any CAN traffic on your bus when you switch off the module? If so this might keep the module awake. If you use the unmodified example code it might happen in rare cases that the module has already entered the while(1) loop after hardware_Off(); command but is not totally switched off when a CAN message arrives. The CAN message might enable the power supply again without a proper reset of the controller. You could e.g. force the module to reset if it stays in this loop too long. This could be done e.g. calling void hardware_reset(void) function manually or setting the controllers watchdog timer before entering the loop.
Code: Select all
//! @brief Starts the watchdog timer
//! @param timeOutms Time out in ms
void hardware_WatchdogInit(u32_t timeOutms){
WDTC=timeOutms; // Timeout=Twdclk *4 * timeOutms
WDMOD=3; // set reset mode (rest µC in case of a watchdog)
WDCLKSEL=0; // select internal RC-Oscillator
WDFEED=0xAA; // Watchdog enable sequence
WDFEED=0x55;
WatchdogInit = TRUE;
}
Stephan
Re: KL-15 function
Thanks for your comment.
The can bus is not wired when I try KL-15 shut-off.
I will try to implement your watchdoInit.
regards
The can bus is not wired when I try KL-15 shut-off.
I will try to implement your watchdoInit.
regards
Re: KL-15 function
Happy new year to you.
I have one problem with KL-15 shut off.
The whole board shuts off when KL-15 is off and it restarts when KL-15 is on, but the can bus doesn't work.
I don't use ODB2 function.
Each time KL-15 and VBat are off the can works on new run.
The code is like this
if((hardware_In(ignition) == FALSE) && (powerOffTime == 0))
{
enrState=ENR_STOP;
Enregistre_Task();
//The following two lines are only to show what is possible to switch off.
gps_Off(); //Power supply off for GPS.
gprs_Off(); //Power supply off for GPRS.
hardware_Off(); //Power supply off for the whole board. Including GPS and GPRS.
for(i=0;i<3000;i++)
{
z =1;
}
while(1)
{
}; //Wait until power down.*/
}
powerOffTime is used to know if there is can traffic.
Do you have an idea?
regards
I have one problem with KL-15 shut off.
The whole board shuts off when KL-15 is off and it restarts when KL-15 is on, but the can bus doesn't work.
I don't use ODB2 function.
Each time KL-15 and VBat are off the can works on new run.
The code is like this
if((hardware_In(ignition) == FALSE) && (powerOffTime == 0))
{
enrState=ENR_STOP;
Enregistre_Task();
//The following two lines are only to show what is possible to switch off.
gps_Off(); //Power supply off for GPS.
gprs_Off(); //Power supply off for GPRS.
hardware_Off(); //Power supply off for the whole board. Including GPS and GPRS.
for(i=0;i<3000;i++)
{
z =1;
}
while(1)
{
}; //Wait until power down.*/
}
powerOffTime is used to know if there is can traffic.
Do you have an idea?
regards
- PEAK-Support
- Sales & Support
- Posts: 1646
- Joined: Fri 10. Sep 2010, 19:34
Re: KL-15 function
you also have send us a support E-Mail - please do NOT double the workload - we will answer fast as possible but you limit the ressources if you send out double posts! Our developers from France have send you the information yesterday...
--------------------------------
PEAK-System Technik
Technical Support Team
support[at]peak-system.com
-------------------------------
PEAK-System Technik
Technical Support Team
support[at]peak-system.com
-------------------------------