Continue to Site

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] In 16x2 LCD, how to refresh the values at point only other value remains stable

Status
Not open for further replies.

thannara123

Advanced Member level 5
Joined
Jan 7, 2010
Messages
1,580
Helped
122
Reputation
244
Reaction score
114
Trophy points
1,353
Location
India
Activity points
10,382
In 16x2 Lcd ,how to refresh the values at point only other value remains stable

In 16x2 Lcd ,how to refresh the values at point of cursor only other value remains stable .
For example :

LCD will display as follows .

Volt : 00 V
Current : 0.) A

In this example 00 in first line and 0.0 in second line data only will vary by refreshing .And the other string (data) will be stable ?

it need for an ammeter and volt meter project https://circuits-collection.blogspot.in/2015/12/microcontroller-based-ammeter-and.html
 

Re: In 16x2 Lcd ,how to refresh the values at point only other value remains stable

Depends on your way to write data to the LCD. It's well possible.
 
Re: In 16x2 Lcd ,how to refresh the values at point only other value remains stable

When i try it by the following function
Code:
 void gotoxy(unsigned char  x,unsigned char y)
{
 if(x<40)
 {
  if(y) x|=0b01000000;
  x|=0b10000000;
  lcd_cmd(x);
  }

the whole second line will refresh and repeat the line once again . :-(
Can i get a sample ?
 

Re: In 16x2 Lcd ,how to refresh the values at point only other value remains stable

No. The command only positions the cursor, it doesn't print.

But to refresh a specific a character, you'll set the cursor to the very position, not the begin of line. Then print exactly one character.
 

Re: In 16x2 Lcd ,how to refresh the values at point only other value remains stable

Hi,

look for instruction "SET DDRAM ADDRESS".

Klaus
 
Re: In 16x2 Lcd ,how to refresh the values at point only other value remains stable

Try this .hex file.
 

Attachments

  • Voltmeter and Ammeter.rar
    19.1 KB · Views: 127
  • Voltmeter and Ammeter.png
    Voltmeter and Ammeter.png
    38.4 KB · Views: 152

Re: In 16x2 Lcd ,how to refresh the values at point only other value remains stable

look for instruction "SET DDRAM ADDRESS"
It's already used in post #3.
Try this .hex file.
Off-topic post. The OP is asking for a code example or explanation.
 

Re: In 16x2 Lcd ,how to refresh the values at point only other value remains stable

Off-topic post. The OP is asking for a code example or explanation

I have used the same circuit and made the code using mikroC PRO AVR Compiler. If OP needs Code then I can post the mikroC PRO AVR Code.
 

Re: In 16x2 Lcd ,how to refresh the values at point only other value remains stable

Try this .hex file.

sorry ,I want to do my-own for learning purpose

- - - Updated - - -

The main code is as follows

Code:
lcd_init();
string("Volt ");
lcd_cmd(0xc0);
string("Amp : ");

then i want to display the
lcd_data(volt);
after volt in first line

in second line
lcd_data(current;


Example : code :
Code:
lcd_init();
string("Volt ");
lcd_cmd(0xc0);
string("Amp : ");


 
while(1)


 {
   lcd_cmd(0x80 + 0x08);
    string("Val_1");
    
    lcd_cmd(0x80 + 0x48);
    string("val_2");
    __delay_ms(100);
}

here the first refresh the 'vollt' againg displayin at the 0x0D DDRAM loaction .Please see the problem in proteus .
the problem was after first displaying again the displaying the first content .
 

Attachments

  • proteus.rar
    30.9 KB · Views: 95
Last edited:

Re: In 16x2 Lcd ,how to refresh the values at point only other value remains stable

Line 1 address starts at 0x80 and line 2 address starts at 0xC0.

If you want to write at column 2 of line 1 then you have to use LCD_Cmd(0x82); and then use LCD_String().
If you want to write on line 2 column 3 then you have to use LCD_Cmd(0xC3); and then use LCD_String().
 

Re: In 16x2 Lcd ,how to refresh the values at point only other value remains stable

yes I did that the above program .but the lcd whole data will be refreshing :bang:
 

Re: In 16x2 Lcd ,how to refresh the values at point only other value remains stable

The code you posted in post 9 is correct. What do you mean by whole display refreshing ?
 

Re: In 16x2 Lcd ,how to refresh the values at point only other value remains stable

please see my first post .sorry for my bad English and explanation
 

Re: In 16x2 Lcd ,how to refresh the values at point only other value remains stable

Show the code you are using to form the Val_1 and val_2 strings.
 

Re: In 16x2 Lcd ,how to refresh the values at point only other value remains stable

Code:
void main(){
    TRISB = 0x00;


lcd_init();
string("Volt ");
lcd_cmd(0xc0);
string("Amp : ");


 
while(1)


 {
    lcd_cmd(0x80 + 0x08);
    string("Val_1");
    
    lcd_cmd(0x80 + 0x48);
    string("val_2");
    __delay_ms(100);
}
}
 

Re: In 16x2 Lcd ,how to refresh the values at point only other value remains stable

Where are you forming the strings Val_1 and Val_2 ? How are you converting the volt and current values to strings ?
 

Re: In 16x2 Lcd ,how to refresh the values at point only other value remains stable

See here https://circuits-collection.blogspot.in/2015/12/microcontroller-based-ammeter-and.html
here am using avr but now i it converting into pic .

My problem is not value convertion or anything else .

I want to refresh the values in specified loaction of DDRAM only .other loaction values remain same . dont want refresh or blink ,means stable .
 

Re: In 16x2 Lcd ,how to refresh the values at point only other value remains stable

Without seeing the full code that you are using you won't get much help. Just post the latest code you are using.
 

Re: In 16x2 Lcd ,how to refresh the values at point only other value remains stable

Please post the real code instead of incomplete arbitrary snippets.

Running the simulation in post #9 reveals that the posted code is only loosely related to the actual program flow.

Overwriting a line of text with the same content doesn't cause blinking, not on on a real LCD display and apparently neither in Proteus.
 

Re: In 16x2 Lcd ,how to refresh the values at point only other value remains stable

Show your string() function code. I suspect that it has included LCD_Clear() function and hence you are seeing blinking.
 

Status
Not open for further replies.

Similar threads

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top