Pages: [1]   Go Down
Author Topic: Wiring problem with TM12864L-1 and Mega2560  (Read 1928 times)
0 Members and 1 Guest are viewing this topic.
Offline Offline
Newbie
*
Karma: 1
Posts: 20
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Hi

Has anyone managed to connect this board working with the GLCD version 3 ?  This board is a KS0108 type.
 
I followed the guide with ks0108 wiring in columb B of the graphics LCD library page. However, when I uploaded those example files accompany with GLCD library, the process took long time and then the COM port error displayed " COM10 in use, please disable other program ". I could see the panel light up but nothing else. 

I tested the wire connections and discovered that pin 17 of the TM12864 board which connects to RESET on Arduino board caused the uploading problem of the sketch.  Disconnect pin 17 and the sketch uploads as normal without error but it doesn't display anything. I connected the pot with 3 wires 2, 3 and 18 according to the manual and the table showed.

What else should I do to test the board ?  Has anyone got a working wiring with this board ?
Thanks in advance for your help.

Tony
 
Logged

Castlegar , B.C. , CANADA
Offline Offline
Newbie
*
Karma: 0
Posts: 13
An old dog learning new tricks !
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Tony :  I am brand new to the 2560 . I've only had the thing for 2 weeks . Lotsa fun .
I just went thru this same exercise and know exactly what was happening . Wire the display to the power and backlighting pins firstly . TEST is to verify that the display lights up /adjusts properly .
The sketch that I used was the glcd ver.3 ones and they all work . I figured out the " hard way " that the 2560 uses pins 22 thru 29 for data and 33 thru 38 for the control pins . MY main problem had to do with the RESET pin on the display itself . Wire this guy to +5 ( not on the 2560 ! ) As soon as I did that , everything went good .
 As for COM errors , I temporary unplug the +5 volts going to my breadboard where the display is wired . Upload the program , then plug in the +5 again . ( 2560 running on my laptop USB )

Hope this helps .
Logged

Castlegar , B.C. , CANADA
Offline Offline
Newbie
*
Karma: 0
Posts: 13
An old dog learning new tricks !
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

 Tony :

 I have only had my 2560 for a couple of weeks but went thru this same exercise last weekend . Keep in mind that some of the older sketches use other Arduino models . The 2560 uses pins 22 thru 29 for DATA and 33 thru 38 for the control lines to operate a 12864 LCD display . ALL of the glcd sketches work just fine !  ( glcd Ver. 3 )
 Don't make the mistake that I did by connecting the RESET line of the LCD to the reset on the 2560 . As soon as I just tied the LCD   RESET line to + 5 , everything went good !  Wire and TEST your power and backlighting firstly , then connect up the rest of the signals later .
 COM  errors :  I use my laptop's USB port to run the 2560 . I power my breadboard from the 2560 . IF   I disconnect the +5 going to the breadboard before downloading a program , no problems . THEN reconnect the +5 and run the 12864 LCD display . Rgis always works and prevents the 2560 from " hanging up " .  You may also have some success by trying another USB port and re-assigning the 2560 from the TOOLS panel .

Hope this helps .
Logged

Offline Offline
Newbie
*
Karma: 1
Posts: 20
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Hi Ugwick

I discovered that if I connect pin 17 ( RESET) on the TM12864 board to the RESET pin on the 2560 board then I can't not upload the sketch with the COM port error.  I disconnect it then the program uploads as normal. I did not know what to do with it, so I leave the TM12864 board aside to continue to test other components I bought as a kit.  I am also new to the Arduino.

I will do as you suggested and let you know how it goes. I google for a whole week to find a solution without any success.
Thank you very much for your help.
Regards
Tony
Logged

Offline Offline
Newbie
*
Karma: 1
Posts: 20
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Hi Ugwick

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. 

- Connect pin 17 (RESET) to the +5V solved the COM error ( this prevents the upload of sketch).

- 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.
 
                                                      potentiometer
                                             ----------------------------
                                             :                 :                 :
                                             :                 :                 :
                                         Ground         pin 3           pin 18

I wonder if the contrast light is damged !

Tony



Logged

Dallas, TX USA
Offline Offline
Edison Member
*
Karma: 47
Posts: 2334
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Tony,
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" ??


Quote
- 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
circuitry.
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.
glcd/config/ks0108_Mega

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)

Quote
- 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.
 
                                                      potentiometer
                                             ----------------------------
                                             :                 :                 :
                                             :                 :                 :
                                         Ground         pin 3           pin 18

I wonder if the contrast light is damged !
Tony

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.

--- bill
Logged

Offline Offline
Newbie
*
Karma: 1
Posts: 20
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Hi Bill

Thank you very much for your comment and advise.  I am totally new to electronics and Arduino particularly. After reading some information about Arduino I couldn't wait to jump straight into it. So far I have no problem to do the basic test with other components ( sensor, motor, servo ) by following instructions on the net, except this GLCD board.

Attached is the datasheet of the TM12864L-1 board.

I wired the board by following the guide of the table on the ks0180 playground.  I used the Pinout B of the table which appears to match with the datasheet.

This is what I did to test the board: ( by followed the suggestion of Ugwick ).

- Connect pin 19 (+5V) , 20 (Gnd) to the power supply  .  The backlight lighted up when I connected it.
- Connect pin 2 to 5V pin of the Arduino , connect pin 1 to Gnd on Arduino.
- pin 3, 8 and Gnd connect to the Pot ( as on the diagram I draw earlier). Also I tried to replace the Gnd cable with the +5V ( ie, 3, 8, 5V on the pot).
- pin 17 connect to 5V (arduino)  ( if I connect to Reset pin as suggested by the table then the upload will display the COM port in use ).
With this wiring, I see only the backlight.  I wonder if I do need to connect all pins in order to see the contrast.

Before I did the above test, I connected all necessary pins and I could see the contrast appeared on the screen but had trouble with the sketch upload. After I managed to upload the diagnostic and demo sketches, only the backlight and constrast displayed .
 
So much to learn and I really enjoy the challenge :-)

Very much appreciated for your help.

Tony


 


* TM12864L-1=KS0108.pdf (80.85 KB - downloaded 22 times.)

* TM12864L-back.jpg (182.82 KB, 1134x850 - viewed 32 times.)

* TM12864L-Front.jpg (87.88 KB, 1325x993 - viewed 23 times.)
Logged

Dallas, TX USA
Offline Offline
Edison Member
*
Karma: 47
Posts: 2334
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Attached is the datasheet of the TM12864L-1 board.
That looks like the correct datasheet. This will be very helpful.

Quote
I wired the board by following the guide of the table on the ks0180 playground.  I used the Pinout B of the table which appears to match with the datasheet.

The datasheet does match pinout B. So this is good.

Quote
This is what I did to test the board: ( by followed the suggestion of Ugwick ).

- Connect pin 19 (+5V) , 20 (Gnd) to the power supply  .  The backlight lighted up when I connected it.
- Connect pin 2 to 5V pin of the Arduino , connect pin 1 to Gnd on Arduino.
- pin 3, 8 and Gnd connect to the Pot ( as on the diagram I draw earlier). Also I tried to replace the Gnd cable with the +5V ( ie, 3, 8, 5V on the pot).

I assume you mean glcd pin 18 not glcd pin 8 ?

A few more questions.
Are you using glcd v3? The ks0108 v2 library will not work with the 2560,
it will silently incorrectly use the Arduino pins for a regular Arduino board vs the mega
which will not work.

Assuming you are using the glcd v3 library, the next step will be to run the included glcd diagnostic sketch
and post the serial output here. That will help me further diagnose any remaining issues.

--- bill
Logged

Offline Offline
Newbie
*
Karma: 1
Posts: 20
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Hi Bill

Sorry for my typing error, it should read pin 18.
I used GLCD ver.3 - RC2

The good news is I found the problem, it caused by the faulty potentiometer which controls the screen's contrast. After replacing with another 20K potentiometer, it works perfectly.

In summary, in order for this TM12864L-1 works, the following should be observed:

1. Use the lgcd library ver.3 
2. Use pinout B on the table of the ks0180 playground or in the glcd doc.
2. Pin 17 on the TM12864 should be connected to +5V of the power supply, NOT to the reset pin on arduino ( it was Ugwick who found out ).
3. Use a 20K potentiometer : 
        - pin 3 of the tm12864 connets to the wiper of contrast pot ( the middle pin ).
        - pin 18 of the lcd connects to one leg of the pot.
        - the other leg of the pot connects to 5V pin of the arduino.

I will post the wiring table and the pot's wiring soon for people who may have similar problem like me  smiley

Finally, my thanks to Bill and Ugwick who have given me lots of help. It is really a great commnuity.

Tony
 
Logged

Dallas, TX USA
Offline Offline
Edison Member
*
Karma: 47
Posts: 2334
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Tony,
With exception of the reset wiring,
all that wiring information is already in the wiring table on the ks0108 Playground site.
There is even a separate paragraph about how to wire up the contrast pot.
Is there something that needs clarification in the table or the documentation?

The reset issue is not an issue with the library or the glcd module.
As I briefly mentioned earlier, the newer Arduino boards have design issues with their auto-reset circuitry
that is just start to rear its ugly head.
Connecting the glcd modules RST line to the mega board is probably aggravating the auto-reset problem and
causing the sketch download issues.
I probably need to update the documentation to provide a work around for their issues.
The safest thing is to wire up another arduino pin to allow the glcd library to perform
the reset of the glcd module in software.

If you can spare another pin, I would recommend doing this to avoid any issues in the future
with respect to initializing the glcd module. Especially if you ever intend to re-initialize the glcd module
without powering down the arduino board.

--- bill
Logged

Offline Offline
Newbie
*
Karma: 1
Posts: 20
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Hi Bill

I have read doc. in the ks0108 playground and glcd, they are correct. However, it may need to re-write in the pot's wiring paragraph for non-tech people, ie. pin 3 (Vo contrast pin) connects to the wiper of the pot (middle pin), pin 18 (Vout) connects to one leg of the pot and pin 2 connects to another leg.
 
Yes, using another pin and reset it through software when needed is a perfect approach.
Thanks again for your great help.

Tony
Logged

Pages: [1]   Go Up
Jump to: