Page 1 of 1
LCD Commands @ 40MHz
Posted: Mon Feb 01, 2010 4:32 pm
by Brian Walsh
The LCD commands don't work with a 40 MHz clock.
Using an 18F4620 with a 10MHz xtal and HSPLL, I couldn't get the display (4 x 20) to intialise. Assuming there was a bug in the LCD Start routine, I got the data sheet out and wrote an initialiser as a macro in flowcode and it worked.
I then went on to try the print string using "hello world" and got "he}}<1w<s}u", which, if you analyse the bit pattern looks like a stuck bit in hardware, which it can't be, or my home made initialiser wouln't have worked.
Using your print string, the least significant bit in the data is always read as 1. I assume the enable pulse comes too soon after presenting the data nibble.
Everything works at 10 & 20MHz.
Brian.
Re: LCD Commands @ 40MHz
Posted: Tue Feb 02, 2010 7:58 am
by Steve
Thanks for the note, Brian.
Can you please post a simple example file here for us to test. Thanks.
Re: LCD Commands @ 40MHz
Posted: Tue Feb 02, 2010 4:38 pm
by saschech@gmx.de
Hallo Steve
A long time behind , i tell you my problem with " lcd and port a ".
Matrix tell me,there is not a bug in the macro,so i build my one "lcd macro " without any probleme
on my hardware 18F4620 18F8722....@40MHZ.
to day ,i modify >>>>>>> start with my lcd-start-macro and than i use the the orginal lcd-Macro:
move courser >>>> it works ok
print number >>>> it works not ok macro print number 255 on the lcd display i show 355??
Regards Wolfgang
Re: LCD Commands @ 40MHz
Posted: Tue Feb 02, 2010 5:34 pm
by Benj
Hello Brian,
It takes a little while for the PLL to reach a stable output frequency. You may need to add a delay to the start of your program to allow the LCD to start when the clock is running at 40MHz.
Have you set the project options to 40MHz as well as the chip configuration?
Hello Wolfgang
What number were you trying to print out? 255? if so then what if you simply print out a 2 do you get a 3?
Re: LCD Commands @ 40MHz
Posted: Tue Feb 02, 2010 8:06 pm
by saschech@gmx.de
Hello Benj
After modify:
Yes,if i print out 2 i show 3
(The org. lcd macro arrive a "long"time after start)
Regards Wolfgang
Re: LCD Commands @ 40MHz
Posted: Wed Feb 03, 2010 10:32 am
by Benj
Hello Wolfgang
I would check that you can output both a 1 and a 0 to the pin connected to the least significant bit of the LCD data bus. It looks like this is never being cleared and therefore you are getting a 3 (0x33) instead of 2 (0x32).
To confirm this try outputting a capital 'H' (0x48) this should appear on the display as a 'Y' (0x59) if my theory about the pin is correct.
Re: LCD Commands @ 40MHz
Posted: Wed Feb 03, 2010 12:45 pm
by saschech@gmx.de
Hello Benj
I have do > print out number 0x48 i show 73
> print out ascii 0x48 i show Y
Regards Wolfgang
Re: LCD Commands @ 40MHz
Posted: Wed Feb 03, 2010 4:08 pm
by Benj
Hello Wolfgang
Yes this confirms the problem. It sounds like either the data1 pin is connected/specified incorrectly in Flowcode or it is somwhow shorted to +v on your hardware.
Re: LCD Commands @ 40MHz
Posted: Wed Feb 03, 2010 5:23 pm
by saschech@gmx.de
Hello Benj
Forget it,because i have not really a problem,my one lcd macros work well without any change in hard and software.
at last i can not understand,on two different hardware the same bug at the user,
if i gif out "lo " i sho "}<1"..........
Regards Wolfgang
Re: LCD Commands @ 40MHz
Posted: Wed Feb 03, 2010 5:41 pm
by Brian Walsh
Steve,
Here is a terminal program. It's not quite perfect but it exhibits the problem. If you setup the the project for 10MHz with a 10MHz xtal and HS osc it works. If you then setup the project for 40MHz using the same xtal and HSPLL osc it fails as described earlier.
Benj,
Quite a lot goes on in the program before I initialise the LCD. I would be very surprised if the PLL had not stabilised by the time I start the LCD up.
Brian.
ps I posted earlier about enable rx int. Any chance of an answer to that one?
B.