LCD Commands @ 40MHz
Moderator: Benj
-
- Posts: 29
- Joined: Thu Jan 14, 2010 10:43 pm
- Has thanked: 3 times
LCD Commands @ 40MHz
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.
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.
-
- Posts: 714
- Joined: Wed Jan 31, 2007 12:41 pm
- Has thanked: 1 time
- Been thanked: 26 times
Re: LCD Commands @ 40MHz
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
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
- 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 Commands @ 40MHz
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?
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?
Regards Ben Rowland - MatrixTSL
Flowcode Product Page - Flowcode Help Wiki - Flowcode Examples - Flowcode Blog - Flowcode Course - My YouTube Channel
Flowcode Product Page - Flowcode Help Wiki - Flowcode Examples - Flowcode Blog - Flowcode Course - My YouTube Channel
-
- Posts: 714
- Joined: Wed Jan 31, 2007 12:41 pm
- Has thanked: 1 time
- Been thanked: 26 times
Re: LCD Commands @ 40MHz
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
After modify:
Yes,if i print out 2 i show 3
(The org. lcd macro arrive a "long"time after start)
Regards Wolfgang
- 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 Commands @ 40MHz
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.
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.
Regards Ben Rowland - MatrixTSL
Flowcode Product Page - Flowcode Help Wiki - Flowcode Examples - Flowcode Blog - Flowcode Course - My YouTube Channel
Flowcode Product Page - Flowcode Help Wiki - Flowcode Examples - Flowcode Blog - Flowcode Course - My YouTube Channel
-
- Posts: 714
- Joined: Wed Jan 31, 2007 12:41 pm
- Has thanked: 1 time
- Been thanked: 26 times
Re: LCD Commands @ 40MHz
Hello Benj
I have do > print out number 0x48 i show 73
> print out ascii 0x48 i show Y
Regards Wolfgang
I have do > print out number 0x48 i show 73
> print out ascii 0x48 i show Y
Regards Wolfgang
- 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 Commands @ 40MHz
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.
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.
Regards Ben Rowland - MatrixTSL
Flowcode Product Page - Flowcode Help Wiki - Flowcode Examples - Flowcode Blog - Flowcode Course - My YouTube Channel
Flowcode Product Page - Flowcode Help Wiki - Flowcode Examples - Flowcode Blog - Flowcode Course - My YouTube Channel
-
- Posts: 714
- Joined: Wed Jan 31, 2007 12:41 pm
- Has thanked: 1 time
- Been thanked: 26 times
Re: LCD Commands @ 40MHz
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
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
- Attachments
-
- lcd.PNG
- (105.76 KiB) Downloaded 1940 times
-
- Posts: 29
- Joined: Thu Jan 14, 2010 10:43 pm
- Has thanked: 3 times
Re: LCD Commands @ 40MHz
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.
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.
- Attachments
-
- learning6.fcf
- (15.65 KiB) Downloaded 345 times