CCS C Software and Maintenance Offers
FAQFAQ   FAQForum Help   FAQOfficial CCS Support   SearchSearch  RegisterRegister 

ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

CCS does not monitor this forum on a regular basis.

Please do not post bug reports on this forum. Send them to CCS Technical Support

lcd flicker

 
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion
View previous topic :: View next topic  
Author Message
webgiorgio



Joined: 02 Oct 2009
Posts: 123
Location: Denmark

View user's profile Send private message

lcd flicker
PostPosted: Sat Oct 31, 2009 9:55 am     Reply with quote

hi,
I'm using a 16F88 a 2*16 LCD, and flex_lcd.c routine.
I would like to write two voltages (coming from A/D input) like this:
Code:

 -------------------------
|volt0=0.15               |
|volt1=3.58               |
 -------------------------


Each second I do the ADC and LCD update with the following code:
printf(lcd_putc, "\fvolt0=%1.2f \nvolt1=%1.2f", volts, volts1);

The problem is that before write the new value the LCD is empty for a very short time, but you can see something like flicker.
This is worst for the 2nd line, because it stay off more time (due write time for the 1st line) than the 1st line.

How can I do?
FvM



Joined: 27 Aug 2008
Posts: 2337
Location: Germany

View user's profile Send private message

PostPosted: Sat Oct 31, 2009 9:59 am     Reply with quote

Surely not perform a clear command, only overwrite the changed display part.
webgiorgio



Joined: 02 Oct 2009
Posts: 123
Location: Denmark

View user's profile Send private message

PostPosted: Sat Oct 31, 2009 10:23 am     Reply with quote

yes! thanks, it works! Wink
Here is my code, can be usefull to someone.

Code:
 if (clock) {
           numero++;
         
          set_adc_channel(0);
          delay_us(10);
          adc_value0 = read_adc();
         
          set_adc_channel(1);
          delay_us(10);
          adc_value1 = read_adc();

          volts = (float)(adc_value0)*5/1023;
          volts1 = (float)(adc_value1)*5/1023;

          lcd_gotoxy(7,1);
          printf(lcd_putc, "%1.2f", volts);
          lcd_gotoxy(7,2);
          printf(lcd_putc, "%1.2f", volts1);
          lcd_gotoxy(12,1);
          printf(lcd_putc, "%lu", numero);
          clock=0;
          }
webgiorgio



Joined: 02 Oct 2009
Posts: 123
Location: Denmark

View user's profile Send private message

PostPosted: Sat Oct 31, 2009 10:38 am     Reply with quote

Another question:
Suppose to decrease a variable (int16 numero) starting from 110 and write the value on the lcd, overwriting the changed display part, doing
Code:

lcd_gotoxy(12,1);
printf(lcd_putc, "%lu", numero);

I will get:
110
109
108
107
106
105
101
100
990
980
970
960
....
...
...
110
100
900
800
700
....
Ttelmah
Guest







PostPosted: Sat Oct 31, 2009 11:11 am     Reply with quote

Put some spaces after the number.

Best Wishes
Display posts from previous:   
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group