1

Topic: Hibernation Mode setup

Hi everyone,

  I would like to implement a sleep mode/Hibernation mode when the vehicle can bus signal "engine off ", the factory computer has a CAN address to notify everything to go to sleep or awake , so my question is when I am using the Sleep mode function, can I have it sleep all the time until the factory computer wake it up? I am confuse because the example shown on the canny website state

" The duration of the sleep phase is 1024 ms. This means that while controller is in low power mode, or in the absence of conditions for transition to the normal power, the controller pauses for 1 second after each execution loop of the function diagram"


What is the point of 1024 ms ? just curious? Is the timer adjustable   Can I just set 0 or 1 of the sleep mode base on the CAN bus? but then how can it listen to CAN bus from the car if it is asleep ?

2

Re: Hibernation Mode setup

While in sleep mode, the controller executes its diagram every 1024 ms (yes, this is a multiple of the timer) in order to be able to implement more complex wake-up algorithms than just "wake up from CAN activity".
You should not be embarrassed by this, because the controller consumes very little power during these 1024 ms, its consumption increases periodically by only a few milliseconds / one execution loop.
There is a special "Interfaces Activity Control Register" for tracking the activity of all interfaces simultaneously. An example in the documentation is built on its basis. You can safely use it: https://cannylogic.com/docs/c72duo/reso … ibernation

angellee200 wrote:

but then how can it listen to CAN bus from the car if it is asleep ?

The firmware driver works asynchronously and wakes up immediately if the enabled interfaces are active. The first message may be lost, but this is not always the case.

3

Re: Hibernation Mode setup

Konstantin,
   
   It is nice to hear from you! I hope you are doing well. I attached the Sleep mode and LED example . For the Sleep example below, there is a " Power on Detect " and "Device Interface activity " . Do you mind to share some more sleep mode example on how it it is being used? Like I have a loop to flash the on board LED, is that consider Power on detect? if I am transmitting on CAN bus, will that consider device interface activity?  it is best if I can use the fix the bug features so I can visualize it.    Does it matter where I place the Sleep mode ? do I need to put it at the bottom ? how is the program read ( top to bottom or Left to right? or it doesn't matter ?)  do I need to set the sleep mode for every actions such as

My program consist of the following-

Initialize can bus/IO output/led/input
Listening to address 0x0AA on can bus
if/else statement
if/else sleep mode

mean time

ON board LED flashing to verify module is on
Listern to Address on can bus
if statment true, then activate green led
sleep  ( do I need another sleep here ?)


Thank you in advance


Carlos

Post's attachments

Sleep Mode example.JPG, 46.9 kb, 819 x 372
Sleep Mode example.JPG 46.9 kb, 94 downloads since 2023-05-30 

4

Re: Hibernation Mode setup

is that consider Power on detect?

You can find the Power On Detect Register description here: https://cannylogic.com/docs/c72duo/reso … controller

if I am transmitting on CAN bus, will that consider device interface activity?

You can find the Interfaces Activity Control Register description here: https://cannylogic.com/docs/c72duo/reso … l_register

Does it matter where I place the Sleep mode ? do I need to put it at the bottom ? how is the program read ( top to bottom or Left to right? or it doesn't matter ?)

You can find the complete information about it here: https://cannylogic.com/docs/fbd/cfd/#se … escription
and here: https://cannylogic.com/docs/common_plc/ … spolneniya

( do I need another sleep here ?)

I'm not sure I fully understand what "another sleep" means.

5

Re: Hibernation Mode setup

Will try and report back. Thanx!