Shop OBEX P1 Docs P2 Docs Learn Events
Nokia LCD Progress — Parallax Forums

Nokia LCD Progress

jkroylancejkroylance Posts: 12
edited 2007-04-14 21:10 in Propeller 1
[noparse][[/noparse]Continued from http://forums.parallax.com/forums/default.aspx?f=25&m=174598]

I've been playing with this LCD and code for it, and I tried myself to merge the SPI routines into it and use them instead of the Spin ones. After driving myself nuts for several hours trying to figure out why the LCD works with the Spin code and not with SPI, I stumbled across something: If you issue the very first command to the LCD using the Spin shiftout code (even if it's not a valid command), then start using the faster SPI code, the LCD works fine, and is much faster. Only problem is I can't stand wasting that amount of space on code that's used just once. Attached is an archive of the version I got to work... This is my first attempt at working with propeller programming, so please excuse the sloppiness of the code. I commented alot out as I was tweaking things trying to figure out why it wouldn't work. Hopefully it still makes sense.

Nokia Test.spin (top object file)
-NokiaLCD.spin
--SPIEngine.spin

The part I was messing with is in NokiaLCD.spin toward the bottom of the file in InitLCD, there's a SendSpcCommand() call which calls the Spin shiftout routines to send a $00 to the LCD, then everything's SPI after that. My LCD works fine like this, but if you change SendSpcCommand() to SendCommand() (or even just comment out the whole line), the LCD is unresponsive.

Anyone have any ideas??

Comments

  • JelloJello Posts: 9
    edited 2007-04-12 15:20
    Hi jkroylance,
    Thanks for the info. The·whole nokia lcd thing·seems to be a dead topic in here. It's not fresh and exciting·enough I guess. Oh well. Some topics (and people) are like that.
    Anyway. I managed to get my Nokia LCD·(Philips controller) code working with the spi engine without having to first use the spin shiftout. I will have to do a diff on my code to see what I changed to get it to do it. I think it might have been a simple wait or a no-operation command after initiaization or something. (it's still not·fast enough, needs more tweekage).
    I will do a diff and let you know what I did to make it work.

    <edit> checked my code and i am still·doing the blasted spin shift out first! nuts! sorry.

    Cheers,
    J

    Post Edited (Jello) : 4/12/2007 10:24:23 PM GMT
  • simonlsimonl Posts: 866
    edited 2007-04-12 15:35
    Hey folks, don't get disheartened; there are still people watching (like me) who've not YET got the Nokia LCD - but your code will still be very useful when we do wink.gif

    Thanks for posting [noparse]:)[/noparse]

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Cheers,

    Simon

    BTW: I type as I'm thinking, so please don't take any offense at my writing style smile.gif

    www.norfolkhelicopterclub.co.uk
    You'll always have as many take-offs as landings, the trick is to be sure you can take-off again ;-)
  • QuattroRS4QuattroRS4 Posts: 916
    edited 2007-04-12 15:57
    Agreed Simonl ... Also Elektor has an application this month on that very topic - slide show from an SD card - to an LCD...

    Regards,
    Quattro

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    'Necessity is the mother of invention'
  • QuattroRS4QuattroRS4 Posts: 916
    edited 2007-04-12 16:10
    In the interests of progress ... see attached ...So who will be the first to do this on a Prop. ??? The preverbial Gauntlet has been laid down ...

    This example shows a siemens C60 LCD ... I seem to remember details of a Nokia somewhere - if it is of any help I can certainly search for it..


    Regards,
    Quattro

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    'Necessity is the mother of invention'

    Post Edited (QuattroRS4) : 4/12/2007 4:16:14 PM GMT
  • inserviinservi Posts: 113
    edited 2007-04-12 18:57
    Hello, I also just received 3 lcd Nokia for test. I will test they when i finished the actual job.

    regards,
    dro.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    in medio virtus
  • jkroylancejkroylance Posts: 12
    edited 2007-04-13 18:41
    Ok, tweaking this code over lunch I think I fixed the problem. I added a few lines to set the data line low and toggle the clock before sending the first command and that seems to have fixed the problem! No more slow shiftout routine! If someone who has one of these would like to try it & make sure it works, let me know! Here's the file again, same name though SPI fully works and the old spin Shiftout routine has been commented out.
  • JelloJello Posts: 9
    edited 2007-04-13 23:05
    Brilliant! Works for me!
    Glad to be rid of the extra load.
    Good on ya [noparse]:)[/noparse]

    thx
    J
  • jkroylancejkroylance Posts: 12
    edited 2007-04-13 23:36
    It's kinda messy, I'll try to clean it up some and repost it. Good to hear it works for someone other than me.
  • ALIBEALIBE Posts: 299
    edited 2007-04-14 11:32
    it works for me w/ my Nokia LCD as well. It renders much faster than w/ my earlier trials and code. Thanks

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    "any small object, accidentally dropped, goes and hides behind a larger object."

    ·
    ALIBE - Artificial LIfe BEing. In search of building autonoumous land robot
    http://ALIBE.crosscity.com/
    ·
  • Oldbitcollector (Jeff)Oldbitcollector (Jeff) Posts: 8,091
    edited 2007-04-14 16:51
    Direction for the hardware details and connection for this project?

    Thanks
    Oldbitcollector

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    "Two things are infinite: the universe and human stupidity; and I'm not sure about the universe." -Albert Einstein
  • jkroylancejkroylance Posts: 12
    edited 2007-04-14 21:10
    I'm using a Sparkfun Nokia Knockoff LCD www.sparkfun.com/commerce/product_info.php?products_id=569 with the Sparkfun Nokia LCD carrier board www.sparkfun.com/commerce/product_info.php?products_id=600. I am using the 6-pin header on the board, +Vin to propeller VDD, CS to pin 6, SCLK to pin 7, SDATA to pin 8, RST to pin 9. It looks like some people in the original post on this LCD http://forums.parallax.com/showthread.php?p=634700 put resistors inline with their data pins, however I did not, and have not experienced any problems so far (been poking around with this for a month or so).

    Note: In the NokiaLCD.spin file I had started adding in stuff to plot letters onto the screen, though I think I only got 4 done (enough to write "HELLO" when I was testing). If you don't need them, you can remove them and probably save some space.

    Eventually I'd like to dissect the SPI engine and move only the SHIFTOUT assembly code I use into the NokiaLCD to further reduce its size.
Sign In or Register to comment.