PDA

View Full Version : 122x32 GLCD basic code



skimask
- 24th June 2007, 22:55
Wrote this code for a 122x32 graphic LCD, based on a SED1520 controller. (bought it at www.lcdmodkit.com)

Basic functionality, clear screen, x/y point set/reset, a few text functions with most of the visible ASCII set supported, and some of the non-visible characters changed to things like a full/half/empty battery indicator, bargraphs, and so on.
Works very well, as long as you've got a CLEAN 5v power supply. The LCD I've got doesn't like messy 5v, doesn't startup too well.

As with all things, Y.M.M.V.

Pic_User
- 24th June 2007, 23:37
Hi Ski,
Nice and useful piece of graphic LCD code.
Great jumpstart. No excuses for not using graphic LCDs now.
Thanks,
-Adam-

skimask
- 24th June 2007, 23:55
Hi Ski,
Nice and useful piece of graphic LCD code.
Great jumpstart. No excuses for not using graphic LCDs now.
Thanks,
-Adam-

'bout time I did something useful eh? :)
Speaking of useless...I'm heading outside in a couple of minutes to see if I can let the smoke out of the ECM in my '01 Dodge Ram1500 with a couple of PICs...
If all goes well, I won't be asking anybody for a ride to work tomorrow :D

T.Jackson
- 25th June 2007, 04:53
That code is unreadable and a good example on how not to write software.

skimask
- 25th June 2007, 05:51
That code is unreadable and a good example on how not to write software.

You obviously must mean that it is unreadable because it doesn't meet your HIGH publishing standards...RIGHT?

Unless I missed something in the translation, I don't remember putting anything in the attached file or the original post about meeting TRENT's HIGH STANDARDS...or meeting any standard at all.

It meets my standards, and anybody that wants to use it can easily modify it to suit their own needs and/or standards.

And now...I hereby strictly FORBID YOU, TRENT, from using that GLCD code in anything you do, now or in the future, or in any other endeavour that you, in any part, or in whole, may be involved in.

So, to that end:
Any resemblance to real persons, living or dead is purely coincidental.
Void where prohibited.
Some assembly required.
Batteries not included.
Contents may settle during shipment.
Use only as directed.
No other warranty expressed or implied.
Do not use while operating a motor vehicle or heavy equipment.
Postage will be paid by addressee.
Subject to CAB approval.
This is not an offer to sell securities.
Apply only to affected area.
May be too intense for some viewers.
Do not stamp.
Use other side for additional listings.
Do not spindle, fold, or otherwise multilate.
For recreational use only.
Do not disturb.
All models over 18 years of age.
If condition persists, consult your physician.
No user-serviceable parts inside.
Freshest if eaten before date on carton.
Subject to change without notice.
Times approximate.
Simulated picture.
No postage necessary if mailed in the United States.
Breaking seal constitutes acceptance of agreement.
For off-road use only.
As seen on TV.
One size fits all.
Many suitcases look alike.
Contains a substantial amount of non-tobacco ingredients.
Colors may, in time, fade.
We have sent the forms which seem to be right for you.
Slippery when wet.
For office use only.
Not affiliated with the American Red Cross.
Drop in any mailbox.
Edited for television.
Keep cool; process promptly.
Post office will not deliver without postage.
List was current at time of printing.
Return to sender, no forwarding order on file, unable to forward.
Not responsible for direct, indirect, incidental or consequential damages resulting from any defect, error or failure to perform.
At participating locations only.
Not the Beatles.
Penalty for private use.
See label for sequence.
Substantial penalty for early withdrawal.
Do not write below this line.
Falling rock.
Lost ticket pays maximum rate.
Your canceled check is your receipt.
No substitutions.
Shoes and shirts required.
Management not responsible for lost articles.
If rash appears discontinue use.
For external use only.
Children under 18 must be accompanied by an adult.
Fasten seatbelt.
Add toner.
Place stamp here.
Avoid contact with skin.
Sanitized for your protection.
Ribbed for your pleasure.
Ribbed for her pleasure.
Be sure each item is properly endorsed.
Sign here without admitting guilt.
Slightly higher west of the Mississippi.
Employees and their families are not eligible.
Void in Alaska and Hawaii.
Beware of dog.
Contestants have been briefed on some questions before the show.
Limited time offer, call now to insure prompt delivery.
You must be present to win.
No passes accepted for this engagement.
No purchase necessary.
Processed at location stamped in code at top of carton.
Shading within a garment may occur.
Use only in well-ventilated area.
Keep away from fire or flame.
Replace with same type.
Approved for veterans.
Booths for two or more.
Check here if tax deductible.
Some equipment shown is optional.
Price does not include taxes.
Price includes taxes.
No Canadian coins.
Not recommended for children.
Prerecorded for this time zone.
Reproduction strictly prohibited.
No solicitors.
No alcohol, dogs, or horses.
No anchovies unless otherwise specified.
Restaurant package, not for resale.
List at least two alternate dates.
First pull up, then pull down.
Call toll free before digging.
Driver does not carry cash.
Some of the trademarks mentioned in this product appear for identification purposes only.
Record additional transactions on back of previous stub.
Do not attempt this at home.
This page intentionally left blank.
Do not remove this tag under penalty of law.
No Tipping Please.
Driver carries $20.00 or Less.
I'll never drink again.
Children please get your parents permission before calling.
May contain unverified food products.
Do not place metal inside oven.
Objects in mirror may be closer than they appear.
Ladies please remove your hats.
This product is meant for educational purposes only.
List each check separately by bank number.
Tail light warrant applies.
This supersedes all previous notices.

There...that should just about cover it...
Oh...
Checks in the mail...

Acetronics2
- 25th June 2007, 11:15
Hi, Skimask

Wonderful ... my GLCD is SED 1520 Driven !!!

Do NOT listen to those dicoursing upon the "being of the future" ... just IGNORE them ...

I'd really like Guns, scissors, knives and others weapons being left outside this forum 'cause it becomes really boring ( I think to EVERY "Forum Warrior" here and there ...)

Everyone bringing some BrainFood here is Welcome ... even with little errors ... but NOT if looking for a little genius standing.

And Moreover, If your code is a bit "uncommented" ... It's a good thing to try to understand what you've done, ... we do not sell magazines,here, and every reader doesn't have to feel a genius !!!

don't you think this little understanding effort shouldn't be compulsory ???

I did like your last mail ... I've laughed a lot !!!


Why not ask our Forum Owners to create the "Midnight bar" where Drunk ones or those having smoked too much "illegals" could "freely" post their angers or fears ??? ... and where unfair posts could be re-directed.

read you soon

Alain

Ioannis
- 26th June 2007, 11:37
Well, I suppose that Trent does not like the style Skimask is using in his programms (many colons in the line). That style may shortens the length of the text on the screen but may also make it hard to understand it.

Anyway, every contribution is most welcome as it helps in advancing our skills on areas never been before.

So thanks Skimask for that.

Also Trent has contributed a lot in the forum with his offers and another thanks goes to him also. So I take his remark as infelicitous (is it correct word ?) and really pass it by.

Ioannis

skimask
- 26th June 2007, 19:55
Well, I suppose that Trent does not like the style Skimask is using in his programs (many colons in the line). That style may shortens the length of the text on the screen but may also make it hard to understand it.
Ioannis

And that's the only reason I do it that way. I absolutely hate scrolling up and down and up and down to see different chunks of code. In fact, I hate it so much, my 2nd screen is mounted sideways and rotated in 90 left in Windows just for that reason, much more like portrait instead of a landscape.

mackrackit
- 27th June 2007, 04:51
Thanks Skimask.

Saved the code for a later date.

skimask
- 15th February 2008, 19:43
Wrote this code for a 122x32 graphic LCD, based on a SED1520 controller. (bought it at www.lcdmodkit.com)
Basic functionality, clear screen, x/y point set/reset, a few text functions with most of the visible ASCII set supported, and some of the non-visible characters changed to things like a full/half/empty battery indicator, bargraphs, and so on.
Works very well, as long as you've got a CLEAN 5v power supply. The LCD I've got doesn't like messy 5v, doesn't startup too well.
As with all things, Y.M.M.V.

I modified the code I posted back in Post #1 to handle 128 x 64 graphic LCDs, which, even though based on a different controller chip, seem to respond to the same basic command set.

THIS IS TOTALLY UNTESTED CODE! All I did was modify my old SED1520 code according to a datasheet from another thread and a couple of other datasheets I found from a quick search. I do NOT have any 128 x 64 LCDs on hand...I am NOT able to test this code.

I will gladly take some feedback to get this code working...(and stand by for the sweet Nokia knock off color LCD code coming some time this weekend)

If it doesn't work...Refer to Post #5 of this thread...

med2007
- 17th February 2008, 14:52
Can't find where else to put this query in the forum and my LCD searches produce nothing....but I'm having trouble addressing 2x16 LCD.

Do you have to put delay before every LCDOUT command or just after switch-on?

I have read the book over and over and still cannot reliably put characters in the right place on the display.
I sometimes have to use umpteen white space characters to get it right..like
LCDOUT $fe,1," What's up Doc?"
and when the LCDOUT is in a FOR-Next loop it screws up the placement of characters as well and in a random fashion?
Anybody?
Rgds

skimask
- 17th February 2008, 22:25
Can't find where else to put this query in the forum and my LCD searches produce nothing
http://www.picbasic.co.uk/forum/showthread.php?t=4751


Do you have to put delay before every LCDOUT command or just after switch-on?
Initial power up.


I have read the book over and over and still cannot reliably put characters in the right place on the display. I sometimes have to use umpteen white space characters to get it right..like
LCDOUT $fe,1," What's up Doc?"
and when the LCDOUT is in a FOR-Next loop it screws up the placement of characters as well and in a random fashion? Anybody?
Rgds
Might have to increase your LCD_COMMANDUS and LCD_DATAUS values a bit. If the values are too small, the LCD might not be able to respond quick enough, and cause random screwups.

mackrackit
- 18th February 2008, 02:49
I have read the book over and over and still cannot reliably put characters in the right place on the display.
I sometimes have to use umpteen white space characters to get it right..like
LCDOUT $fe,1," What's up Doc?"
and when the LCDOUT is in a FOR-Next loop it screws up the placement of characters as well and in a random fashion?
Anybody?
Rgds

If you want "What's up Doc?" (and I will paraphrase from the manual) try this


LCDOUT $FE,1 'Clears the screen
LCDOUT $FE,80+4,"What's up Doc?" 'Starts at line 1 four places right

No white spaces and reliable. Works the same for other lines too. $C0 is the second line --$C0+3 would be the second line 3 places to the right.

remember that 80+4 = 84 :) so $FE,84 works.

med2007
- 18th February 2008, 17:39
If you want "What's up Doc?" (and I will paraphrase from the manual) try this


LCDOUT $FE,1 'Clears the screen
LCDOUT $FE,80+4,"What's up Doc?" 'Starts at line 1 four places right

No white spaces and reliable. Works the same for other lines too. $C0 is the second line --$C0+3 would be the second line 3 places to the right.

remember that 80+4 = 84 :) so $FE,84 works.

Seem to be doing better now, so thanks for that. At least I've been able to package my project as a demo at last, it's only taken a month to design my Single Event Data Logger
with LCD display.

med2007
- 20th April 2008, 17:16
I have a few of 132x32 LCD modules which use a KS0713 controller.
Does someone have some simple PICBasic Pro code I could try out on one of them.
I have used 2x20 displays OK but want to expand my knowledge a bit.
Much appreciated
Mike, med2007

mister_e
- 20th April 2008, 17:24
------ forgive me.. not seems to be compatible after all ------

med2007
- 21st April 2008, 09:04
What is not compatible?
Rgds

skimask
- 21st April 2008, 18:46
What is not compatible?
Rgds

Looks like they're compatible enough....maybe just not for your SPECIFIC application.
The commands have basically the same bit patterns. There will need to be some changes in the source code because of the different numbers of pixels (122 vs. 132), but otherwise, it looks to be pretty much the same sort of thing.