Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

[SOLVED] which mode is suitable for LCD interface

Status
Not open for further replies.

shahbaz.ele

Advanced Member level 1
Joined
Aug 12, 2008
Messages
454
Helped
72
Reputation
146
Reaction score
73
Trophy points
1,308
Location
Islamabad, Pakistan
Activity points
3,665
Dear all I am using ATmega32 with LCD.
I am displaying some messages on intrrupts.
if there is no intrrupt i need to save power.
My question is which mode is better for it
Power down
power save
idle
etc
 

Muhammad Ateeb

Newbie level 4
Joined
Mar 27, 2012
Messages
6
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,281
Activity points
1,322
i work on PIC and 8051
at this time i have LCD code of PIC 18f452 of 16x2 LCD may be it is not help full for you
Code:

Code C - [expand]
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
#include<18F452.h>
#use delay(clock = 4000000)
//#use I2C(MASTER, SDA=PIN_B1, SCL=PIN_B0,FAST=400000)
//#use rs232(baud=9600, xmit=PIN_C6, rcv=PIN_C7)
#fuses NOWDT,NOPROTECT,NOLVP,XT
#define EN PIN_C7
#define RW PIN_C6
#define RS PIN_C5
unsigned char we[10]= "PIC LCD:";
 
 
void delay()
{
 long i;
for( i=0;i<=6555;i++)
{} 
}
 
void interface()
{
 output_b(0x3c);
 
 output_bit(EN,1);
 output_bit(RS,0);
 output_bit(RW,0);
 delay();
 output_bit(EN,0);
}
void DISPLAY_CURSOR()
{
 output_b(0x08);
 output_bit(EN,1);
 output_bit(RS,0);
 output_bit(RW,0);
 delay();
 output_bit(EN,1);
}
void clear_display()
{
 output_b(0x01);
 output_bit(EN,1);
 output_bit(RS,0);
 output_bit(RW,0);
 delay();
 output_bit(EN,0);
}
void blink()
{
 output_b(0x0f);
 output_bit(EN,1);
 output_bit(RS,0);
 output_bit(RW,0);
 delay();
 output_bit(EN,0);
}
void home ()
{
 output_b(0x02);
 output_bit(EN,1);
 output_bit(RS,0);
 output_bit(RW,0);
 delay();
 output_bit(EN,0);
}
 
 
void lcd(unsigned char ch)
{
 output_b(ch);
 output_bit(RS,1);
 output_bit(RW,0);
 output_bit(EN,1);
 delay();
 output_bit(EN,0);
} 
 
 
 
 
void main (void)
{ 
int i,j,count;
for(i=0;i<3;i++)
      {
      interface();
      delay();
      }
      DISPLAY_CURSOR();
      delay();
      clear_display();
      delay();
      blink();
      delay();
      home ();
      delay();
      for(j=0;j<10;j++)
      {
      
      lcd(we[j]);
//printf("char=%c",we[j]);
      delay();
      count=count+1;
      if(count==16)
      {
      clear_display();
      count=0;
      }
      }
    
 
}

 
Last edited by a moderator:

kamranravian

Junior Member level 3
Joined
Dec 3, 2010
Messages
26
Helped
16
Reputation
32
Reaction score
16
Trophy points
1,283
Activity points
1,385
you can use power down or idle mode, because intrrupts will wake up your circuit.
After displaying complete messages you should enter idle mode intrrupt will wake up, then you perform your required commands and again enter idle mode.
This will be enough I think you can understand what I want to say
 

Muhammad Ateeb

Newbie level 4
Joined
Mar 27, 2012
Messages
6
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,281
Activity points
1,322
I have no idea about power saving mode
but i think that 4bit mode or 8 bit mode approx. same power consumption
i have no more detail about your problem
 

Status
Not open for further replies.

Similar threads

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Top