Page 1 of 1

LCD 18F45K20

Posted: Wed Nov 13, 2013 9:07 am
by jbs4wd
Gday
Having a bit of bother getting my 16 x 2 LCD to work with 18F24K20. I have tried different combinations to no avail. Could someone have a look and see where what I am missing please.

Cheers
John

Re: LCD 18F45K20

Posted: Wed Nov 13, 2013 10:21 am
by Benj
Hi John,

Ok first of all I would disable the Extended CPU option in the configuration as this is known to cause issues with string variables.

Also the internal RC clock speed defaults to 1MHz not the currently specified 10MHz.

You can change the internal RC oscillator frequency to the following by adding a C code icon to the start of your program and adding one of the lines of code specified.

16MHz : osccon = (osccon & 0x8F) | 0x70;
08MHz : osccon = (osccon & 0x8F) | 0x60;
04MHz : osccon = (osccon & 0x8F) | 0x50;

Re: LCD 18F45K20

Posted: Wed Nov 13, 2013 10:35 am
by jbs4wd
Thanks Ben. Muchly appreciated

John

Re: LCD 18F45K20

Posted: Thu Nov 14, 2013 10:13 pm
by jbs4wd
I have this working now, sort of. I made a test file.
which works fine occasionally. Problem is it will work, then I turn it off, turn back on and nothing. Is there a code protect or something that needs to be set?

Cheers
John