<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	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/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Monochrome Graphic Display Source Code Driver Project</title>
	<atom:link href="http://www.graphic-display-source-code-driver.com/feed" rel="self" type="application/rss+xml" />
	<link>http://www.graphic-display-source-code-driver.com</link>
	<description>Monochrome Graphic Display Source Code Driver Project</description>
	<lastBuildDate>Wed, 20 Jul 2011 08:11:31 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>Links to useful sites</title>
		<link>http://www.graphic-display-source-code-driver.com/links/links-to-useful-sites</link>
		<comments>http://www.graphic-display-source-code-driver.com/links/links-to-useful-sites#comments</comments>
		<pubDate>Wed, 20 Jul 2011 08:08:52 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Links]]></category>

		<guid isPermaLink="false">http://www.graphic-display-source-code-driver.com/?p=73</guid>
		<description><![CDATA[Embedded Developer All Embedded EE Compendium Arm Atmel Microchip Electronic Engineer Embedded Programmer Electronic Consultant]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.embeddeddeveloper.com/" target="_blank">Embedded Developer</a></p>
<p><a href="http://www.allembedded.com/" target="_blank">All Embedded</a></p>
<p><a href="http://ee.cleversoul.com/" target="_blank">EE Compendium</a></p>
<p><a href="http://www.arm.com" target="_blank">Arm</a></p>
<p><a href="http://www.atmel.com/" target="_blank">Atmel</a></p>
<p><a href="http://www.microchip.com/" target="_blank">Microchip</a></p>
<p><a href="http://www.electronic-engineer.co.uk/index.php" target="_blank">Electronic Engineer</a></p>
<p><a href="http://www.embedded-programmer.com/index.php" target="_blank">Embedded Programmer</a></p>
<p><a href="http://www.electronic-consultant.co.uk/index.php" target="_blank">Electronic Consultant</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.graphic-display-source-code-driver.com/links/links-to-useful-sites/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Sample Projects</title>
		<link>http://www.graphic-display-source-code-driver.com/example-circuits/sample-projects</link>
		<comments>http://www.graphic-display-source-code-driver.com/example-circuits/sample-projects#comments</comments>
		<pubDate>Mon, 03 May 2010 11:19:22 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[05. Example Circuits]]></category>

		<guid isPermaLink="false">http://www.graphic-display-source-code-driver.com/?p=58</guid>
		<description><![CDATA[Download the sample project circuit diagrams here.]]></description>
			<content:encoded><![CDATA[<p>Download the sample project circuit diagrams <a href="http://www.embedded-code.com/download/monochrome_screen_driver_schematics.pdf" target="_blank">here</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.graphic-display-source-code-driver.com/example-circuits/sample-projects/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>c) Changes To The Bitmap Converter PC Application</title>
		<link>http://www.graphic-display-source-code-driver.com/revision-history/c-changes-to-the-bitmap-converter-pc-application</link>
		<comments>http://www.graphic-display-source-code-driver.com/revision-history/c-changes-to-the-bitmap-converter-pc-application#comments</comments>
		<pubDate>Mon, 03 May 2010 11:14:58 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[10. Revision History]]></category>

		<guid isPermaLink="false">http://www.graphic-display-source-code-driver.com/?p=53</guid>
		<description><![CDATA[V1.00 Original release V1.01 Added processing of font bitmap files Added flags field to bitmap header V1.02 Some graphics programs sometimes use an opposite colouring of the pixels (an opposite palette). We now read the palette of each image and invert pixels if the opposite pallet colouring is used. V1.03 LCD_C define changed to DISPLAY_C [...]]]></description>
			<content:encoded><![CDATA[<h4>V1.00</h4>
<p>Original release</p>
<h4>V1.01</h4>
<p>Added processing of font bitmap files</p>
<p>Added flags field to bitmap header</p>
<h4>V1.02</h4>
<p>Some graphics programs sometimes use an opposite colouring of the pixels (an opposite palette).  We now read the palette of each image and invert pixels if the opposite pallet colouring is used.</p>
<h4>V1.03</h4>
<p>LCD_C define changed to DISPLAY_C to match new define used by the V1.03 driver</p>
<p>Message box confirmation of conversion complete added.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.graphic-display-source-code-driver.com/revision-history/c-changes-to-the-bitmap-converter-pc-application/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>b) Changes To The Sample Project Files</title>
		<link>http://www.graphic-display-source-code-driver.com/revision-history/changes-to-the-sample-project-files</link>
		<comments>http://www.graphic-display-source-code-driver.com/revision-history/changes-to-the-sample-project-files#comments</comments>
		<pubDate>Mon, 03 May 2010 11:14:19 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[10. Revision History]]></category>

		<guid isPermaLink="false">http://www.graphic-display-source-code-driver.com/?p=51</guid>
		<description><![CDATA[V1.00 Original release V1.01 Minor changes to remove long variable names not liked by some compilers V1.02 No significant changes V1.03 Changed sample screen modes to be cycled through from a single switch input, instead of the previous switch input per sample screen. Added CONSTANT define to main.h and replaced all ‘const rom’ to CONSTANT [...]]]></description>
			<content:encoded><![CDATA[<h4>V1.00</h4>
<p>Original release</p>
<h4>V1.01</h4>
<p>Minor changes to remove long variable names not liked by some compilers</p>
<h4>V1.02</h4>
<p>No significant changes</p>
<h4>V1.03</h4>
<p>Changed sample screen modes to be cycled through from a single switch input, instead of the previous switch input per sample screen.</p>
<p>Added CONSTANT define to main.h and replaced all ‘const rom’ to CONSTANT in the code, to allow easy dealing with compilers that require an additional qualifier such as &#8216;rom&#8217; and those that don’t.</p>
<p>Added Microchip C30 and C32 compiler compatible projects for 16 and 32 bit Microchip devices.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.graphic-display-source-code-driver.com/revision-history/changes-to-the-sample-project-files/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>a) Changes To The Monochrome Screen Driver Files</title>
		<link>http://www.graphic-display-source-code-driver.com/revision-history/changes-to-the-monochrome-screen-driver-files</link>
		<comments>http://www.graphic-display-source-code-driver.com/revision-history/changes-to-the-monochrome-screen-driver-files#comments</comments>
		<pubDate>Mon, 03 May 2010 11:13:45 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[10. Revision History]]></category>

		<guid isPermaLink="false">http://www.graphic-display-source-code-driver.com/?p=49</guid>
		<description><![CDATA[V1.00 Original release V1.01 Changes to deal with long variable names that are cropped by some compilers. lcd_delay_ms changed from a define to a function to simplify for compilers that don&#8217;t provide standard delay library functions or macros) V1.02 Implemented centre and right align options for displaying strings Changed the example lcd_display_bitmap call to use [...]]]></description>
			<content:encoded><![CDATA[<h4>V1.00</h4>
<p>Original release</p>
<h4>V1.01</h4>
<p>Changes to deal with long variable names that are cropped by some compilers.</p>
<p>lcd_delay_ms changed from a define to a function to simplify for compilers that don&#8217;t provide standard delay library functions or macros)</p>
<h4>V1.02</h4>
<p>Implemented centre and right align options for displaying strings</p>
<p>Changed the example lcd_display_bitmap call to use DISPLAY_BITMAP_INVERT_PIXELS_OFF to avoid confusion for new users (was previously DISPLAY_BITMAP_INVERT_PIXELS_ON).</p>
<h4>V1.03</h4>
<p>Significant changes to the overall driver 	code.</p>
<p>Added scrolling text functionality.</p>
<p>Moved many of the defines to the lcd-model.h file to make using the driver with new screens more straightforward.</p>
<p>Added USE_LOCAL_RAM_BUFFER define for a local ram buffer of display data to optionally be used to increase speed where microcontroller / processor ram is available, or when required for displays that do not provide the capability to read display data back from the screen.</p>
<p>Added CONSTANT define to main.h and replaced all ‘const rom’ to CONSTANT in the code, to allow easy dealing with compilers require an additional qualifier such as &#8216;rom&#8217; and those that don’t.</p>
<p>Added Microchip C30 and C32 compiler compatibility for 16 and 32 bit Microchip devices.</p>
<p>Added new screen model sample files for Batron BTHQ240064AVB-EMN-06-LED with SPI interface.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.graphic-display-source-code-driver.com/revision-history/changes-to-the-monochrome-screen-driver-files/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>b) Support</title>
		<link>http://www.graphic-display-source-code-driver.com/troubleshooting/support</link>
		<comments>http://www.graphic-display-source-code-driver.com/troubleshooting/support#comments</comments>
		<pubDate>Mon, 03 May 2010 11:11:05 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[09. Troubleshooting]]></category>

		<guid isPermaLink="false">http://www.graphic-display-source-code-driver.com/?p=47</guid>
		<description><![CDATA[Please visit the support section of the embedded-code.com web site if you have any queries regarding this driver. Please note that our support covers the use of this driver with the reference designs in this manual. Where possible we will try to help solve any problems if the code is used with other devices or [...]]]></description>
			<content:encoded><![CDATA[<p>Please visit the support section of the embedded-code.com web site if you have any queries regarding this driver.  Please note that our support covers the use of this driver with the reference designs in this manual.  Where possible we will try to help solve any problems if the code is used with other devices or compilers, but given the huge number of devices and compilers available we are unable to guarantee &#8216;out of the box&#8217; compatibility. If you plan to use the source code with a different processor, microcontroller and/or compiler you should ensure that you have sufficient programming expertise to carry out any modifications that may be required to the source code.</p>
<p>If you do encounter issues using the driver with other compilers or devices and are able to give us details of the issue you encountered we will try and include changes or notes across our range of drivers to help other programmers avoid similar issues in the future.  Please use the contact us page of our web site to report any such issues discovered.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.graphic-display-source-code-driver.com/troubleshooting/support/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>a) General Troubleshooting Notes</title>
		<link>http://www.graphic-display-source-code-driver.com/troubleshooting/general-troubleshooting-notes</link>
		<comments>http://www.graphic-display-source-code-driver.com/troubleshooting/general-troubleshooting-notes#comments</comments>
		<pubDate>Mon, 03 May 2010 11:10:32 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[09. Troubleshooting]]></category>

		<guid isPermaLink="false">http://www.graphic-display-source-code-driver.com/?p=45</guid>
		<description><![CDATA[Getting a new screen to work can be frustrating as until you get the control signals and initialisation sequence right you won’t see anything on the screen. Here are a few tips to help:- Double check IO pin definitions in the driver header file. Verify with a scope that all of the control and data [...]]]></description>
			<content:encoded><![CDATA[<p>Getting a new screen to work can be frustrating as until you get the control signals and initialisation sequence right you won’t see anything on the screen.  Here are a few tips to help:-</p>
<p style="padding-left: 30px;">Double check IO pin definitions in the driver header file.</p>
<p style="padding-left: 30px;">Verify with a scope that all of the control and data pins to the screen are working correctly.</p>
<p style="padding-left: 30px;">Add additional null execution steps to the DISPLAY_BUS_ACCESS_DELAY define in the display.h file in case more time is required for signals to stabilise on your PCB.  This is more likely to be an issue for 2 layer PCB’s (no ground plane) with long tack lengths or screens with long ribbon / FFC cable connections.</p>
<p style="padding-left: 30px;">Check that no other device on the data bus is outputting while the driver is trying to communicate with the screen.</p>
<p style="padding-left: 30px;">If your screen controller IC includes a status register try reading the status from the screen and confirm that you get the expected response.</p>
<p style="padding-left: 30px;">If you’re using output latches for some of the screen control pins, instead of pins connected directly to your processor, check your output latch function restores the previous output on the data bus when it exits, to avoid destroying the data the driver function is writing to the screen.</p>
<p style="padding-left: 30px;">Check that your microcontroller is not resetting due to a watchdog timer timeout.</p>
<p style="padding-left: 30px;">Check that you have enough stack space allocated.  This driver does not use an excessive amount of ram from the stack, but if your application is already using large amounts of the stack before calling driver functions this may be causing a stack overrun?</p>
<p style="padding-left: 30px;">Re-read the datasheet to find out what you’re doing wrong!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.graphic-display-source-code-driver.com/troubleshooting/general-troubleshooting-notes/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>a) The Driver Functions and Defines</title>
		<link>http://www.graphic-display-source-code-driver.com/how-the-driver-works/the-driver-functions-and-defines</link>
		<comments>http://www.graphic-display-source-code-driver.com/how-the-driver-works/the-driver-functions-and-defines#comments</comments>
		<pubDate>Mon, 03 May 2010 11:09:10 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[08. How The Driver Works]]></category>

		<guid isPermaLink="false">http://www.graphic-display-source-code-driver.com/?p=43</guid>
		<description><![CDATA[Note – this section of the manual is for information should you wish to gain an understanding of how each of the driver components works. Generic Driver and Screen Specific Files The ‘display.c’ and ‘display.h’ files contain all of the driver generic functions and defines. The ‘display-model.c’ and display-model.h’ files contain functions and defines that [...]]]></description>
			<content:encoded><![CDATA[<p><strong>Note – this section of the manual is for information should you wish to gain an understanding of how each of the driver components works.</strong></p>
<h4>Generic Driver and Screen Specific Files</h4>
<p>The ‘display.c’ and ‘display.h’ files contain all of the driver generic functions and defines.</p>
<p>The ‘display-model.c’ and display-model.h’ files contain functions and defines that are particular to a specific screen and controller IC.</p>
<h4>Delay Function</h4>
<p>display_delay_ms(delay_ms)</p>
<p style="padding-left: 30px;">Provides a simple means for the drive to delay while initialising the screen.  Accuracy is not important as long as a value of 1 = a delay of at least 1mS (i.e. longer delays don’t matter).</p>
<h4>Initialise The Screen</h4>
<p>void display_initialise (void)</p>
<p style="padding-left: 30px;">This function calls a screen specific function in the ‘display-model.c’ file.  The function contains the screen initialisation sequence.</p>
<p style="padding-left: 30px;">If configuring the driver for a new screen then copy sample ‘display-model.c’ and ‘display-model.h’ files for a screen that is most similar and then modify this function to suit the screen in use.</p>
<h4>Set the Contrast</h4>
<p>void display_set_contrast (BYTE contrast_value)</p>
<p style="padding-left: 30px;">This function is only used for screens that have built in digital contrast adjustment.  It calls a screen specific function in the ‘display-model.c’ file.  The function contains the screen initialisation sequence.</p>
<p style="padding-left: 30px;">If configuring the driver for a new screen then copy sample ‘display-model.c’ and display-model.h’ files for a screen that is most similar and then modify this function to suit the screen in use.</p>
<h4>Clear Screen</h4>
<p>void display_clear_screen (BYTE invert_pixels)</p>
<p style="padding-left: 30px;">This function writes 0&#215;00 or 0xFF to every screen output byte location to clear it.</p>
<p style="padding-left: 30px;">Usage examples:-</p>
<p style="padding-left: 60px;">display_clear_screen(0);	//Normal clear screen</p>
<p style="padding-left: 60px;">display_clear_screen(1);	//Set all screen pixels on</p>
<p style="padding-left: 30px;">This is a universal function – modification is not normally required.</p>
<h4>Display Bitmap</h4>
<p>void display_bitmap (DWORD image_flash_address, const rom BYTE *p_image_memory_address, WORD image_options, WORD x_start_coord, WORD y_start_coord)</p>
<p style="padding-left: 30px;">image_flash_address</p>
<p style="padding-left: 60px;">Start address of bitmap in flash memory (set to 0 if bitmap is in program memory))</p>
<p style="padding-left: 30px;">*p_image_memory_address</p>
<p style="padding-left: 60px;">Pointer to bitmap in program memory (set to 0 if bitmap is in flash memory)</p>
<p style="padding-left: 30px;">image_options</p>
<p style="padding-left: 60px;">Bit 15:13	Unused</p>
<p style="padding-left: 60px;">Bit 12		Font table image: 1 = Scroll text, 0 = static text</p>
<p style="padding-left: 60px;">Bit 11:10	If either is high then do not output to the screen (used for centre and right aligned text)</p>
<p style="padding-left: 60px;">Bit 9	Font table image: 1 = using proportionally spaced characters</p>
<p style="padding-left: 60px;">Bit 8	Font table image: 0 = displayed along X axis, 1 = display along Y axis</p>
<p style="padding-left: 60px;">Bit 7	1 = Invert pixels (i.e. a pixel on becomes off and vice versa)</p>
<p style="padding-left: 60px;">Bit 6:0</p>
<p style="padding-left: 90px;">0 = image is a normal bitmap.</p>
<p style="padding-left: 90px;">&gt;0 = Image is from a font table.  The address given is the start of the font table.  The value of bits 6:0 is the ASCII character required (0&#215;01 &#8211; 0x7F)</p>
<p style="padding-left: 30px;">x_start_coord</p>
<p style="padding-left: 60px;">0 to DISPLAY_WIDTH_PIXELS.  (If = 0xFFFF then the &#8216; display_auto_x_coordinate&#8217; variable is used for the bitmap x coordiante.  This variable is updated with the next x coordinate each time this function is called to allow successive display across a screen).</p>
<p style="padding-left: 30px;">ui_y_start_coord</p>
<p style="padding-left: 60px;">0 to DISPLAY_HEIGHT_PIXELS.  (If = 0xFFFF then the ‘display_auto_y_coordinate&#8217; variable is used for the bitmap y coordiante.  This variable is updated with the next y coordinate each time this function is called to allow successive display across a screen).</p>
<p>image_options standard defines:</p>
<p style="padding-left: 30px;">DISPLAY_BITMAP_INVERT_PIXELS_OFF</p>
<p style="padding-left: 30px;">DISPLAY_BITMAP_INVERT_PIXELS_ON</p>
<p>This is a large complex function that carries out all of the bitmap display functions.  At a basic level it is simply reading bitmap data from memory and displaying each column in order.  It is complex because it is dealing with all the problems having to read bitmaps in bytes of 8 pixels each and then write to the screen in bytes of 8 pixels but without there necessarily being any alignment between the two, and in as efficient a manor as possible.  This function is also used to display each character of a string and when displaying text in proportional mode it deals with calculating how each character bitmap should be shifted and masked for any of the 4 possible screen orientations that may be used.</p>
<p>Usage example:-</p>
<p style="padding-left: 30px;">display_bitmap(0, ec_logo_128x64,			//Bitmap</p>
<p style="padding-left: 30px;">DISPLAY_BITMAP_INVERT_PIXELS_ON,	//Options</p>
<p style="padding-left: 30px;">0, 0);					//X, Y</p>
<p>This is a universal function – modification is not normally required.</p>
<p><strong> Special Note</strong></p>
<p>The X and Y start coordinates are screen based, not screen orientation based.  Depending on how your particular screen is addressed and orientated in your application the X and Y values may relate to either actual real world axis and their values may run in either direction.  An easy way of determining this for a new application is to display a bitmap or an ASCII text string in the centre of the screen and then alter the X and Y values to see how they affect the position of the bitmap or string.</p>
<h4>Display String</h4>
<p><em>Version for displaying constant strings:-</em></p>
<p>void display_const_string (DWORD image_flash_address, const rom BYTE *p_image_memory_address, WORD image_options, WORD x_start_coord, WORD y_start_coord, const rom BYTE *p_ascii_string)</p>
<p><em>Version for displaying variable strings:-</em></p>
<p>void display_variable_string (DWORD image_flash_address, const rom BYTE *p_image_memory_address, WORD image_options, WORD x_start_coord, WORD y_start_coord, BYTE *p_ascii_string)</p>
<p style="padding-left: 30px;">image_flash_address</p>
<p style="padding-left: 60px;">Start address of font table bitmap in flash memory (set to 0 if bitmap is in program memory))</p>
<p style="padding-left: 30px;">*p_image_memory_address</p>
<p style="padding-left: 60px;">Pointer to font table bitmap in program memory (set to 0 if bitmap is in flash memory)</p>
<p style="padding-left: 30px;">image_options</p>
<p style="padding-left: 60px;">Bits15:10	Unused</p>
<p style="padding-left: 60px;">Bit9		0 = Monospace / fixed pitch characters, 1 = proportionally spaced characters</p>
<p style="padding-left: 60px;">Bit8		0 = Display string along X axis, 1 = Display string along Y axis</p>
<p style="padding-left: 60px;">Bit7	1 = Invert pixels (i.e. a pixel on becomes off and vice versa)</p>
<p style="padding-left: 60px;">Bits6:0		Not available (used by display bitmap function)</p>
<p style="padding-left: 30px;">x_start_coord</p>
<p style="padding-left: 60px;">0 to DISPLAY_WIDTH_PIXELS.  (If = 0xFFFF then the &#8216; display_auto_x_coordinate&#8217; variable is used for the bitmap x coordiante.  This variable is updated with the next x coordinate each time this function is called to allow successive display across a screen).</p>
<p style="padding-left: 30px;">y_start_coord</p>
<p style="padding-left: 60px;">0 to DISPLAY_HEIGHT_PIXELS.  (If = 0xFFFF then the &#8216; display_auto_y_coordinate&#8217; variable is used for the bitmap y coordinate.  This variable is updated with the next y coordiante each time this function is called to allow successive display across a screen).</p>
<p style="padding-left: 30px;">*p_ascii_string</p>
<p style="padding-left: 60px;">Pointer to the string to be displayed (must be null terminated)</p>
<p>image_options standard defines:</p>
<p style="padding-left: 30px;">DISPLAY_STRING_INVERT_PIXELS_OFF</p>
<p style="padding-left: 30px;">DISPLAY_STRING_INVERT_PIXELS_ON</p>
<p style="padding-left: 30px;">DISPLAY_STRING_ON_X_AXIS</p>
<p style="padding-left: 30px;">DISPLAY_STRING_ON_Y_AXIS</p>
<p style="padding-left: 30px;">DISPLAY_STRING_MONOSPACE</p>
<p style="padding-left: 30px;">DISPLAY_STRING_PROPORTIONAL</p>
<p style="padding-left: 30px;">DISPLAY_STRING_LEFT_ALIGN</p>
<p style="padding-left: 30px;">DISPLAY_STRING_CENTER_ALIGN</p>
<p style="padding-left: 30px;">DISPLAY_STRING_CENTRE_ALIGN</p>
<p style="padding-left: 30px;">DISPLAY_STRING_RIGHT_ALIGN</p>
<p>These functions are relatively straightforward and they simply read the string one character at a time calling the display_display_bitmap function to display each character and to display the space between each character.  A bitmap is displayed for the space between each character so that any underlying display pixels are overwritten as a string is displayed and so that the number of pixels required between each character can be effectively set by the special gap character in each font table bitmap (character 0x7f).</p>
<p>Constant string usage example:-</p>
<p style="padding-left: 30px;">const rom BYTE sample_const_string[] = {&#8220;Hello World&#8221;};</p>
<p style="padding-left: 60px;">display_const_string(0, font_05x07, 			//Bitmap</p>
<p style="padding-left: 60px;">(DISPLAY_STRING_ON_X_AXIS | DISPLAY_STRING_INVERT_PIXELS_OFF |</p>
<p>DISPLAY_STRING_MONOSPACE |</p>
<p style="padding-left: 60px;">DISPLAY_STRING_LEFT_ALIGN),		//Options</p>
<p style="padding-left: 60px;">0, 0,					//X, Y</p>
<p style="padding-left: 60px;">sample_const_string);			//String</p>
<p>Variable string usage example:-</p>
<p style="padding-left: 30px;">BYTE sample_variable_string[15] = {&#8220;Hello World&#8221;};</p>
<p style="padding-left: 60px;">display_variable_string (0, font_05x07, 		//Bitmap</p>
<p style="padding-left: 60px;">(DISPLAY_STRING_ON_X_AXIS | DISPLAY_STRING_INVERT_PIXELS_OFF |</p>
<p style="padding-left: 60px;">DISPLAY_STRING_MONOSPACE |</p>
<p style="padding-left: 60px;">DISPLAY_STRING_LEFT_ALIGN),		//Options</p>
<p style="padding-left: 60px;">0, 0,					//X, Y</p>
<p style="padding-left: 60px;">sample_variable_string);		//String</p>
<p>This is a universal function – modification is not normally required.</p>
<p><strong> Special Note</strong></p>
<p>The X and Y start coordinates are screen based, not screen orientation based.  Depending on how your particular screen is addressed and orientated in your application the X and Y values may relate to either actual real world axis and their values may run in either direction.  An easy way of determining this for a new application is to display a bitmap or an ASCII text string in the centre of the screen and then alter the X and Y values to see how they affect the position of the bitmap or string.</p>
<p><strong>Text Alignment</strong></p>
<p>Left aligned text is the default way that strings are displayed.  If you select centre or right aligned text the driver has automatically to calculate the required string start position as if the string was left aligned.  It does this by simply displaying the string once, but with the data not actually being output to the screen, and then using the completed string end position to calculate the required left aligned string start position.  The string is then displayed again, this time being outputted to the display.  You don’t need to worry about the complexities of how the driver does this, but bear in mind that there is additional time required for this double processing of the string to take place.  The double display approach is required because when centre or right aligning proportional text (which centre and right aligning is so useful for from a programmers point of view) each character has to be completely read and analysed to determine its width.</p>
<h4>Byte Ordering Test Sequence</h4>
<p>void display_byte_ordering_test_sequence (BYTE flags)</p>
<p style="padding-left: 30px;">uc_flags</p>
<p style="padding-left: 60px;">bit 0 set = reset to byte 0</p>
<p style="padding-left: 60px;">bit 1 clear = move forwards 1 byte, set = move back 1 byte</p>
<p>This function may be used when configuring a new screen, to test how each sequential byte gets displayed on the screen.  Call the function the first time with bit 0 set.  The function will send a byte to the display at address 0&#215;00, 0&#215;00.  Using push buttons or a timer, repeat calling the function with bit 0 and 1 clear and the function will write to the next byte, then the next, then the next…</p>
<p>The test byte sent is formatted as follows:-</p>
<table style="width: 131.2pt; table-layout: fixed; border-collapse: collapse; margin-left: 66.6pt;" cellspacing="0" cellpadding="0pt">
<tbody>
<tr align="left" valign="top">
<td style="width: 5.6pt; height: 14.2pt; padding-right: 5.4pt; padding-left: 5.4pt; border-bottom: 1pt solid black;">7</td>
<td style="width: 5.6pt; height: 14.2pt; padding-right: 5.4pt; padding-left: 5.4pt;">6</td>
<td style="width: 5.6pt; height: 14.2pt; padding-right: 5.4pt; padding-left: 5.4pt;">5</td>
<td style="width: 5.6pt; height: 14.2pt; padding-right: 5.4pt; padding-left: 5.4pt;">4</td>
<td style="width: 5.6pt; height: 14.2pt; padding-right: 5.4pt; padding-left: 5.4pt; border-bottom: 1pt solid black;">3</td>
<td style="width: 5.6pt; height: 14.2pt; padding-right: 5.4pt; padding-left: 5.4pt; border-bottom: 1pt solid black;">2</td>
<td style="width: 5.6pt; height: 14.2pt; padding-right: 5.4pt; padding-left: 5.4pt; border-bottom: 1pt solid black;">1</td>
<td style="width: 5.6pt; height: 14.2pt; padding-right: 5.4pt; padding-left: 5.4pt; border-bottom: 1pt solid black;">0</td>
</tr>
<tr align="left" valign="top">
<td style="width: 5.6pt; height: 14.2pt; background-color: #000000; padding-right: 5.4pt; padding-left: 5.4pt;"><span style="color: #ffffff;"> </span></td>
<td style="width: 5.6pt; height: 14.2pt; padding-right: 5.4pt; padding-left: 5.4pt;"></td>
<td style="width: 5.6pt; height: 14.2pt; padding-right: 5.4pt; padding-left: 5.4pt;"></td>
<td style="width: 5.6pt; height: 14.2pt; padding-right: 5.4pt; padding-left: 5.4pt;"></td>
<td style="width: 5.6pt; height: 14.2pt; background-color: #000000; padding-right: 5.4pt; padding-left: 5.4pt;"><span style="color: #ffffff;"> </span></td>
<td style="width: 5.6pt; height: 14.2pt; background-color: #000000; padding-right: 5.4pt; padding-left: 5.4pt;"><span style="color: #ffffff;"> </span></td>
<td style="width: 5.6pt; height: 14.2pt; background-color: #000000; padding-right: 5.4pt; padding-left: 5.4pt;"><span style="color: #ffffff;"> </span></td>
<td style="width: 5.6pt; height: 14.2pt; background-color: #000000; padding-right: 5.4pt; padding-left: 5.4pt;"><span style="color: #ffffff;"> </span></td>
</tr>
</tbody>
</table>
<p>This is a really useful way to discover how the screen is mapped and if there are bytes at the beginning of the address space that are unused (i.e. you have to call the function several times before you see the first byte).  In this instance update the DISPLAY_WIDTH_START_OFFSET constant with the required offset to correct this.</p>
<p>This is a universal function – modification is not normally required.</p>
<h4>Write Bitmap Byte</h4>
<p>void display_write_bitmap_byte (BYTE bitmap_mask, BYTE bitmap_data, WORD x_byte_coord, WORD y_byte_coord);</p>
<p style="padding-left: 30px;">bitmap_mask</p>
<p style="padding-left: 60px;">bit high = use the bitmap_data value, bit low = use the existing screen value</p>
<p style="padding-left: 30px;">bitmap_data</p>
<p style="padding-left: 60px;">The data to write, controlled by the bitmap_mask bits</p>
<p style="padding-left: 30px;">x_byte_coord</p>
<p style="padding-left: 60px;">The X coordinate to write to</p>
<p style="padding-left: 30px;">y_byte_coord</p>
<p style="padding-left: 60px;">The Y coordinate to write to</p>
<p>This function first reads the current display value for the byte being addressed, then applies the bitmap data AND’d with the mask, before writing the byte back to the display.</p>
<p>If configuring the driver for a new screen then copy sample ‘display-model.c’ and display-model.h’ files for a screen that is most similar and then modify this function to suit the screen in use.</p>
<h4>Set Byte Address</h4>
<p>void display_set_address (WORD x_coord, WORD y_coord_page)</p>
<p>This functions deals with the complexities of how a screen is mapped and sends the address to be accessed to the screen.  Displays with non logical or reverse orientation addressing are corrected using this function.</p>
<p>If configuring the driver for a new screen then copy sample ‘display-model.c’ and display-model.h’ files for a screen that is most similar and then modify this function to suit the screen in use.</p>
<h4>Write Command</h4>
<p>void display_write_command (BYTE data)</p>
<p>This function is usually that same as the instructions in the write part of display_write_bitmap_byte.  The only difference may be setting the DC data / command line.  However to allow for screens that aren&#8217;t so normal this separate write command function is used.</p>
<p>If configuring the driver for a new screen then copy sample ‘display-model.c’ and ‘display-model.h’ files for a screen that is most similar and then modify this function to suit the screen in use.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.graphic-display-source-code-driver.com/how-the-driver-works/the-driver-functions-and-defines/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>c) Code and Data Memory Requirements</title>
		<link>http://www.graphic-display-source-code-driver.com/information/code-and-data-memory-requirements</link>
		<comments>http://www.graphic-display-source-code-driver.com/information/code-and-data-memory-requirements#comments</comments>
		<pubDate>Mon, 03 May 2010 11:01:55 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[07. Information]]></category>

		<guid isPermaLink="false">http://www.graphic-display-source-code-driver.com/?p=41</guid>
		<description><![CDATA[Code Size Example The following tests we’re carried out using a 128 x 64 pixel 8 bit parallel interface screen without using faster internal memory (DISPLAY_USE_LOCAL_RAM_BUFFER define disabled) and with all compiler optimisations turned off. PIC18 Sample Project: Approximately 7440 program memory bytes (3720 x 16 bit instructions) compiling just the driver functions with the [...]]]></description>
			<content:encoded><![CDATA[<h4>Code Size Example</h4>
<p>The following tests we’re carried out using a 128 x 64 pixel 8 bit parallel interface screen without using faster internal memory (DISPLAY_USE_LOCAL_RAM_BUFFER define disabled) and with all compiler optimisations turned off.</p>
<p>PIC18 Sample Project:</p>
<p style="padding-left: 30px;">Approximately 7440 program memory bytes (3720 x 16 bit instructions) compiling just the driver functions with the Microchip C18 MPLAB C Compiler for PIC18 family of 8 bit microcontrollers.</p>
<p>PIC24 Sample Project:</p>
<p style="padding-left: 30px;">Approximately 3334 program memory words (1677 x 24 bit instructions) compiling just the driver functions with the Microchip C30 MPLAB C Compiler for PIC24 family of 16 bit microcontrollers and dsPIC digital signal controllers.</p>
<p>PIC32 Sample Project:</p>
<p style="padding-left: 30px;">Approximately 7540 program memory bytes (1855 x 32 bit instructions) compiling just the driver functions with the Microchip C32 MPLAB C Compiler for PIC32 family of 32 bit microcontrollers.</p>
<h4>Variables Memory Space</h4>
<p>Approximately 16 bytes of static RAM (DISPLAY_USE_LOCAL_RAM_BUFFER define disabled)</p>
<p>The driver does not require a great deal of temporary variable storage space from the stack as bitmap data is read and displayed one byte at a time.</p>
<h4>Speed</h4>
<p>This will depend on your screen and processor / microcontroller.  As a basic guide, using the driver with the BATRON BTHQ128064 AVD COG 128 x 64 pixel sample screen and a PIC18 microcontroller running with a 6 MIPS instruction clock (3V3 powered) , internal program memory used to store bitmaps and DISPLAY_USE_LOCAL_RAM_BUFFER define disabled:-</p>
<p style="padding-left: 30px;">Displaying a single 128 x 64 pixel bitmap takes approximately 85mS.</p>
<p style="padding-left: 30px;">Displaying a 20 character left aligned ASCII text string, 5&#215;7 pixel font, monospaced characters takes approximately 25ms.</p>
<p style="padding-left: 30px;">Displaying a 20 character left aligned ASCII text string, 5&#215;7 pixel font, proportional characters takes approximately 29ms.</p>
<p>With a 10 MIPS instruction clock (5V powered)</p>
<p style="padding-left: 30px;">Displaying a single 128 x 64 pixel bitmap takes approximately 51mS.</p>
<p style="padding-left: 30px;">Displaying a 20 character left aligned ASCII text string, 5&#215;7 pixel font, monospaced characters takes approximately 15ms.</p>
<p style="padding-left: 30px;">Displaying a 20 character left aligned ASCII text string, 5&#215;7 pixel font, proportional characters takes approximately 17ms.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.graphic-display-source-code-driver.com/information/code-and-data-memory-requirements/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>b) Specifications</title>
		<link>http://www.graphic-display-source-code-driver.com/information/specifications</link>
		<comments>http://www.graphic-display-source-code-driver.com/information/specifications#comments</comments>
		<pubDate>Mon, 03 May 2010 11:00:31 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[07. Information]]></category>

		<guid isPermaLink="false">http://www.graphic-display-source-code-driver.com/?p=39</guid>
		<description><![CDATA[Maximum screen size 5000 x 5000 pixels Using The Driver With a RTOS or Kernel The stack / driver is implemented as a single thread so you just need to make sure it is always called from a single thread (it is not designed to be thread safe).]]></description>
			<content:encoded><![CDATA[<h4>Maximum screen size</h4>
<p>5000 x 5000 pixels</p>
<h4>Using The Driver With a RTOS or Kernel</h4>
<p>The stack / driver is implemented as a single thread so you just need to make sure it is always called from a single thread (it is not designed to be thread safe).</p>
]]></content:encoded>
			<wfw:commentRss>http://www.graphic-display-source-code-driver.com/information/specifications/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

