SparkFun Forums 

Where electronics enthusiasts find answers.

Your source for all things Atmel.
By uidzer0
#41100
Hey everyone,

First post here =] - I picked up a 20x4 LCD from sparkfun (http://www.sparkfun.com/commerce/produc ... cts_id=256). The page states that the LCD is HD44780 compatible however I'm not having any luck getting this thing working. I'm using an ATMega16 with avr-gcc and I seem to be able to get the screen to initialize with a cursor but nothing beyond that.

I ran some searches prior to asking but didn't come up with any results. Does anyone have any experience with this LCD that would be willing to share their code?

Thanks!

Ben
By pelesl
#43604
uidzer0 wrote:Hey everyone,

First post here =] - I picked up a 20x4 LCD from sparkfun (http://www.sparkfun.com/commerce/produc ... cts_id=256). The page states that the LCD is HD44780 compatible however I'm not having any luck getting this thing working. I'm using an ATMega16 with avr-gcc and I seem to be able to get the screen to initialize with a cursor but nothing beyond that.

I ran some searches prior to asking but didn't come up with any results. Does anyone have any experience with this LCD that would be willing to share their code?

Thanks!

Ben
I have the same module, and it seems to be easy to program. The easiest thing is to use Procyon AVR Lib, which includes support for the HD44780:

http://www.mil.ufl.edu/~chrisarnold/com ... VR/avrlib/

Note that using this "library" is tricky. It's not actually a library, but a collection of source code. The latest build of AVR Studio has a bug that it cannot compile c files that are not in the project's directory, so to use parts of the AVR lib it's easiest to copy the files you think you need one by one and add them to your project (until you stop getting error messages). The download also includes a sample program for the HD44780.

AVR lib also includes "drivers" for various other modules that are available from Sparkfun. It's worth a look.

Something else that may save someone some time---I at first connected the "V0" contrast pin straight to VCC, which makes the contrast 0. Then I connected it to ground, which makes all the characters solid black. In other words; there's no way around using a proper voltage divider to see stuff on the display.

Currently, I'm using it with the same display and an AVR644. Unfortunately, I get garbled output. All the other stuff I have is 3.3V, so I decided to use the TXB0104 level translators to boost to the 5V this thing needs. Unfortunately, I am getting some noise in the signals which cause the output of the TXB0104 to turn on and off when it's not supposed to so I get garbage on the display. I'm hoping it's because of the prototyping jumper wires (versus PCB) that I'm using, but I've been unable to get around the problem even in trying to use filtering capacitors.
Last edited by pelesl on Wed Feb 27, 2008 12:36 pm, edited 1 time in total.
By pelesl
#43609
pelesl wrote:Currently, I'm using it with the same display and an AVR644. Unfortunately, I get garbled output. All the other stuff I have is 3.3V, so I decided to use the TXB0104 level translators to boost to the 5V this thing needs. Unfortunately, I am getting some noise in the signals which cause the output of the TXB0104 to turn on and off when it's not supposed to so I get garbage on the display. I'm hoping it's because of the prototyping jumper wires (versus PCB) that I'm using, but I've been unable to get around the problem even in trying to use filtering capacitors.[/url]
I saw this post:

viewtopic.php?t=8601&highlight=lcd

and tried running the display with no level translators. At first I thought I needed them because of the output logic levels (from the display module) for checking the busy flag. Anyway, it seems to work just fine driving it from the processor running at 3.3V.
By bgat
#66238
I'm also using a TXB0104 to do 3.3 to 5V conversion, and I've found the same problem--- this chip seems _incredibly_ sensitive to power supply noise.

Anyone figure out a way to make this chip actually work? I've tried all kinds of bypass caps, including .1uF, .01uF and 33pF caps in parallel at the chip itself--- no joy.

Anyone have any suggestions?


Thanks!


b.g.
By bgat
#66256
Unless I'm missing something, the link you sent was for software and I think I have a hardware problem. How does that help?
By Freak Nigh
#66373
I wasn't talking to you our ignorant friend. And you probably are missing something, it probably is a software issue and the code does tell you all the pins you need to hook up and it doesn't mention capacitors so that should have been some hardware help.
By bgat
#66374
Freak Nigh wrote:I wasn't talking to you our ignorant friend. And you probably are missing something, it probably is a software issue and the code does tell you all the pins you need to hook up and it doesn't mention capacitors so that should have been some hardware help.
HAND. :roll:
By Freak Nigh
#66486
yes its pretty hand, thats how i tried to make it
By signal7
#66639
bgat, if you're still reading this, I'd like to help but I haven't used the specific chip you're asking about. Can you tell us more about the conversion you are doing? Is this for a I2C or TWI bus? Or is it for some other situation?

Without more details, I can't offer any suggestions.