18F46K22 LCD problem

For Flowcode users to discuss projects, flowcharts, and any other issues related to Flowcode 5.
To post in this forum you must have a registered copy of Flowcode 5 or higher.

Moderator: Benj

Post Reply
Michaelt
Posts: 38
Joined: Sun Sep 23, 2012 9:46 am
Has thanked: 13 times

18F46K22 LCD problem

Post by Michaelt »

Hello everyone.

For some time i have been working on a project regardig a Climate control box for Beer fermentation, I was using a Pic16f1937 with a standard HD44780 16x2 LCD witch was working fine, i just ran out of Program memory because of a lot of Text messages and Floating point math. and because i would like to make some temperature datalogging, later on. :D

Then i found out that i had a pic18F46k22 that i have never used, so i thaught i would give it a shot, Since the pinlayout is the same on the 2 Pics i just altered the pic to 18f46k22 and saved my project and replaced the old pic with the new one in the board i made. i altered the timer settings so that they match my old project. I can se that the program is running because of some output leds that are working correct, But i get nothing at all on the 16x2 lcd,

to test I then started a new project only with a led and a single lcd string command, but stil the same problem, led is blinking but nothing on the lcd. The LCD is wired to portC Bit 0-5

Is there a simple explanation for this behavier. I know that the 18f is more complex and has more setup options, So maybe it is me that is doing somethimg wrong.

I have attached the test program i made.
18f46k22test.fcf
(10 KiB) Downloaded 254 times
Regards Michael

User avatar
Enamul
Posts: 1772
Joined: Mon Mar 05, 2012 11:34 pm
Location: Nottingham, UK
Has thanked: 271 times
Been thanked: 814 times

Re: 18F46K22 LCD problem

Post by Enamul »

Hi
Can you please try it now? It's not a good practice to put delay in interrupt macro.
Attachments
18f46k22test.fcf
(10 KiB) Downloaded 260 times
Enamul
University of Nottingham
enamul4mm@gmail.com

Michaelt
Posts: 38
Joined: Sun Sep 23, 2012 9:46 am
Has thanked: 13 times

Re: 18F46K22 LCD problem

Post by Michaelt »

Thanks a lot for the quick response Enamul i apreciate it.

Thats seemed to fix it, i am not that experienced in programming, so everything i do is not always logical. the reason i put an interupt tmr in my main program is because i thaught the lcd display could not handle the high clock counts. is there a maximum for this??

Regards michael

User avatar
Enamul
Posts: 1772
Joined: Mon Mar 05, 2012 11:34 pm
Location: Nottingham, UK
Has thanked: 271 times
Been thanked: 814 times

Re: 18F46K22 LCD problem

Post by Enamul »

Hi

You can easily put LCD macro in main function just ensure some delay between each refresh. Other than that 10Mhz or 20MHz clock speed is pretty normal for LCD.
Enamul
University of Nottingham
enamul4mm@gmail.com

Michaelt
Posts: 38
Joined: Sun Sep 23, 2012 9:46 am
Has thanked: 13 times

Re: 18F46K22 LCD problem

Post by Michaelt »

Thanks a lot.. so u mean to put a small delay between each lcd command macro on just 10Micruseconds???

User avatar
Enamul
Posts: 1772
Joined: Mon Mar 05, 2012 11:34 pm
Location: Nottingham, UK
Has thanked: 271 times
Been thanked: 814 times

Re: 18F46K22 LCD problem

Post by Enamul »

Hi
In macro like cursor position, write string, print ascii etc..you don't need to put delay. But if they are in the loop...where they will be repeated. You should use delay to avoid blinking the text due to high speed re-write.
Enamul
University of Nottingham
enamul4mm@gmail.com

Michaelt
Posts: 38
Joined: Sun Sep 23, 2012 9:46 am
Has thanked: 13 times

Re: 18F46K22 LCD problem

Post by Michaelt »

Thanks a lot Enamul.

This has helped me on. :D

Regards Michael

User avatar
Enamul
Posts: 1772
Joined: Mon Mar 05, 2012 11:34 pm
Location: Nottingham, UK
Has thanked: 271 times
Been thanked: 814 times

Re: 18F46K22 LCD problem

Post by Enamul »

You are most welcome :D
Enamul
University of Nottingham
enamul4mm@gmail.com

Post Reply