122x32 GLCD basic code


Closed Thread
Results 1 to 18 of 18
  1. #1
    skimask's Avatar
    skimask Guest

    Default 122x32 GLCD basic code

    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.
    Attached Files Attached Files

  2. #2
    Join Date
    Apr 2006
    Location
    New Hampshire USA
    Posts
    298


    Did you find this post helpful? Yes | No

    Smile No excuses now!

    Hi Ski,
    Nice and useful piece of graphic LCD code.
    Great jumpstart. No excuses for not using graphic LCDs now.
    Thanks,
    -Adam-
    Ohm it's not just a good idea... it's the LAW !

  3. #3
    skimask's Avatar
    skimask Guest


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by Pic_User View Post
    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

  4. #4
    T.Jackson's Avatar
    T.Jackson Guest


    Did you find this post helpful? Yes | No

    Default

    That code is unreadable and a good example on how not to write software.

  5. #5
    skimask's Avatar
    skimask Guest


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by T.Jackson View Post
    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...
    Last edited by skimask; - 25th June 2007 at 05:44.

  6. #6
    Join Date
    May 2004
    Location
    NW France
    Posts
    3,615


    Did you find this post helpful? Yes | No

    Thumbs up Nice work,Ski ... let the dogs bark !!!

    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
    Last edited by Acetronics2; - 25th June 2007 at 10:18.
    ************************************************** ***********************
    Why insist on using 32 Bits when you're not even able to deal with the first 8 ones ??? ehhhhhh ...
    ************************************************** ***********************
    IF there is the word "Problem" in your question ...
    certainly the answer is " RTFM " or " RTFDataSheet " !!!
    *****************************************

  7. #7
    Join Date
    Nov 2003
    Location
    Greece
    Posts
    3,807


    Did you find this post helpful? Yes | No

    Default

    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

  8. #8
    skimask's Avatar
    skimask Guest


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by Ioannis View Post
    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.

  9. #9
    Join Date
    Nov 2003
    Location
    Wellton, U.S.A.
    Posts
    5,924


    Did you find this post helpful? Yes | No

    Default

    Thanks Skimask.

    Saved the code for a later date.
    Dave
    Always wear safety glasses while programming.

  10. #10
    skimask's Avatar
    skimask Guest


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by skimask View Post
    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...
    Attached Files Attached Files

  11. #11
    Join Date
    Jan 2008
    Location
    lincoln uk
    Posts
    20


    Did you find this post helpful? Yes | No

    Unhappy LCD addressing

    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

  12. #12
    skimask's Avatar
    skimask Guest


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by med2007 View Post
    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.

  13. #13
    Join Date
    Nov 2003
    Location
    Wellton, U.S.A.
    Posts
    5,924


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by med2007 View Post
    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
    Code:
    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.
    Dave
    Always wear safety glasses while programming.

  14. #14
    Join Date
    Jan 2008
    Location
    lincoln uk
    Posts
    20


    Did you find this post helpful? Yes | No

    Smile LCD 2x16

    Quote Originally Posted by mackrackit View Post
    If you want "What's up Doc?" (and I will paraphrase from the manual) try this
    Code:
    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.

  15. #15
    Join Date
    Jan 2008
    Location
    lincoln uk
    Posts
    20


    Did you find this post helpful? Yes | No

    Default Using LCD graphic 132x32 display KS0713

    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

  16. #16
    Join Date
    Sep 2004
    Location
    montreal, canada
    Posts
    6,898


    Did you find this post helpful? Yes | No

    Default

    ------ forgive me.. not seems to be compatible after all ------
    Steve

    It's not a bug, it's a random feature.
    There's no problem, only learning opportunities.

  17. #17
    Join Date
    Jan 2008
    Location
    lincoln uk
    Posts
    20


    Did you find this post helpful? Yes | No

    Default GLCD 132x32

    What is not compatible?
    Rgds
    Last edited by med2007; - 21st April 2008 at 08:05. Reason: Wrong item

  18. #18
    skimask's Avatar
    skimask Guest


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by med2007 View Post
    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.

Similar Threads

  1. Code doesn't work on 16F648A
    By Mr_Joe in forum mel PIC BASIC Pro
    Replies: 4
    Last Post: - 1st September 2018, 22:09
  2. 18F4550 Bootloader enter via eeprom setting
    By bradb in forum mel PIC BASIC Pro
    Replies: 3
    Last Post: - 22nd November 2008, 23:51
  3. Making Program Code Space your playground...
    By Melanie in forum Code Examples
    Replies: 15
    Last Post: - 19th July 2008, 08:26
  4. ASM Interrupts with BASIC code?
    By Desterline in forum mel PIC BASIC Pro
    Replies: 0
    Last Post: - 31st October 2003, 19:21
  5. Help with MPASM and PIC Basic
    By johngb in forum mel PIC BASIC Pro
    Replies: 0
    Last Post: - 21st February 2003, 13:07

Members who have read this thread : 2

You do not have permission to view the list of names.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts