LIN Sleep and Wakeup

NI-CAN

LIN Sleep and Wakeup

LIN provides a mechanism for devices to enter sleep state and potentially conserve power. Per the LIN 2.0 specification, all slaves may be forced into sleep mode by the master sending a diagnostic master request frame (ID=60) with the first data byte equal to zero. This special frame is called the go-to-sleep command. Slaves shall also automatically enter sleep mode if the LIN is inactive for more than 4 seconds.

The NI-CAN Frame API for LIN provides great flexibility by allowing the user to put the LIN interface to sleep as desired at the application level. Upon receiving a full frame containing a sleep request message, or a bus inactive frame indicating 4 seconds of bus inactivity, the user may choose to put the LIN interface to sleep by setting the LIN Sleep attribute to TRUE.

LIN also provides a mechanism for waking devices on the bus. Wakeup is one task that may be initiated by any node on the bus (a slave as well as the master). Per the LIN 2.0 Specification, the wakeup request is issued by forcing the bus dominant for 250 microseconds to 5 milliseconds. Each slave should detect the wakeup request and be ready to process headers within 100 milliseconds. The master should also detect the wakeup request and start sending headers when the slave nodes are ready (within 100 to 150 milliseconds after receiving the wakeup request). If the master does not issue headers within 150 milliseconds after receiving the first wakeup request, then the slave requesting wakeup may try issuing a second wakeup request (and waiting for another 150 milliseconds). If the master still does not respond, the slave may issue the wakeup request and wait 150 milliseconds a third time. If there is still no response, the slave must wait for 1.5 seconds before issuing a forth wakeup request. The NI-CAN Frame API for LIN allows wakeup to be performed according to the LIN 2.0 Specification regardless of whether the LIN interface is operating as a master or slave.