11 Replies Latest reply on Jul 13, 2012 11:09 AM by JoMe_264151

    Using the LCD display in sleep mode



      According to this the only way to use the LCD is set the project up so that it runs at 12 MHz and then use the SegLCD block.


      My question is, does this apply to char LCD, and if it does is there a way to not do this and still get the LCD to work.


      Currently I have a sleep timer that is suppose to wake up the PSoC every 256 msec (it only actually does it 4 times when the device is first started then it stops working)


      At each wakup interrupt I increment a count.


      In the main loop I use a case statement to do different actions based on what value that count is.


      For example at a count of 3 I will wake the LCD up display my message and then delay for 100 mSec


      Then I put the device back into sleep mode


      This just flickers my LCD on once for each count value it turns on at.


      Is there a way to print something to the LCD and have it still displayed while the LCD is sleeping, or would this only work if I were not to put the LCD to sleep?


      Please help me understand how to use the PSoC sleep function. I think there is something I am missing about it.

        • 1. Re: Using the LCD display in sleep mode

          One way is if you were using an LCD with its own controller chip, where you


          are essentially writing to memory. Liek Hitachi 44780 and its derivatives.




          Some additional help for your situation -




          http://www.cypress.com/?docID=32571   discusses low power application on segment drive.




          Of course not using deep sleep is always an alternative.




          Regards, Dana.

          • 2. Re: Using the LCD display in sleep mode

            The LCD-Module is powered independently from the PSoC chip, only the 7 bus-lines are used and they may be sent to sleep. When you decide to switch off the LCD-Power you'll have to re-initialize it, when you keep the power, the display will show the last characters countinuosly "Press any key---"





            • 3. Re: Using the LCD display in sleep mode

               The LCD DAC has the ability to remain active when the chip is put into sleep mode. In this mode, the DAC continues to


              drive the inputs of the LCD Drivers. To enable this mode, the 'continuous_drive' bit in the LCDDAC.CR0 register must be


              set. If the Char LCD has a feature to set this bit, it can run in sleep mode







              • 4. Re: Using the LCD display in sleep mode



                What do you mean by not using deep sleep? I take that to mean only putting some components to sleep and not all, is that correct?




                Does this mean that when I put the device into sleep mode if I manually write the 6 pins connected to the the LCD with whatever they were prior to sleep that the LCD will continue to display the message? If this is true, then this really doesn't cut down the amount of power the LCD requires does it?




                I do not see any registers avaialble in the Char LCD that will let me do that


                *             Registers

                /* Port Register Definitions */
                #define LCD_PORT_DR_REG              (*(reg8 *) LCD_LCDPort__DR)   /* Data Output Register */
                #define LCD_PORT_DR_PTR              ( (reg8 *) LCD_LCDPort__DR)
                #define LCD_PORT_PS_REG              (*(reg8 *) LCD_LCDPort__PS)   /* Pin State Register */
                #define LCD_PORT_PS_PTR              ( (reg8 *) LCD_LCDPort__PS)   
                #define LCD_PORT_DM0_REG             (*(reg8 *) LCD_LCDPort__DM0)  /* Port Drive Mode 0 */
                #define LCD_PORT_DM0_PTR             ( (reg8 *) LCD_LCDPort__DM0)  
                #define LCD_PORT_DM1_REG             (*(reg8 *) LCD_LCDPort__DM1)  /* Port Drive Mode 1 */
                #define LCD_PORT_DM1_PTR             ( (reg8 *) LCD_LCDPort__DM1)  
                #define LCD_PORT_DM2_REG             (*(reg8 *) LCD_LCDPort__DM2)  /* Port Drive Mode 2 */
                #define LCD_PORT_DM2_PTR             ( (reg8 *) LCD_LCDPort__DM2)  

                /* These names are obsolete and will be removed in future revisions */
                #define LCD_PORT_DR                  LCD_PORT_DR_REG
                #define LCD_PORT_PS                  LCD_PORT_PS_REG
                #define LCD_PORT_DM0                 LCD_PORT_DM0_REG
                #define LCD_PORT_DM1                 LCD_PORT_DM1_REG
                #define LCD_PORT_DM2                 LCD_PORT_DM2_REG

                *       Register Constants

                /* SHIFT must be 1 or 0 */
                #define LCD_PORT_SHIFT               LCD_LCDPort__SHIFT
                #define LCD_PORT_MASK                LCD_LCDPort__MASK

                /* Drive Mode register values for High Z */
                #define LCD_HIGH_Z_DM0               (0xFFu)
                #define LCD_HIGH_Z_DM1               (0x00u)
                #define LCD_HIGH_Z_DM2               (0x00u)

                /* Drive Mode register values for High Z Analog */
                #define LCD_HIGH_Z_A_DM0             (0x00u)
                #define LCD_HIGH_Z_A_DM1             (0x00u)
                #define LCD_HIGH_Z_A_DM2             (0x00u)

                /* Drive Mode register values for Strong */
                #define LCD_STRONG_DM0               (0x00u)
                #define LCD_STRONG_DM1               (0xFFu)
                #define LCD_STRONG_DM2               (0xFFu)

                /* Pin Masks */
                #define LCD_RS                       (0x20u << LCD_LCDPort__SHIFT)
                #define LCD_RW                       (0x40u << LCD_LCDPort__SHIFT)
                #define LCD_E                        (0x10u << LCD_LCDPort__SHIFT)
                #define LCD_READY_BIT                (0x08u << LCD_LCDPort__SHIFT)
                #define LCD_DATA_MASK                (0x0Fu << LCD_LCDPort__SHIFT)


                These are the registers found in the LCD.h

                • 5. Re: Using the LCD display in sleep mode

                  The LCD-Module that goes with the kits is a standard 2-line LDC-module beeing powered from +5V rail. When sending the PSoC into "the big sleep" the LCD-module will keep drawing current from the power-supply.




                  Any references for the components concerning "sleep" and "low-power" do concern the inner (PSoC) implementation of that component which may be halted, suspended and at least cut off from internal power-supplies. Any external part connected to a power-line will not be affected by that.


                  To archieve something like that, there has to be a switch controlled by the PSoC that activates the power for the LCD-Module.





                  • 6. Re: Using the LCD display in sleep mode

                     I think what srim means is using the "internal LCD driver"  to drive LCD segments directly,  it seems that it can work in sleep mode. If you use external LCD modules, (using the char LCD library from the creator), then it is the externally module that you need to cotrol.

                    • 7. Re: Using the LCD display in sleep mode

                      Ok so can I reduce the power consumption by simply writing to the LCD less frequently?

                      • 8. Re: Using the LCD display in sleep mode

                        How do I use the internal LCD driver?

                        • 9. Re: Using the LCD display in sleep mode

                          I have to set something right, because the word "Module" has different meanings.


                          There are two basically different kinds of LCD-Modules (I'm talking about hardware, if you can kick it, it's hardware) Character LCDs which contain an interface chip and Segment-LCDs which do not.


                          The Character LCDs have one PSoC component and the Segment LCDs a couple of different other components depending on their internal organization.




                          Character LDCs due to their interface chip need a power supply. The PSoC communicates via datalines and control-signals with it (at least 7 lines). When the PSoC does not communicate any more because in sleep mode, the display will show as long as power is applied the the last characters.


                          Segment LSCs do not, the segments and the "Backplane" are connected directly to the PSoC, They can be set to sleep, but while in sleep-mode they (afaIk) do not display anything.


                          The segment LCDs are called "Glass" (because that's what they are made of) and are usually user-designed in big quantities, there are only few more general types to get on the market, just for displaying 4 digits and a dot etc.



                          • 10. Re: Using the LCD display in sleep mode

                            Ok, I'm using a char LCD (the one the comes with the kit) I only want to update every 4th time the PSoC wakes up, however I need the display to continue displaying even though the PSoC is in sleep mode. Based off what you have said Bob, in order to do this I need to save what is being written to the LCD at the time of sleep, and manually set the pins suppling signal to the LCD (P2[6:0]) so that it continues displaying, after that I can enter sleep mode. Is this correct?

                            • 11. Re: Using the LCD display in sleep mode

                              No need to do that, when your PSoC goes to sleep it will not clear the LCD. You should avoid re-initializing the LCD because that will.clear it. Do not laugh, but I'd try just to ignore it and do nothing about it.