AMcTools Forum 
  HomeHelpSearchLogin  
 
Pages: 1 2 
Send Topic Print
KS0108B Graphic LCD (Read 59234 times)
mrkaras_
YaBB Newbies
*
Offline

I Love YaBB 2!

Posts: 18

KS0108B Graphic LCD
08/14/09 at 12:52:08
 
this is intended to simulate a KS0108B based 128*64 graphic LCD with a blue backlight. connect LED+ to 5v or it will be hard (not impossable) to see anything (the background is dark with the backlight off). a lot of the operation is based of the simulator at http://www.geocities.com/dinceraydin/djgfxlcdsim/djgfxlcdsim.html, if its wrong mine probably is too.

add this to your project:

;                                         RS  RW  E   |<---        data         --->| CS1 CS2 /RST LED+ LED-
XGraphicLCD1 _GraphicLCD PD1 PD4 PD5 PC7 PC6 PC5 PC4 PC3 PC2 PC1 PC0 PD6 PD7  VDD vin  VSS


status:
all instructions implamented
reset does not properly clear the LCD due to what seem to be a VMLAB bug - may be fixed later
not very well tested

I don't have an actual phisical LCD yet, so hopefully this simulation is close enough. perhaps somebody with one can see if it matches (and maybe fix it if it doesn't or at least let me know where I made it wrong)
Back to top
 
  IP Logged
ThVortex
Global Moderator
*****
Offline



Posts: 160
Austin, TX, USA
Gender: male
Re: KS0108B Graphic LCD
Reply #1 - 08/14/09 at 16:54:10
 
Hey, that's pretty cool! I had a quick look at your code and I noticed:

[tt]      //commented because it crashes VMlab when the componant is removed (ctrl+u) after running
     //for(int x=0;x<128;x++)
     //      for(int y=0;y<128;y++)
     //            VAR(LCDData[x][y]) = 0;[/tt]

But your array was declared as:

[tt]      bool LCDData[128][64];[/tt]

Maybe that was causing the crash?
Back to top
 
 
WWW   IP Logged
ThVortex
Global Moderator
*****
Offline



Posts: 160
Austin, TX, USA
Gender: male
Re: KS0108B Graphic LCD
Reply #2 - 08/14/09 at 17:46:21
 
By the way, if anyone is in need of an ultra-small LCD font, here is a barely readable 4x6 font that I drew a while back. It contains all of the old [url=http://en.wikipedia.org/wiki/Code_page_437]IBM-PC[/url] characters. I'm putting it into the public domain so it's free for any use.
Back to top
 
WWW   IP Logged
mrkaras_
YaBB Newbies
*
Offline

I Love YaBB 2!

Posts: 18

Re: KS0108B Graphic LCD
Reply #3 - 08/16/09 at 02:10:43
 
thanks, your absolutly right, now that you point it out like that that seems to be exactly the reason for the crash. I changed the code and tested it and it did not crash anymore. still a minor VMlab bug in that its not soposed to crash when user componants do, but I always suspected it was my code being broken.

fixed version uploaded.
this version does clear the LCD at simulation start
Back to top
 
  IP Logged
mrkaras_
YaBB Newbies
*
Offline

I Love YaBB 2!

Posts: 18

Re: KS0108B Graphic LCD
Reply #4 - 08/29/09 at 14:22:05
 
Ok, now a much faster and debuged version thanks to some of my own work but mostly to changes made by ThVortex.
Back to top
 
  IP Logged
moderator
YaBB Administrator
*****
Offline

I love forums, don't
you?

Posts: 308
AMcTools (Spain)
Gender: male
Re: KS0108B Graphic LCD
Reply #5 - 09/01/09 at 18:55:40
 
Hi,

Some comments and suggestions:

This is a very interesting cell, why don't include also in the website that ThVortex has created, dedicated to VMLAB user cells:

http://sites.google.com/site/thvortex/vmlab


Do you authorize as well us to iclude this stuff, in the LPGL terms, in the next rel 3.15? If yes, maybe you can add some text in the header, mentioning you as author, LPGL terms etc.

And last, have you tried this cell with the new test releases? 3.14x. Note that some bugs have been corrected + some improvements that can make your code more effective (see threads).

Regards
Back to top
 
 
WWW   IP Logged
mrkaras_
YaBB Newbies
*
Offline

I Love YaBB 2!

Posts: 18

Re: KS0108B Graphic LCD
Reply #6 - 09/02/09 at 08:52:25
 
I would be happy for you to include this in your next release, I will find out what I need to put in the headers as far as terms go. I am aware of thvortex's site, and if they want it on there site then feels free to put it there, I may build som of the sugusted SPI componants listed there later aswell, because I have already got SPI working in my new componant.

I need to check the display works with the new VMlab, last time I tried I found something else didn't seem to work, I will look into it and get back to you.
Back to top
 
 
  IP Logged
ThVortex
Global Moderator
*****
Offline



Posts: 160
Austin, TX, USA
Gender: male
Re: KS0108B Graphic LCD
Reply #7 - 09/02/09 at 16:54:05
 
I've been testing the LCD component in 3.14H and it was working fine for me. When 3.15 is officially released I'll make some further improvements to allow multiple instances of the component (right now VAR() will cause problems if used from WndProc() with more than one instance) and to "batch" multiple window updates together using the new On_update_tick() so it runs even faster.

By the way, I think the user "rich" may already be working on a SPI monitor/tty component. You may want to check with him if that's what you were thinking about doing.
Back to top
 
 
WWW   IP Logged
mrkaras_
YaBB Newbies
*
Offline

I Love YaBB 2!

Posts: 18

Re: KS0108B Graphic LCD
Reply #8 - 10/06/09 at 09:17:09
 
just updated the headers (LGPL stuff)
Back to top
 
  IP Logged
moderator
YaBB Administrator
*****
Offline

I love forums, don't
you?

Posts: 308
AMcTools (Spain)
Gender: male
Re: KS0108B Graphic LCD
Reply #9 - 10/07/09 at 08:01:05
 
Thanks!  I have included it in the distribution package that will be released immediately.

Just one comment for all the users: in order to make your examples more portable, please code the "blackbox" inlcude as:

#include <blackbox.h>

or

#include ""..\\bin\\blackbox.h"

I prefer the 2nd style, since it will be understood by the compiler even without modifying the include search path.

I have made this small change in your code.
Back to top
 
 
WWW   IP Logged
DreamCat
Junior Member
**
Offline

I love electronic!

Posts: 63

Re: KS0108B Graphic LCD
Reply #10 - 11/05/09 at 07:37:33
 
thanks...

I can only download from here, my county blocked I access googsite, though I access my own googsite page. so I need access it via the vpn proxy.
Back to top
 
 
  IP Logged
moderator
YaBB Administrator
*****
Offline

I love forums, don't
you?

Posts: 308
AMcTools (Spain)
Gender: male
Re: KS0108B Graphic LCD
Reply #11 - 11/05/09 at 08:55:03
 
This cell is included anyway in the distribution package for 3.15. You don't have even to download it !
Back to top
 
 
WWW   IP Logged
DreamCat
Junior Member
**
Offline

I love electronic!

Posts: 63

Re: KS0108B Graphic LCD
Reply #12 - 11/06/09 at 15:44:35
 
yeah, I saw..  :D
Back to top
 
 
  IP Logged
ThVortex
Global Moderator
*****
Offline



Posts: 160
Austin, TX, USA
Gender: male
Re: KS0108B Graphic LCD
Reply #13 - 11/13/09 at 00:08:55
 
I made some updates to the graphics LCD component. The attached .zip file also includes a demo .prj file and two .hex files which make use of the LCD. The major changes are:

1. The GUI layout is more compact to save window space in the Control Panel and it more closely resembles other VMLAB components (e.g. registers display "$??" when the simulation is not running).

2. Multiple instances of the component will work correctly now. This is useful for simulating larger 128x128 and 192x64 displays.

3. The GUI re-draws less frequently now to get a little bit more performance. The GUI refresh rate can be adjusted in the menu: Options -> Display Control -> Windows refresh -> Registers / Peripherals.

Features that I plan to add in the future:

1. A "Log" and "Break on error" button similar to the builin text-only "lcd" component.

2. Instead of two analog pins to control the backlight brightness, I think it would be more useful to have a single digital pin that can be pulse width modulated. This allows software AVR control of the backlight. You could blink it to get a user's attention or slowly fade it in or out.
Back to top
 
WWW   IP Logged
mrkaras_
YaBB Newbies
*
Offline

I Love YaBB 2!

Posts: 18

Re: KS0108B Graphic LCD
Reply #14 - 12/13/09 at 07:26:45
 
I were actual intending to drive my real one with a PWM, as I understood it the real one has 2 pins just connected to either side of the LED back light, so a PWM or an analog input would look much the same. it would be good if the simulated one worked with a PWM (maybe it does if your monitor refreshes fast enough :))
Back to top
 
 
  IP Logged
Pages: 1 2 
Send Topic Print