Direct connection from 5v LCD to XMEGA

Go To Last Post
13 posts / 0 new
Author
Message
#1
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

I connected a 128x64 ks108 based lcd to XMEGA with 5v supply for lcd and 3.3v for XMEGA. There is a read function in lcd library, which reads data from lcd to microcontroller. According to 5v supply for lcd and direct connection of Data bus between lcd and XMEGA, I expected a possible damage to lcd or XMEGA. But surprisingly it works fine. I also tested this for ATMEGA64A and it also works without damage.

Ozhan KD
Knowledge is POWER

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Trial and error is not a good method to determine the limits of the mcu.

The datasheet is the proper method.

There are internal clamping diodes that can protect the inputs up to a degree but they have limits in the current capacity.

Alex

Attachment(s): 

"For every effect there is a root cause. Find and address the root cause rather than try to fix the effect, as there is no end to the latter."
Author Unknown

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Most 128x64 displays will work fine at 3.3V.

You are violating the spec for the Xmega.
It will not always fail immediately.
But when it does fail, who do you blame?

The simple rule is: operate 3.3V devices at 3.3V.

David.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Have enough people said: "Don't do that!" yet?

There are some options for you to consider:

KS108 is an older, and commonly used, GLCD controller. If you want to use it use one of the "older" AVR's, (a Megaxxx), that can run at 5 V volts. This matches a 5V peripheral with a 5V micro.

There are many, many GLCDs on the market. If you want to use a 3V micro then buy a 3V GLCD. This matches a 3V peripheral with a 3V micro.

There is a "Sticky Thread" about level conversions between 5V and 3V devices. Quite a hassle for a GLCD, when 3V GLCDs are readily available, but doing this would then keep all of the electronics within specification.

There was another Thread or two that discussed running 5V LCDs at 3V, which many of them will operate at, (depending upon their circuitry). This required further adjustment to the contrast voltage. (Fine for a one-off project for yourself, not so great for a commercial product.)

One can use a small 5V micro to drive the GLCD and have a serial interface to the Xmega. Such a set up is often called a Serial Backpack. One still needs to do level conversion, but only on one or two signals, not on the full interface bus.

Do NOT try running the Xmega at 5V, that will destroy the Xmega rather quickly.

JC

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

I already connected a T6963c-Based lcd to XMEGA with series resistors on Data lines (for protection diodes current limiting) and my first post is only a REPORT on XMEGA behavior when connected to 5v ks108 lcd.

Ozhan KD
Knowledge is POWER

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

electronic.designer wrote:
I expected a possible damage to lcd or XMEGA.But surprisingly it works fine

This kind of report is not very reassuring.
"Try it too, you may be lucky and work like it did for me"...

And there was no mention of any resistors in the report.

Alex

"For every effect there is a root cause. Find and address the root cause rather than try to fix the effect, as there is no end to the latter."
Author Unknown

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Resistors are not present in ks108 case. For more details:
I have my own made XMEGA evaluation board
https://www.avrfreaks.net/index.php?name=PNphpBB2&file=viewtopic&t=104565&start=0&postdays=0&postorder=asc&highlight=
which has not current limiting resistors on lcd data lines. 5v lcds are more available and have less price in my location. Thus 5v lcd was choosed for connecting to evaluation board. The code only writes to lcd with sufficient delays between data/commands and there is no need for busy check and reading lcd data bus. So everything is ok with 5v lcd.
Recently I have converted Fabian Maximilian Thiele ks108 library for XMEGA and it works fine. But I considered there is a read action in this library and I had not paid attention to this data reading from lcd. And this report was generated.

Ozhan KD
Knowledge is POWER

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

hi there

i connected Xmega32a4 and run frequency meter "sample cod for Xmega by electronic.designer" and put 5V type 2X16 character LCD and add some 1k ohm resistance in databus and control bus it work fine !!!
also i check the bus carefully by oscilloscope ! before and after 1k ohm resistance the signal not exeed 3.2V anymore !!

what do you think about ?

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

The clamping diodes seem to work doing their job. I'd say it is fine, no need to worry.

Atmel kind of official support the current limiting resistor method. They have an app note where they connect the raw 240V mains (peak over 300V) to an older AVR via a 1M resistor. You might want to add a zener on the microcontroller side but at the kinds of low currents and short distances you are looking at I wouldn't worry too much.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

You're probably getting away with it because the display's output drivers are small enough not to make too much current through the clamping diode.

Of course, to be sure, just put a 1K resistor in each line. Then you know the clamp diode won't be suffering more than 2mA. Well, ok, 1.7mA.

So this is a low power or battery device and you don't want to be drawing 1.7 * 8 mA? Get a 3v display Or just don't bother reading the data from of the display.

The largest known prime number: 282589933-1

It's easy to stop breaking the 10th commandment! Break the 8th instead. 

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Lots of others have addressed this already.

Even after working out the electrical issues between the xmega and 5V LCD, you can't run the xmega at full speed without running into serious timing issues.

Just save yourself a headache and get a spi lcd.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Why do you need to READ from the display?

The simple solution is to put the thing into write mode all the time and simply run an internal timer in the XMega to time the worst case time for each write to complete (in lieu of polling the busy bit) and then you don't need to worry about level conversions because the display NEVER drives anything back to the XMega.

There is little difference between timing a write completion with a timer and polling the busy bit. Sure, it might complete faster because you're not getting worst case timing where with timing it you have to assume the write completions are worst case always BUT LCD displays are SLOW and you simply need to deal with it (and you will regardless if you time it yourself or you go through the effort of adding the level translation hardware and poll the busy bit). You can still write an entire display fast enough with assuming worst case timing using the timing method that to a human, it'll just flash like the whole thing updated instantly.

You will need to modify the library to accommodate this since after each register write you need to insert the worst case delay or run a timer in interrupt mode and simply poll for when a "done" bit is set by the interrupt routine upon each entry to the register write routine so it stalls if the immediately prior write isn't perceived as complete yet. BUT LCD libraries are dirt simple. Aside from the initialization sequence needed to get the display in 4 bit or 8 bit mode (which the manufacturer tells you explicitly in the device data), all other operations are simply register writes.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

electronic.designer wrote:
I have converted Fabian Maximilian Thiele ks108 library

Ozhan KD
Knowledge is POWER