The most important thing needed to ensure that the module is connected properly is a known accurate datasheet.
Do you have a datasheet for this module?
Below is some additional comments that I'll keep a bit general until I can see the datasheet.
Keep in mind that certain types of mis-wiring can damage the module so be very careful when wiring up
the power signals and the contrast circuit.
That usually means paying very close attention to glcd module pins 1, 2, 3, 18, 19, and 20,
along with how the contrast pot is wired. (but not all glcd modules have the same wiring)
So before proceeding any further, it would be best to locate the datasheet for this glcd module.
Note: Any pin numbers that I mention below are typical pins and will need to be verified against
the datasheet for your glcd module as you glcd module might use different pin numbers.
I connected the TM12864L-1 board as you suggested but still no go. I could see the backlight and contrast when I did the test last week but now only the backlight lighted up. I just connected the backlight pins 18, 19, 20 and contrast pins 1, 2, 3 to do the test.
Not sure what you mean by this. ks0108 backlights only use 2 pins. Usually backlight pins on a ks0108 module are 19 and 20.
Pin 18 on most ks0108 modules is Vee which is a negative voltage output that is used with a POT to create the voltage
to feed to the Vo contrast input which is often on pin 3.
What did you mean by "contrast pins 1, 2, and 3" ??
- Connect pin 17 (RESET) to the +5V solved the COM error ( this prevents the upload of sketch).
Reset is an area that can vary across modules. Some glcd modules will not properly work without a reset.
Mandy do seem to work ok without one. For the ones that work ok with out needing an explicit reset, all of those will
work by tieing their RST signal to VCC and some will work by leaving RST totally unconnected.
Connecting the RST/reset signal on the glcd module to the Arduino reset was a way to cheat
and provide a reset to the glcd module without having to use another Arduino pin or create any additional external
It seems to have some issues with the auto-reset circuitry on the newer Arduino boards.
(BTW, the new auto-reset circuitry on the Uno boards has some other issues independent of this glcd issue as well
In fact they are looking at re-spinning the Uno boards to resolve it).
All that said, yes you can tie the reset to vcc to ensure the the glcd module is not reset.
But this may or may not work, depending on the glcd. If you have a glcd module that requires a reset,
it won't work so the safest thing to do is to have the glcd library perform the reset in software by assigning the glcd reset
function its own pin. You can do this by uncommenting out the line in the ks0108 mega pin configuration file.
Simply uncomment the glcdRES line but also change the 32 to use pin 30 instead.
That 32 was a bug in the library and it has since been corrected (but an updated library has not yet been released)
so to be compatible with future releases it is best to change the 32 to pin 30 if you plan to use it.
Then hook pin 30 on the mega up to the RST signal on the glcd (often this is glcd module pin 17)
- Another question about potentiometer, how do you wire it ? I connected pin 3 of the tm12864 to the middle pin of the pot, pin 18 to 1 leg of the pot and the other leg connected to Ground as the below diagram.
: : :
: : :
Ground pin 3 pin 18
I wonder if the contrast light is damged !
There is no "contrast light" on a ks0108. There is, however, a negative power supply that creates the needed negative voltage
that is used to drive the glcd modules contrast circuity. This negative voltage is the Vee signal.
Often this is pin 18 on ks0108 modules.
Assuming that pin 18 is Vee and pin 3 is Vo and the Vo signal is on the wiper (center pin) of the pot in your figure,
then it looks like this wiring is correct.
Again, without seeing your modules datasheet, I cannot verify any pin wiring.
Out of curiosity, as I'm always looking for ways to improve the library documentation, is there anything
that could make the wiring of the potentiometer clearer or easier to understand.
And which of the documents were you looking at:
- the table on the ks0180 playground
- the table and figures in the pdf file that comes with the library
- the table and figures in the HTML documentation that come with the library.