Auto-off for LCD backlight

Discussion in 'Embedded Systems and Microcontrollers' started by SanjayPhirke, Mar 26, 2012.

  1. SanjayPhirke

    Thread Starter New Member

    Jan 12, 2009
    1
    0
    In my 89S52 design, I want to make the LCD back-light on for specified period as soon as any key is pressed. After that duration the back-light goes off provided no switch is pressed again during that period.

    I get a low signal for any switch pressed. So I can use an external interrupt along with a timer. But for this simple work two interrupt resources will be occupied.

    Can somebody suggest me a simpler method. Is it possible by using timer2 alone(T2EX pin)? In Capture mode, interrupt is generated on high-to-low transition at T2EX. At the same time it can also be used as regular timer...
     
  2. aeroguy

    Member

    Sep 16, 2009
    40
    2
    Assuming you are polling the switches for other purposes (human interface or something), I would just set an LCD backlight flag in the software handlers for your button presses.

    The backlight flag can be monitored in your main loop. When high, switch on the backlight and start a timer. Using the timer driven interrupts, have the backlight flag cleared after some predetermined number of timer overflows.
     
Loading...