Nokia COLOR LCD PicBasicPro 2.50a example code


Closed Thread
Results 1 to 40 of 50

Hybrid View

  1. #1
    skimask's Avatar
    skimask Guest

    Default Nokia COLOR LCD PicBasicPro 2.50a example code

    Some basic example code for the Nokia Color LCDs found in a lot of cellphones.
    Basic code, prints text, in up 256 colors (out of 4096 possible, and the controller/firmware is actually capable of 18 bit color, but I can't tell the difference), clear screen, a method for printing variables (bits, bytes, words, and longs), x/y plotting, etc.

    The code with all of the neat graphic functions like circles, lines, boxes, waves, etc. will be here eventually.

    Cut and paste this into eBay's search bar to find LCDs that are compatible with this code:

    nokia -6620 -6230 -6061 -3220 -73* -n9* -52* -77* -6500 -57* -53* -88* -6101 -6126 -6265 -6680 -e6* -6288 -n7* -6133 -8600 -6300 -6230i -6010 -5610 -9300 -3310 -5110 -8810 -n8* -3250 -5500 -6111 -6280 -8850 -6120 -3360 -6360 -6600 -3230 -8210 -e90 -n93 -e5* -1110 -8910

    Sparkfun also has these displays:
    http://www.sparkfun.com/commerce/pro...roducts_id=569

    And check out sparkfun for adapter boards to plug it in:
    http://www.sparkfun.com/commerce/pro...roducts_id=600

    And the connector if you want to plug it in yourself somehow: (also available at Digikey and Mouser, just have to search for it)
    http://www.sparkfun.com/commerce/pro...roducts_id=570
    Code is originally written for a PIC18F4620 running at 40Mhz. If the LCD is mounted close, and you're relatively sure the signal is strong, you can get rid of the extra sdata lines in the togglesclock block to make writing to the LCD much faster. I had to add the extra 'delay' because my LCD was connected to the PIC on a 6ft cable.

    The font table requires a PIC with 1K of EEPROM (the basic font table will fit in 512 bytes, ASCII 0 thru 127), so the PIC choices are a bit limited in that respect. This font table is copied into RAM on startup so it can be easily modified if needed. Or I suppose a person could easily change the code to put the table into program memory easily enough and read it out from there.
    Attached Files Attached Files
    Last edited by skimask; - 16th February 2008 at 09:40.

  2. #2
    skimask's Avatar
    skimask Guest


    Did you find this post helpful? Yes | No

    Default Nokia LCD in operation

    Picture of my Nokia color LCD mounted (ok, zip-tied) in an old, dead, handheld GPS unit.
    Only basic text is shown in this picture along with a few colors. The program the PIC is running at this moment only displays white, blue, and green. It would display some reds if the parameters were out of tolerance, it's in simulation mode so everything is good.
    The white blob in the middle is actually reversed text, supposed to read 'MIL', but you can't see it because of the camera angle. It's readable, just not to the camera. The white blob towards the bottom right is a better view of reversed text, somewhat visible. In this case it says P0999, a test code for my program.
    The graphics routine code is coming along, just not fast. The code I've got now is one big kludge of math and takes entirely too long to execute, even with an 18F4620 @ 40Mhz.
    After I get that sorted out, I'm going to try a bit of 3D. A bit tough with the ram limitations of a PIC, but we'll see what happens.
    <IMG SRC="http://www.picbasic.co.uk/forum/attachment.php?attachmentid=2370&stc=1&d=120332286 8">

    (In case anybody's wondering (top to bottom, left to right), that's: Intake Air Temp, Coolant Temp, Manifold Air Pressure, Timing Advance, RPM, Air/Fuel Ratio, Calculated Load Value, Miles per Hour, Volumetric Efficiency, Throttle Position, Fuel System Status, Battery Voltage, Engine Size, OBD PID mask for $01-$20, short/long term trims, 3 test characters, MIL indicator, system run time, keypress, loop count, current menu, event record, engine run time, odometer, mpg (mass air), mpg average (mass air), mpg (calculated from map/iat/rpm/cid), mpg average (calculated from map/iat/rpm/cid), mpg calculated from odo vs. fuel used, mass air flow from sensor, mass air flow (calculated from map/iat/rpm/cid), gallons per hour, fuel used total, cost per minute, cost per gallon, miles remaining on tank, fuel tank level, vehicle weight, diagnostic/information messages...... A lot of information for one screen. Can anybody guess what I'm building and how many colons it took to write the code? )
    Attached Images Attached Images  
    Last edited by skimask; - 18th February 2008 at 08:31.

  3. #3
    Join Date
    Oct 2004
    Location
    North Norfolk UK
    Posts
    146


    Did you find this post helpful? Yes | No

    Default

    and how many colons it took to write the code? )
    well……..as a guide there are 336 characters on the screen of which some 25 are :colons… roughly about 8%

    so with a couple of thousand words …….


    I wasn’t expected to actually count them……………… was I? I’m not falling for that trick again.

    Anyway I am on for ripping some phones apart, so thanks for the insight, to drive these units.
    Although at the moment I am in the middle of part mining an autofeeder minolta colour photocopier.
    Does that laser scanner motor really spin at 165,000rpm. What can I use that for? A colon detector maybe??


    I am thinking of a colon expander/compounder reformatting macro…., for printing purposes

    Look after your health… look after your colons

    Wouldn't be able to cope without mine!

  4. #4
    skimask's Avatar
    skimask Guest


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by duncan303 View Post
    well……..as a guide there are 336 characters on the screen of which some 25 are :colons… roughly about 8%
    so with a couple of thousand words …….
    I wasn’t expected to actually count them……………… was I? I’m not falling for that trick again.
    In my last bit of code that runs that particular program shown in the picture, the code has 2,057 lines as it stands right now....and 2,324 colons! (I used MS WORD, did a Cntrl-H replace for the colons and that's the number that WORD said it replaced.

    Anyway I am on for ripping some phones apart, so thanks for the insight, to drive these units.
    Although at the moment I am in the middle of part mining an autofeeder minolta colour photocopier.
    Does that laser scanner motor really spin at 165,000rpm. What can I use that for? A colon detector maybe??
    I am thinking of a colon expander/compounder reformatting macro…., for printing purposes
    Look after your health… look after your colons
    Wouldn't be able to cope without mine!
    Ripping - I've got a few 'dead' phones that I've collected myself. Those LCDs are pretty much the same, slightly different, pretty much based on the same coding. But the Nokia types are the cheapest by far.
    Scanner motor - 165,000 rpm? I'd doubt that. Maybe if the mirror is multi-faceted, they're actually multiplying the RPM times the number of facets... But yes, I suppose you could use it for a combination colon detector/driller...
    Colon Expander/Compounder - I was at a local truck stop over the weekend. I think I was fed a combination 'Colon Expander/Compounder', although I didn't become aware of it until a day or two later.

  5. #5
    Join Date
    Nov 2003
    Location
    Sao Paulo - Brazil
    Posts
    92


    Did you find this post helpful? Yes | No

    Default

    Hi Skimask,

    about one year ago I bought SparkFun´s Nokia COlo LCD + Adapter Board (plus aditional connectors). The board is nice, but the Connector soldered into it is really fragile. after some use, the connector broke up and I had to solder a new one on the board. An Advice for new buyers : use a double-sided tape to hold your display on the board.

    After some fails trying to put it working (just got de backlight on and nothing) I gave up for a while.

    I was using a 16F877 @ 10 Mhz justo to make some testes.

    Last Monday I saw your post here. So, I got it and tried to compile it (setting the MCSP to work with the 18F4620), but got some errors due to some missing variables, like "font", "digcount" and "offset" for example.

    Is this source to be used as an Include and I have to do some work to complement it or I am missing something else ?

    I´m sorry for this stupid (?) question...

  6. #6
    skimask's Avatar
    skimask Guest


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by srspinho View Post
    Last Monday I saw your post here. So, I got it and tried to compile it (setting the MCSP to work with the 18F4620), but got some errors due to some missing variables, like "font", "digcount" and "offset" for example.
    Is this source to be used as an Include and I have to do some work to complement it or I am missing something else ?
    I´m sorry for this stupid (?) question...
    That's what I get for shaving down another program and posting it, in a hurry no less...
    I'll check what I posted and get a new file up there when I get a chance...figure by the weekend for sure.

    In the meanwhile,

    font var byte[1024]
    used to hold the whole font which is copied out of eeprom into internal ram. If your PIC doesn't have 1024 available RAM, you can't use this example. In fact, your PIC MUST have 1024 RAM and at least 512 EEPROM available. When I get a chance, I'll post a 2nd version that won't require copying the font out of EEPROM, thereby won't require 1024 free ram.

    digcount var byte
    used in the clcddigout routine to output a number, sorta like "lcdout DEC variable"
    if the number in the variable is $ffff, and you used digcount = 5, the output will be 65535, if you used digcount = 4, the output will be 5535, digcount = 2, output will be 35, and so on.

    offset var byte
    used in the clcddigout routine to specify a starting digit to output,
    offset=0 means the whole thing,
    offset=1 means starting from the 10's digit,
    offset=2 means starting from the 100's digit, and so on...

    Let me know if/when you get it working for you...and like I said, I'll double-check that file I posted.

Similar Threads

  1. Reading in Manchester code
    By brid0030 in forum Code Examples
    Replies: 0
    Last Post: - 10th March 2009, 21:55
  2. How much code space do PBP statements use.
    By Darrel Taylor in forum Code Examples
    Replies: 5
    Last Post: - 13th February 2009, 21:31
  3. Loop with two motor and 2 sensors
    By MrRoboto in forum mel PIC BASIC
    Replies: 4
    Last Post: - 8th December 2008, 23:40
  4. Making Program Code Space your playground...
    By Melanie in forum Code Examples
    Replies: 15
    Last Post: - 19th July 2008, 08:26
  5. PicBasicPro Code help!
    By michel in forum mel PIC BASIC Pro
    Replies: 3
    Last Post: - 14th June 2008, 15:43

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