KL-15 function

Platform for Telematic Applications
Post Reply
JPS7495
Posts: 9
Joined: Fri 18. Dec 2015, 10:38

KL-15 function

Post by JPS7495 » Thu 8. Dec 2016, 09:55

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

S.Michaelsen
Hardware Development
Hardware Development
Posts: 87
Joined: Fri 10. Sep 2010, 13:11

Re: KL-15 function

Post by S.Michaelsen » Thu 8. Dec 2016, 11:21

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.

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;
} 
BR,
Stephan

JPS7495
Posts: 9
Joined: Fri 18. Dec 2015, 10:38

Re: KL-15 function

Post by JPS7495 » Fri 9. Dec 2016, 17:10

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

JPS7495
Posts: 9
Joined: Fri 18. Dec 2015, 10:38

Re: KL-15 function

Post by JPS7495 » Tue 3. Jan 2017, 08:41

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

User avatar
PEAK-Support
Sales & Support
Sales & Support
Posts: 1646
Joined: Fri 10. Sep 2010, 19:34

Re: KL-15 function

Post by PEAK-Support » Wed 4. Jan 2017, 12:45

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
-------------------------------

Post Reply