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

screen print cleaning
Goto page 1, 2  Next
 
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion
View previous topic :: View next topic  
Author Message
ertansuluagac



Joined: 13 Jul 2017
Posts: 135
Location: IZMIR

View user's profile Send private message Send e-mail

screen print cleaning
PostPosted: Fri May 08, 2020 5:05 am     Reply with quote

ccs c compiler 5.093
PIC18F45K22
CRY 16MHZ

I don't want the posts to disappear when cleaning the screen. I want to do it very quickly. I made trials, it was not successful. Is there a good way to do this?
_________________
Es
temtronic



Joined: 01 Jul 2010
Posts: 9244
Location: Greensville,Ontario

View user's profile Send private message

PostPosted: Fri May 08, 2020 6:43 am     Reply with quote

you should post what 'screen' you're using as a LOT depends upon the mfr/make/rev .
Also post your test code.
ertansuluagac



Joined: 13 Jul 2017
Posts: 135
Location: IZMIR

View user's profile Send private message Send e-mail

PostPosted: Fri May 08, 2020 7:17 am     Reply with quote

test cpde
Code:


#INT_TIMER2
void  TIMER2_isr(void)

   static unsigned int32 counter;
   if(++counter>40000)//20 second  then cleaning
   {
     printf(lcd_putc,"\f"); 
     counter=0;
     
   }

}


 setup_timer_2(T2_DIV_BY_16,124,1);//500 us overflow, 500 us interrupt

_________________
Es
temtronic



Joined: 01 Jul 2010
Posts: 9244
Location: Greensville,Ontario

View user's profile Send private message

PostPosted: Fri May 08, 2020 7:30 am     Reply with quote

Which LCD module ?
The time the 'clear screen' command take depends upon the module. I checked one 2004 display and it takes about 2ms to 'clear the display'.
ertansuluagac



Joined: 13 Jul 2017
Posts: 135
Location: IZMIR

View user's profile Send private message Send e-mail

PostPosted: Fri May 08, 2020 7:35 am     Reply with quote

4x20 character Lcd
WH2004A-YYH-JT#
_________________
Es
temtronic



Joined: 01 Jul 2010
Posts: 9244
Location: Greensville,Ontario

View user's profile Send private message

PostPosted: Fri May 08, 2020 7:52 am     Reply with quote

According to one datasheet I downloaded, 'clear display' take +- 1.53ms, so a max of 2ms is what I'd expect if in 4 bit mode...

Jay
Ttelmah



Joined: 11 Mar 2010
Posts: 19544

View user's profile Send private message

PostPosted: Fri May 08, 2020 8:06 am     Reply with quote

On ones using the genuine Hitachi controller that is actually the specified
time (1.64mSec).
Why clear?. Remember you can just goto the required location and write new
data that replaces what is already there. You can just use the 'home' command and write a new screen without having to clear.
Remember the LCD update will be faster if you are using the R/W pin and
waiting for the display to complete, rather than using fixed delays.
ertansuluagac



Joined: 13 Jul 2017
Posts: 135
Location: IZMIR

View user's profile Send private message Send e-mail

PostPosted: Fri May 08, 2020 9:13 am     Reply with quote

R/W pin I using. How can I use 'Home' command
_________________
Es
Ttelmah



Joined: 11 Mar 2010
Posts: 19544

View user's profile Send private message

PostPosted: Fri May 08, 2020 9:36 am     Reply with quote

If you are using flex_lcd, then:
Code:

      lcd_send_byte(0,2);
      lcd_line = 1;
      delay_us(1640);
PCM programmer



Joined: 06 Sep 2003
Posts: 21708

View user's profile Send private message

PostPosted: Fri May 08, 2020 10:49 am     Reply with quote

To clear the character lcd screen with lcd.c or with flex_lcd.c, you do this:
Code:

lcd_putc('\f');
Ttelmah



Joined: 11 Mar 2010
Posts: 19544

View user's profile Send private message

PostPosted: Sat May 09, 2020 12:01 am     Reply with quote

He was complaining that this was too slow.
However have to agree. You can clear the display and write completely new
data, in less time than the screen takes to refresh. Can't even see that it
has been cleared normally....
ertansuluagac



Joined: 13 Jul 2017
Posts: 135
Location: IZMIR

View user's profile Send private message Send e-mail

PostPosted: Sat May 09, 2020 10:29 am     Reply with quote

The code you wrote by the time I compile give error.
Code:

         lcd_send_byte (0,2);
         lcd_line = 1;
         delay_us (1,640);

error
*** Error 12 "Machine To Machine\CCS C Kod\Machine to Machine.c" Line 231(10,18): Undefined identifier lcd_line
*** Error 58 "Machine To Machine\CCS C Kod\Machine to Machine.c" Line 232(22,25): Expecting a close paren
_________________
Es
temtronic



Joined: 01 Jul 2010
Posts: 9244
Location: Greensville,Ontario

View user's profile Send private message

PostPosted: Sat May 09, 2020 10:46 am     Reply with quote

'lcd_line' is probably defined within the driver so...
...that error could be because you didn't load the LCD driver before the code.


the other error might be the delay_us().

might be a compiler version bug I'd try
delay_us(1640); instead og
delay_us(1,640);
ertansuluagac



Joined: 13 Jul 2017
Posts: 135
Location: IZMIR

View user's profile Send private message Send e-mail

PostPosted: Sat May 09, 2020 11:10 am     Reply with quote

compiler 5.93

delay_us(1640); this code it is not giving error. at this moment lcd_line giving error. But , Is it correct this code delay_us(1640)?
_________________
Es
Ttelmah



Joined: 11 Mar 2010
Posts: 19544

View user's profile Send private message

PostPosted: Thu May 14, 2020 1:18 am     Reply with quote

delay_us(1640); should work fine.
It's give an issue with a really old compiler (back in the V4 or possibly
even earlier days, the maximum allowed was 255), but this has been
acceptable syntax for perhaps 10 years!...
It's also give an issue if the clock setup was missing, but then delay_ms
would fail as well.
Display posts from previous:   
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion All times are GMT - 6 Hours
Goto page 1, 2  Next
Page 1 of 2

 
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