6.5.2 WAKE Mode

  • When the key “b” is entered, the terminal window will appear as shown in the following figure
    Figure 6-6. Terminal Window when Tamper Enabled in Wake Mode
  • The device will enable the tamper detection in wake mode (for more details, refer Modes of Operation ) and enable the RTC
  • After enabling the RTC, the clock starts counting at an interval of 1 second
  • Set the mode flag and the previous mode flag as SET_TO_WAKE, to keep track of the current operating mode of tamper and previous mode of tamper
  • The device goes to sleep. However, the RTC will still be running internally.
  • Here, the Tamper condition can be generated by press and release of the user switch SW0 (which is connected to the tamper input pin)
  • When a tamper is detected, the device wakes from sleep mode. The firmware will stay awake to detect future tamper inputs. The user also has the provision to change the input mode only after the first tamper condition is detected.
  • Once the tamper occurs, the following action happens:
    • Displays the error message “Tamper occurred” to indicate that tamper has occurred as shown in the following figure
      Figure 6-7. Terminal Window when Tamper Callback Occured in Wake Mode
    • The device remains awake, detects tampers or key pressed by the user, and performs the actions accordingly
    • It turns OFF LED and turns ON LCD backlight
    • Get the current time from the clock register and sets alarm after five seconds
    • Set the tamper flag
    • Display the error message “TAMPR” on the LCD as shown in the following figure and enable the timer module with specified overflow value (user configurable) for blinking the SLCD backlight by toggling the port pin connected to it
      Figure 6-8. LCD Screen when Tamper Occured in Wake Mode
    • Comes to alarm call back after five seconds where the firmware clears the LCD display and disables the TCC (timer module to stop LCD backlight blinking). Now, the device is ready for next the tamper condition or other operations.