View previous topic :: View next topic |
Author |
Message |
ertansuluagac
Joined: 13 Jul 2017 Posts: 135 Location: IZMIR
|
screen print cleaning |
Posted: Fri May 08, 2020 5:05 am |
|
|
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: 9226 Location: Greensville,Ontario
|
|
Posted: Fri May 08, 2020 6:43 am |
|
|
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
|
|
Posted: Fri May 08, 2020 7:17 am |
|
|
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: 9226 Location: Greensville,Ontario
|
|
Posted: Fri May 08, 2020 7:30 am |
|
|
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
|
|
Posted: Fri May 08, 2020 7:35 am |
|
|
4x20 character Lcd
WH2004A-YYH-JT# _________________ Es |
|
|
temtronic
Joined: 01 Jul 2010 Posts: 9226 Location: Greensville,Ontario
|
|
Posted: Fri May 08, 2020 7:52 am |
|
|
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: 19510
|
|
Posted: Fri May 08, 2020 8:06 am |
|
|
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
|
|
Posted: Fri May 08, 2020 9:13 am |
|
|
R/W pin I using. How can I use 'Home' command _________________ Es |
|
|
Ttelmah
Joined: 11 Mar 2010 Posts: 19510
|
|
Posted: Fri May 08, 2020 9:36 am |
|
|
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
|
|
Posted: Fri May 08, 2020 10:49 am |
|
|
To clear the character lcd screen with lcd.c or with flex_lcd.c, you do this:
|
|
|
Ttelmah
Joined: 11 Mar 2010 Posts: 19510
|
|
Posted: Sat May 09, 2020 12:01 am |
|
|
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
|
|
Posted: Sat May 09, 2020 10:29 am |
|
|
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: 9226 Location: Greensville,Ontario
|
|
Posted: Sat May 09, 2020 10:46 am |
|
|
'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
|
|
Posted: Sat May 09, 2020 11:10 am |
|
|
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: 19510
|
|
Posted: Thu May 14, 2020 1:18 am |
|
|
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. |
|
|
|