LCD 18F45K20

For questions and comments on programming in general. And for any items that don't fit into the forums below.

Moderators: Benj, Mods

Post Reply
jbs4wd
Posts: 46
Joined: Thu Dec 03, 2009 7:29 am
Has thanked: 4 times
Contact:

LCD 18F45K20

Post 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
Attachments
pic4x4PIC18F45K20.fcfx
(122.56 KiB) Downloaded 236 times

User avatar
Benj
Matrix Staff
Posts: 15312
Joined: Mon Oct 16, 2006 10:48 am
Location: Matrix TS Ltd
Has thanked: 4803 times
Been thanked: 4314 times
Contact:

Re: LCD 18F45K20

Post 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;

jbs4wd
Posts: 46
Joined: Thu Dec 03, 2009 7:29 am
Has thanked: 4 times
Contact:

Re: LCD 18F45K20

Post by jbs4wd »

Thanks Ben. Muchly appreciated

John

jbs4wd
Posts: 46
Joined: Thu Dec 03, 2009 7:29 am
Has thanked: 4 times
Contact:

Re: LCD 18F45K20

Post 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
Attachments
test 18f45k20.fcfx
(7.32 KiB) Downloaded 257 times

Post Reply