This shows you the differences between two versions of the page.
| Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
| arduino:mx300_driver_library [2019/01/24 11:50] – tony | arduino:mx300_driver_library [2023/03/12 09:01] (current) – tony | ||
|---|---|---|---|
| Line 1: | Line 1: | ||
| - | {{: | ||
| < | < | ||
| < | < | ||
| Line 18: | Line 17: | ||
| ===== Overview ===== | ===== Overview ===== | ||
| - | I looked for an Arduino library that would display double height characters and found quite a few, I have taken ideas from various fonts/ | + | I looked for an Arduino library that would display double-height characters and found quite a few, I have taken ideas from various fonts/ |
| I based my library module for this on a standard Arduino library for the Hitachi HD44780 chip, LiquidCrystal.cpp. The programs included here are HelloWorld_mx300.ino, | I based my library module for this on a standard Arduino library for the Hitachi HD44780 chip, LiquidCrystal.cpp. The programs included here are HelloWorld_mx300.ino, | ||
| - | The command set is compatible with the Hitachi HD44780, but I don't know the model of the chip, or even the manufacturer. | + | The command set is compatible with the Hitachi HD44780, but I don't know the model of the chip, or even the manufacturer. |
| ===== Hardware description ===== | ===== Hardware description ===== | ||
| - | {{: | + | {{: |
| - | I experimented a little, but could not get the modules to display a 5 by 11 character mode. I have no idea whether the modules have inbuilt double height characters, I have no idea of the controller chip they use. I do note that the Canon MX300 printers display double height numeric characters mixed with normal characters - I expect they are using the programmable character set to do this. | + | I experimented a little, but could not get the modules to display a 5 by 11 character mode. I have no idea whether the modules have inbuilt double-height characters, I have no idea of the controller chip they use. I do note that the Canon MX300 printers display double-height numeric characters mixed with normal characters - I expect they are using the programmable character set to do this. |
| \\ | \\ | ||
| \\ | \\ | ||
| Line 41: | Line 40: | ||
| The control and data pins can be any available Arduino pins. | The control and data pins can be any available Arduino pins. | ||
| - | ===== LCD Library | + | ===== LCD library |
| - | As mentioned earlier the library is based on a standard Arduino HD44780 LCD library. | + | As mentioned earlier the library is based on a standard Arduino HD44780 LCD library. |
| There are a number of different implementations here, reflecting different approaches : | There are a number of different implementations here, reflecting different approaches : | ||
| - | * A set of double height, single width, digits just using the programmable character set | + | * A set of double-height, single-width, digits just using the programmable character set |
| - | * A set of double height, single width, digits which are stretched versions of the normal digits, dynamically reprogramming the programmable characters as required. | + | * A set of double-height, single-width, digits which are stretched versions of the normal digits, dynamically reprogramming the programmable characters as required. |
| - | * A complete ASCII character set of double height characters, up to 4 normal character spaces wide. Created using a fixed set of programmable characters, plus some existing characters, as segments of each double height character. | + | * A complete ASCII character set of double-height characters, up to 4 normal character spaces wide. Created using a fixed set of programmable characters, plus some existing characters, as segments of each double height character. |
| The drivers still contain the standard Hitachi HD44780 functions, but some are not really applicable to the double height characters. | The drivers still contain the standard Hitachi HD44780 functions, but some are not really applicable to the double height characters. | ||
| Line 80: | Line 79: | ||
| * Set orientation to normal or transform the orientation without changing the contents of the display. | * Set orientation to normal or transform the orientation without changing the contents of the display. | ||
| - | The autoscroll() function doesn' | + | The autoscroll() function doesn' |
| - | The existing functions that are still there, but may have unwanted side effects when used with double height characters are: | + | The existing functions that are still there, but may have unwanted side effects when used with double-height characters are: |
| * blink(); | * blink(); | ||
| * noBlink(); | * noBlink(); | ||
| Line 100: | Line 99: | ||
| The functions appear to be the same as for the HD44780 but have not been extensively tested for compatibility. | The functions appear to be the same as for the HD44780 but have not been extensively tested for compatibility. | ||
| - | As per earlier drivers I have modified the createChar() routine to switch back to display ram after defining each character to avoid accidentally corrupting the programmable characters (this is a problem from the original LiquidCrystal.h library). | + | As per earlier drivers, I have modified the createChar() routine to switch back to display ram after defining each character to avoid accidentally corrupting the programmable characters (this is a problem from the original LiquidCrystal.h library). |
| \\ | \\ | ||
| \\ | \\ | ||
| - | **--- Set of double height, single width, digits just using the programmable character set**\\ | + | **--- Set of double-height, single-width, digits just using the programmable character set**\\ |
| - | This library version has a character set of 10 double height, 1 character wide, numeric digits. | + | This library version has a character set of 10 double-height, 1 character wide, numeric digits. |
| - | Each half (upper and lower) of each double height character is formed by one custom programmed user defined LCD character. A second font option also uses a few existing LCD characters from the controller' | + | Each half (upper and lower) of each double height character is formed by one custom programmed user-defined LCD character. A second font option also uses a few existing LCD characters from the controller' |
| - | The double height font is defined by an array of 2 bytes per digit (upper and lower halves), times 10 digits. | + | The double-height font is defined by an array of 2 bytes per digit (upper and lower halves), times 10 digits. |
| Two different sets of segment definitions are used here to demonstrate two different fonts. | Two different sets of segment definitions are used here to demonstrate two different fonts. | ||
| Line 160: | Line 159: | ||
| - | **--- Set of double height, single width, digits which are stretched versions of the normal digits, dynamically reprogramming the programmable characters as required**\\ | + | **--- Set of double-height, single-width, digits which are stretched versions of the normal digits, dynamically reprogramming the programmable characters as required**\\ |
| - | This library version has a character set of 10 double height, 1 character wide, numeric digits. | + | This library version has a character set of 10 double-height, 1 character wide, numeric digits. |
| - | Each digit has its own full 5 pixel wide by 16 pixel high definition - ie these fonts are not made up of segments assembled for each character, instead every one of the forty pixels can be used to define each character. | + | Each digit has its own full 5 pixel wide by 16-pixel high definition - ie these fonts are not made up of segments assembled for each character, instead every one of the forty pixels can be used to define each character. |
| - | If you attempt to print a non-digit (eg an alphabetic character) in double height mode , it will just print it as a single height character on the second line. This program could be expanded into a full alpha/ | + | If you attempt to print a non-digit (eg an alphabetic character) in double-height mode , it will just print it as a single height character on the second line. This program could be expanded into a full alpha/ |
| \\ | \\ | ||
| < | < | ||
| Line 176: | Line 175: | ||
| </ | </ | ||
| - | The full double height {{: | + | The full double-height {{: |
| \\ | \\ | ||
| \\ | \\ | ||
| Line 187: | Line 186: | ||
| **--- Complete ASCII character sets**\\ | **--- Complete ASCII character sets**\\ | ||
| - | This library version has a character set of 96, double height, 1 to 4 character wide, alpha numeric | + | This library version has a character set of 96, double-height, 1 to 4 character wide, alphanumeric |
| - | The segments of each double height character are made up from custom programmed user defined LCD characters and a few existing LCD characters from the controller' | + | The segments of each double height character are made up of custom programmed user-defined LCD characters and a few existing LCD characters from the controller' |
| - | The double height font is defined by an array of 8 bytes per character (2 rows of 4 segments per character), times 96 characters - a bit wasteful in the context of an Arduino! | + | The double-height font is defined by an array of 8 bytes per character (2 rows of 4 segments per character), times 96 characters - a bit wasteful in the context of an Arduino! |
| Two different sets of segment definitions are used here to demonstrate two different fonts. | Two different sets of segment definitions are used here to demonstrate two different fonts. | ||
| Line 248: | Line 247: | ||
| ]]. | ]]. | ||
| + | * [[: | ||
| * [[: | * [[: | ||
| * [[: | * [[: | ||