Nokia LCD Progress
jkroylance
Posts: 12
[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??
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
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
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
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 ;-)
Regards,
Quattro
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
'Necessity is the mother of invention'
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
regards,
dro.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
in medio virtus
Glad to be rid of the extra load.
Good on ya [noparse]:)[/noparse]
thx
J
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
"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/
·
Thanks
Oldbitcollector
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
"Two things are infinite: the universe and human stupidity; and I'm not sure about the universe." -Albert Einstein
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.