About

Archives

01 Jul - 31 Jul 2006
01 Aug - 31 Aug 2006
01 Sep - 30 Sep 2006
01 Oct - 31 Oct 2006
01 Nov - 30 Nov 2006
01 Dec - 31 Dec 2006
01 Jan - 31 Jan 2007
01 Feb - 28 Feb 2007
01 Mar - 31 Mar 2007
01 Apr - 30 Apr 2007
01 May - 31 May 2007
01 Jun - 30 Jun 2007
01 Jul - 31 Jul 2007
01 Aug - 31 Aug 2007
01 Oct - 31 Oct 2007
01 Nov - 30 Nov 2007
01 Dec - 31 Dec 2007
01 Jan - 31 Jan 2008
01 Feb - 28 Feb 2008
01 Mar - 31 Mar 2008
01 Aug - 31 Aug 2009
01 Sep - 30 Sep 2009
01 Jan - 31 Jan 2010
01 May - 31 May 2010
01 Jun - 30 Jun 2010
01 Aug - 31 Aug 2010
01 Sep - 30 Sep 2010

Links

Search!

Last Comments

Alvaro Oliver (StackBook Part 4 …): Hey! nice post. I just bo…
Tiago Gomes (Let's start again…): ok, now feel happy, you a…
Tiago Gomes (Let's start again…): ok, now feel happy, you a…
ir0nhide (StackBook Part 4.…): Very cool, nice work
Toby (Gigabyte, LCDs, a…): Good stuff, although now …
luke (StackBook part 3 …): what are you planing to u…
Toby (A quick rant...): Bastards
Hugh (StackBook Part 2 …): Nicely done, but you now …
gm (StackBook Part 2 …): Hmm, I plan to go a littl…
luke (StackBook Part 2 …): i cant help but wonder if…

Stuff

Powered by Pivot - 1.40.4: 'Dreadwind' 
XML: RSS Feed 
XML: Atom Feed 

« StackBook Part 4 - Mo… | Home | Video Converters »

StackBook Part 4.1 - More More screen.

25 08 09 - 22:55 Rule #2 of electronics according to gm: Just because it works (or appears to) doesn't mean it's right.

I was experiencing problems with the third segment of the display - namely anything drawn on it going onto the other two and general pixel corruption caused by the third panel not being activated in the correct sequence. Remember last time, when CS1 and CS2 had to be swapped to make the graphics appear the right way round? It wasn't because they were wired up wrong. This is the chip select sequence:

__inline__ void ks0108::SelectChip(uint8_t chip) {
//static uint8_t prevchip;
if(chipSelect[chip] & 1)
fastWriteHigh(CSEL1);
else
fastWriteLow(CSEL1);

if(chipSelect[chip] & 2)
fastWriteHigh(CSEL2);
else
fastWriteLow(CSEL2);
}

Can you see what this assumes about the LCD, and why it would work with CS1 and CS2 swapped if this assumption was wrong?

This display has active-low CS lines - in other words the chip is selected when the enable line is grounded. In the previous case where we were only driving the left 128 pixels, when chip 1 was supposed to have been selected, chip 2 was, and vice versa. However, attempting to use 3 chips with this results in something different - chip 1 is off when selected, chips 2 and 3 are on - very very bad. Hence why the stuff for chip 3 was being drawn over the other two. So after fixing the fastWriteHigh/Low problem and adding an if statement to turn chip 3 on and off, it worked.

I'll release the modified ks0108 code when I've got it cleaned up a bit - it's a little hackish at the moment - and I've probably broken stuff in the code for other setups. But anyway, I can now draw to the whole 192x64 LCD.


one comment

Very cool, nice work
ir0nhide - 26 08 09 - 10:30


Trackback link: http://gm.stackunderflow.com/blog/pivot/tb.php?tb_id=138

  
Remember personal info?

Emoticons / Textile

To prevent automated comment spam, the answer to this rather simple question is required...

 

  (Register your username / Log in)

Notify:
Hide email:

Small print: All html tags except <b> and <i> will be removed from your comment. You can make links by just typing the url or mail-address.

 

Linkdump