<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
		>
<channel>
	<title>Comments on: Controlling graphical 128&#215;64 LCD based on KS0108</title>
	<atom:link href="http://www.scienceprog.com/controlling-graphical-128x64-lcd-based-on-ks0108/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.scienceprog.com/controlling-graphical-128x64-lcd-based-on-ks0108/</link>
	<description>ScienceProg serves scientific, embedded, biomedical engineering, physics based contents. If you want your article or scientific project to be on this site, do not hesitate to contact.</description>
	<lastBuildDate>Tue, 07 Feb 2012 20:33:17 +0200</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
	<item>
		<title>By: Masoud Gheysari M</title>
		<link>http://www.scienceprog.com/controlling-graphical-128x64-lcd-based-on-ks0108/#comment-1698</link>
		<dc:creator>Masoud Gheysari M</dc:creator>
		<pubDate>Tue, 07 Feb 2012 20:33:17 +0000</pubDate>
		<guid isPermaLink="false">http://www.scienceprog.com/controlling-graphical-128x64-lcd-based-on-ks0108/#comment-1698</guid>
		<description>Hello everybody,
Anyone who has a weird problem which his LCD does not work without any reason, should disable JTAG in his microcontroller fuses. It took me 2 days to discover!</description>
		<content:encoded><![CDATA[<p>Hello everybody,<br />
Anyone who has a weird problem which his LCD does not work without any reason, should disable JTAG in his microcontroller fuses. It took me 2 days to discover!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: avrlabcom</title>
		<link>http://www.scienceprog.com/controlling-graphical-128x64-lcd-based-on-ks0108/#comment-1683</link>
		<dc:creator>avrlabcom</dc:creator>
		<pubDate>Wed, 18 Jan 2012 13:23:42 +0000</pubDate>
		<guid isPermaLink="false">http://www.scienceprog.com/controlling-graphical-128x64-lcd-based-on-ks0108/#comment-1683</guid>
		<description>http://avrlab.com/node/115  here is my code for WG12864A
I used it to make touchscreen project using WG12864 and touchscreen.</description>
		<content:encoded><![CDATA[<p><a href="http://avrlab.com/node/115" rel="nofollow">http://avrlab.com/node/115</a>  here is my code for WG12864A<br />
I used it to make touchscreen project using WG12864 and touchscreen.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: admin</title>
		<link>http://www.scienceprog.com/controlling-graphical-128x64-lcd-based-on-ks0108/#comment-1623</link>
		<dc:creator>admin</dc:creator>
		<pubDate>Mon, 10 Oct 2011 11:51:53 +0000</pubDate>
		<guid isPermaLink="false">http://www.scienceprog.com/controlling-graphical-128x64-lcd-based-on-ks0108/#comment-1623</guid>
		<description>Thank you Markus for fix. You can also find working example for mega32 of fixed code here:
http://winavr.scienceprog.com/interfacing-rotary-encoder-to-atmega32</description>
		<content:encoded><![CDATA[<p>Thank you Markus for fix. You can also find working example for mega32 of fixed code here:<br />
<a href="http://winavr.scienceprog.com/interfacing-rotary-encoder-to-atmega32" rel="nofollow">http://winavr.scienceprog.com/interfacing-rotary-encoder-to-atmega32</a></p>
]]></content:encoded>
	</item>
	<item>
		<title>By: admin</title>
		<link>http://www.scienceprog.com/controlling-graphical-128x64-lcd-based-on-ks0108/#comment-1593</link>
		<dc:creator>admin</dc:creator>
		<pubDate>Wed, 31 Aug 2011 21:12:12 +0000</pubDate>
		<guid isPermaLink="false">http://www.scienceprog.com/controlling-graphical-128x64-lcd-based-on-ks0108/#comment-1593</guid>
		<description>please send it to scienceprog [ at] gmail [dot]com</description>
		<content:encoded><![CDATA[<p>please send it to scienceprog [ at] gmail [dot]com</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Markus</title>
		<link>http://www.scienceprog.com/controlling-graphical-128x64-lcd-based-on-ks0108/#comment-1591</link>
		<dc:creator>Markus</dc:creator>
		<pubDate>Sat, 27 Aug 2011 16:39:05 +0000</pubDate>
		<guid isPermaLink="false">http://www.scienceprog.com/controlling-graphical-128x64-lcd-based-on-ks0108/#comment-1591</guid>
		<description>It seems that some of the shift operators messed up with the code tags. The code shown in the post will obviously not compile. Maybe it is possible to send the code to the moderator via email and she/he can provide a patch or change the downloadable code.</description>
		<content:encoded><![CDATA[<p>It seems that some of the shift operators messed up with the code tags. The code shown in the post will obviously not compile. Maybe it is possible to send the code to the moderator via email and she/he can provide a patch or change the downloadable code.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Markus</title>
		<link>http://www.scienceprog.com/controlling-graphical-128x64-lcd-based-on-ks0108/#comment-1572</link>
		<dc:creator>Markus</dc:creator>
		<pubDate>Wed, 17 Aug 2011 20:28:42 +0000</pubDate>
		<guid isPermaLink="false">http://www.scienceprog.com/controlling-graphical-128x64-lcd-based-on-ks0108/#comment-1572</guid>
		<description>This should fix the problem that fonts which don&#039;t have &lt;code&gt;height % 8 == 0&lt;/code&gt; will be displayed as a multiple of 8.
&lt;code&gt;
int ks0108PutChar(unsigned char c) {
	uint8_t width = 0;
	uint8_t height = ks0108FontRead(ks0108Font+FONT_HEIGHT);
	uint8_t bytes = (height+7)/8;
	uint8_t tooMuch = height % 8;
	
	uint8_t firstChar = ks0108FontRead(ks0108Font+FONT_FIRST_CHAR);
	uint8_t charCount = ks0108FontRead(ks0108Font+FONT_CHAR_COUNT);
	
	uint16_t index = 0;
	uint8_t x = ks0108Coord.x, y = ks0108Coord.y;
	
	if(c = (firstChar+charCount)) {
		return 1;
	}
	c-= firstChar;
	
	// read width data, to get the index
	for(uint8_t i=0; i&lt;c; i++)
		index += ks0108FontRead(ks0108Font+FONT_WIDTH_TABLE+i);
	index = index*bytes+charCount+FONT_WIDTH_TABLE;
	width = ks0108FontRead(ks0108Font+FONT_WIDTH_TABLE+c);
	
	// last but not least, draw the character
	for(uint8_t i=0; i&lt;bytes; i++)
	{
		uint8_t page = i*width;
		for(uint8_t j=0; j&gt;= tooMuch;
				data &#124;= dataOld;
			}
			
			if(ks0108FontColor == BLACK)
			{
				ks0108WriteData(data);
			} else
			{
				ks0108WriteData(~data);
			}
		}
		// 1px gap between chars
		if(ks0108FontColor == BLACK)
		{
			ks0108WriteData(0x00);
		}
		else
		{
			ks0108WriteData(0xFF);
		}
		if (i + 2 &lt; bytes)
			ks0108GotoXY(x, ks0108Coord.y+8);
		else
			ks0108GotoXY(x, ks0108Coord.y + tooMuch);
	}
	ks0108GotoXY(x+width+1, y);
	
	return 0;
}
&lt;/code&gt;</description>
		<content:encoded><![CDATA[<p>This should fix the problem that fonts which don&#8217;t have <code>height % 8 == 0</code> will be displayed as a multiple of 8.<br />
<code><br />
int ks0108PutChar(unsigned char c) {<br />
	uint8_t width = 0;<br />
	uint8_t height = ks0108FontRead(ks0108Font+FONT_HEIGHT);<br />
	uint8_t bytes = (height+7)/8;<br />
	uint8_t tooMuch = height % 8;</p>
<p>	uint8_t firstChar = ks0108FontRead(ks0108Font+FONT_FIRST_CHAR);<br />
	uint8_t charCount = ks0108FontRead(ks0108Font+FONT_CHAR_COUNT);</p>
<p>	uint16_t index = 0;<br />
	uint8_t x = ks0108Coord.x, y = ks0108Coord.y;</p>
<p>	if(c = (firstChar+charCount)) {<br />
		return 1;<br />
	}<br />
	c-= firstChar;</p>
<p>	// read width data, to get the index<br />
	for(uint8_t i=0; i&lt;c; i++)<br />
		index += ks0108FontRead(ks0108Font+FONT_WIDTH_TABLE+i);<br />
	index = index*bytes+charCount+FONT_WIDTH_TABLE;<br />
	width = ks0108FontRead(ks0108Font+FONT_WIDTH_TABLE+c);</p>
<p>	// last but not least, draw the character<br />
	for(uint8_t i=0; i&lt;bytes; i++)<br />
	{<br />
		uint8_t page = i*width;<br />
		for(uint8_t j=0; j&gt;= tooMuch;<br />
				data |= dataOld;<br />
			}</p>
<p>			if(ks0108FontColor == BLACK)<br />
			{<br />
				ks0108WriteData(data);<br />
			} else<br />
			{<br />
				ks0108WriteData(~data);<br />
			}<br />
		}<br />
		// 1px gap between chars<br />
		if(ks0108FontColor == BLACK)<br />
		{<br />
			ks0108WriteData(0x00);<br />
		}<br />
		else<br />
		{<br />
			ks0108WriteData(0xFF);<br />
		}<br />
		if (i + 2 &lt; bytes)<br />
			ks0108GotoXY(x, ks0108Coord.y+8);<br />
		else<br />
			ks0108GotoXY(x, ks0108Coord.y + tooMuch);<br />
	}<br />
	ks0108GotoXY(x+width+1, y);</p>
<p>	return 0;<br />
}<br />
</code></p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Fabio</title>
		<link>http://www.scienceprog.com/controlling-graphical-128x64-lcd-based-on-ks0108/#comment-1062</link>
		<dc:creator>Fabio</dc:creator>
		<pubDate>Fri, 08 Oct 2010 07:24:02 +0000</pubDate>
		<guid isPermaLink="false">http://www.scienceprog.com/controlling-graphical-128x64-lcd-based-on-ks0108/#comment-1062</guid>
		<description>Hello all. I am beginner and I&#039;m learning c. In the function ks0108DrawLine that I report here (derived from ks0108.C code of Maximilian library ) ,
can you  show  me where the data is written into the  KS0108 memory ? I don&#039;t understand how te struct work.
Can you help me?
Thanks .
Fabio


void ks0108DrawLine(uint8_t x1, uint8_t y1, uint8_t x2, uint8_t y2, uint8_t color) {
        uint8_t length, i, y, yAlt, xTmp, yTmp;
        int16_t m;

        //
        // vertical line
        //
        if(x1 == x2) {
                // x1&#124;y1 must be the upper point
                if(y1 &gt; y2) {
                        yTmp = y1;
                        y1 = y2;
                        y2 = yTmp;
                }
                ks0108DrawVertLine(x1, y1, y2-y1, color);

        //
        // horizontal line
        //
        } else if(y1 == y2) {
                // x1&#124;y1 must be the left point
                if(x1 &gt; x2) {
                        xTmp = x1;
                        x1 = x2;
                        x2 = xTmp;
                }
                ks0108DrawHoriLine(x1, y1, x2-x1, color);

        //
        // schiefe line :)
        //
        } else {
                // angle &gt;= 45°
                if((y2-y1) &gt;= (x2-x1) &#124;&#124; (y1-y2) &gt;= (x2-x1)) {
                        // x1 must be smaller than x2
                        if(x1 &gt; x2) {
                                xTmp = x1;
                                yTmp = y1;
                                x1 = x2;
                                y1 = y2;
                                x2 = xTmp;
                                y2 = yTmp;
                        }

                        length = x2-x1;         // not really the length :)
                        m = ((y2-y1)*200)/length;
                        yAlt = y1;

                        for(i=0; i= 100)
                                        y++;
                                else if((m*i) 0 &lt;= -100)
                                        y--;

                                ks0108DrawLine(x1+i, yAlt, x1+i, y, color);

                                if(length &lt;= (y2-y1) &amp;&amp; y1 &lt; y2)
                                        yAlt = y+1;
                                else if(length  y2)
                                        yAlt = y-1;
                                else
                                        yAlt = y;
                        }

                // angle  y2) {
                                xTmp = x1;
                                yTmp = y1;
                                x1 = x2;
                                y1 = y2;
                                x2 = xTmp;
                                y2 = yTmp;
                        }

                        length = y2-y1;
                        m = ((x2-x1)*200)/length;
                        yAlt = x1;

                        for(i=0; i= 100)
                                        y++;
                                else if((m*i) 0 &lt;= -100)
                                        y--;

                                ks0108DrawLine(yAlt, y1+i, y, y1+i, color);
                                if(length &lt;= (x2-x1) &amp;&amp; x1 &lt; x2)
                                        yAlt = y+1;
                                else if(length  x2)
                                        yAlt = y-1;
                                else
                                        yAlt = y;
                        }
                }
        }
}</description>
		<content:encoded><![CDATA[<p>Hello all. I am beginner and I&#8217;m learning c. In the function ks0108DrawLine that I report here (derived from ks0108.C code of Maximilian library ) ,<br />
can you  show  me where the data is written into the  KS0108 memory ? I don&#8217;t understand how te struct work.<br />
Can you help me?<br />
Thanks .<br />
Fabio</p>
<p>void ks0108DrawLine(uint8_t x1, uint8_t y1, uint8_t x2, uint8_t y2, uint8_t color) {<br />
        uint8_t length, i, y, yAlt, xTmp, yTmp;<br />
        int16_t m;</p>
<p>        //<br />
        // vertical line<br />
        //<br />
        if(x1 == x2) {<br />
                // x1|y1 must be the upper point<br />
                if(y1 &gt; y2) {<br />
                        yTmp = y1;<br />
                        y1 = y2;<br />
                        y2 = yTmp;<br />
                }<br />
                ks0108DrawVertLine(x1, y1, y2-y1, color);</p>
<p>        //<br />
        // horizontal line<br />
        //<br />
        } else if(y1 == y2) {<br />
                // x1|y1 must be the left point<br />
                if(x1 &gt; x2) {<br />
                        xTmp = x1;<br />
                        x1 = x2;<br />
                        x2 = xTmp;<br />
                }<br />
                ks0108DrawHoriLine(x1, y1, x2-x1, color);</p>
<p>        //<br />
        // schiefe line <img src='http://www.scienceprog.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /><br />
        //<br />
        } else {<br />
                // angle &gt;= 45°<br />
                if((y2-y1) &gt;= (x2-x1) || (y1-y2) &gt;= (x2-x1)) {<br />
                        // x1 must be smaller than x2<br />
                        if(x1 &gt; x2) {<br />
                                xTmp = x1;<br />
                                yTmp = y1;<br />
                                x1 = x2;<br />
                                y1 = y2;<br />
                                x2 = xTmp;<br />
                                y2 = yTmp;<br />
                        }</p>
<p>                        length = x2-x1;         // not really the length <img src='http://www.scienceprog.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /><br />
                        m = ((y2-y1)*200)/length;<br />
                        yAlt = y1;</p>
<p>                        for(i=0; i= 100)<br />
                                        y++;<br />
                                else if((m*i) 0 &lt;= -100)<br />
                                        y&#8211;;</p>
<p>                                ks0108DrawLine(x1+i, yAlt, x1+i, y, color);</p>
<p>                                if(length &lt;= (y2-y1) &amp;&amp; y1 &lt; y2)<br />
                                        yAlt = y+1;<br />
                                else if(length  y2)<br />
                                        yAlt = y-1;<br />
                                else<br />
                                        yAlt = y;<br />
                        }</p>
<p>                // angle  y2) {<br />
                                xTmp = x1;<br />
                                yTmp = y1;<br />
                                x1 = x2;<br />
                                y1 = y2;<br />
                                x2 = xTmp;<br />
                                y2 = yTmp;<br />
                        }</p>
<p>                        length = y2-y1;<br />
                        m = ((x2-x1)*200)/length;<br />
                        yAlt = x1;</p>
<p>                        for(i=0; i= 100)<br />
                                        y++;<br />
                                else if((m*i) 0 &lt;= -100)<br />
                                        y&#8211;;</p>
<p>                                ks0108DrawLine(yAlt, y1+i, y, y1+i, color);<br />
                                if(length &lt;= (x2-x1) &amp;&amp; x1 &lt; x2)<br />
                                        yAlt = y+1;<br />
                                else if(length  x2)<br />
                                        yAlt = y-1;<br />
                                else<br />
                                        yAlt = y;<br />
                        }<br />
                }<br />
        }<br />
}</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: LCD MODULE</title>
		<link>http://www.scienceprog.com/controlling-graphical-128x64-lcd-based-on-ks0108/#comment-1061</link>
		<dc:creator>LCD MODULE</dc:creator>
		<pubDate>Tue, 08 Jun 2010 08:27:16 +0000</pubDate>
		<guid isPermaLink="false">http://www.scienceprog.com/controlling-graphical-128x64-lcd-based-on-ks0108/#comment-1061</guid>
		<description>thanks man, your article had help me a lot much.</description>
		<content:encoded><![CDATA[<p>thanks man, your article had help me a lot much.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Aoran-LCD</title>
		<link>http://www.scienceprog.com/controlling-graphical-128x64-lcd-based-on-ks0108/#comment-1060</link>
		<dc:creator>Aoran-LCD</dc:creator>
		<pubDate>Mon, 17 May 2010 09:54:49 +0000</pubDate>
		<guid isPermaLink="false">http://www.scienceprog.com/controlling-graphical-128x64-lcd-based-on-ks0108/#comment-1060</guid>
		<description>LCD Module @ AORAN

More many different alphanumeric types ,graphic types, give you plenty to chose from- 1x8 to 4x40 character displays ,122x32 to320x240 Graphic displays. Standard backlight options of low-power electroluminescent, high-brightness EcoBrightTM non-powered backlight by special order. LED or CFL backlights, low profile edge light options for thinner displays.
Standard or wide-temperature (-20°C to +70°C) operation. All parts can include an HD44780 compatible controller which can be ordered in either: Standard, European, Cyrillic, Russian, or Greek font options.

With more than hundreds different combinations in our regular range, we have the display for your application. If we haven&#039;t, we can always fully or semi custom them for you!</description>
		<content:encoded><![CDATA[<p>LCD Module @ AORAN</p>
<p>More many different alphanumeric types ,graphic types, give you plenty to chose from- 1&#215;8 to 4&#215;40 character displays ,122&#215;32 to320x240 Graphic displays. Standard backlight options of low-power electroluminescent, high-brightness EcoBrightTM non-powered backlight by special order. LED or CFL backlights, low profile edge light options for thinner displays.<br />
Standard or wide-temperature (-20°C to +70°C) operation. All parts can include an HD44780 compatible controller which can be ordered in either: Standard, European, Cyrillic, Russian, or Greek font options.</p>
<p>With more than hundreds different combinations in our regular range, we have the display for your application. If we haven&#8217;t, we can always fully or semi custom them for you!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: renato gallo</title>
		<link>http://www.scienceprog.com/controlling-graphical-128x64-lcd-based-on-ks0108/#comment-1059</link>
		<dc:creator>renato gallo</dc:creator>
		<pubDate>Tue, 20 Apr 2010 12:31:32 +0000</pubDate>
		<guid isPermaLink="false">http://www.scienceprog.com/controlling-graphical-128x64-lcd-based-on-ks0108/#comment-1059</guid>
		<description>i would need a step by step pictures guide on how to wire it please can you help I beg you :D</description>
		<content:encoded><![CDATA[<p>i would need a step by step pictures guide on how to wire it please can you help I beg you <img src='http://www.scienceprog.com/wp-includes/images/smilies/icon_biggrin.gif' alt=':D' class='wp-smiley' /> </p>
]]></content:encoded>
	</item>
</channel>
</rss>

