LCD Problems w/ AVR Butterfly

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

I have recently purchased an avr butterfly. The software that came pre-loaded displayed text properly on the screen. Every C program ive loaded on it since then barely displays the text on the screen. It appears very dim and I can mainly only see it at an angle. I tried loading the original software back and the lcd is displaying text properly again. I am fairly confident i am loading the software back and forth properly, as the I/O works fine, and the original code works fine.

Obviously this sounds like a software related problem, but ive used code from various sites, including one piece from smileymicros.com.

Any help would be nice, thanks.

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

This sounds familiar, have you posted something similar recently?

You say the LCD contrast returns to normal when you reload the original program, but the contrast is bad with your custom written programs? IIRC there is a contrast byte that you must be messing with some way though at the moment I don't remember what that byte is (it is a bit late for me to look it up). Post a minimum example program that screws up the LCD and I (we) will look at and try to guess how you are stepping on the contrast byte.

Smiley

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

The easiest example would be your 'Smile'ys Workshop 6'. The entire program works fine on the butterfly, yet the contrast seems to be off. Unless i look at it straight on from a very low angle i can't seem to see the text. Whenever you get a sec to think about it, thanks for the response.

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

Without digging too deep (it's late), I think the contrast is the lower 4 bits of LCDCCR. The example I'm looking at stores 0x0C there. You might try playing with that idea, storing different values.

it's late

Chuck Baird

"I wish I were dumber so I could be more certain about my opinions. It looks fun." -- Scott Adams

http://www.cbaird.org

Last Edited: Wed. Jul 1, 2009 - 10:33 PM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

I'll have to put this on my schedule to look at in the next few days. I used an object file that I have to revisit the source.

Smiley

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

Thanks I appreciate it. If its any extra help, the exact same problem also occurred when i loaded the 'LCD-Test (timestamp, 20060128, local)' project from http://www.siwawi.arubi.uni-kl.d...

again, everything is functional except to view the lcd i must tilt it at a very low angle, otherwise its almost impossible to see the text.

Thanks again

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

Clearly this was a software problem. I was trying to figure out what was causing these similar lcd problems with the above code, as it is closest to atmels bf code. Turns out adding the following to lcd_driver.c fixed the problem:

//updated 2006-10-10, setting LCD drive time to 1150us in FW rev 07,
//instead of previous 300us in FW rev 06. Due to some variations on the LCD
//glass provided to the AVR Butterfly production.
LCDCCR |= (1<<LCDDC2) | (1<<LCDDC1) | (1<<LCDDC0);

I'm not sure how to fix the same problem occuring with the workshop6 files, as im currently unfamilliar with object files. Thanks again for the help.

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

Still haven't looked, but I'll bet that I did something ot the LCD contrast register that didn't affect mine but did affect yours. I'll look into it soon.

Smiley

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

Here's the hex file for a little quick and dirty program that lights up all the Butterfly's segments and steps through the 16 levels of contrast at 4 per second. It uses the 1150 microsecond drive time you mentioned (upper nibble of LCDCCR = 0x6) and varies the lower nibble of LCDCCR from 0x0 to 0xf.

Try it and see what you see.

I tried it on older (with light sensor) and very new (without light sensor, fuse set wrong) Butterflies, and it worked fine. I don't have a medium new (prior to the kaput fuse disaster, after the get-the-lead-out campaign) to try it on.

Attachment(s): 

Chuck Baird

"I wish I were dumber so I could be more certain about my opinions. It looks fun." -- Scott Adams

http://www.cbaird.org