Page 1 of 1

LCD screen updates are way too fast [FIXED]

Posted: Fri Feb 19, 2010 8:38 pm
by akula169
Finally had the parts/time to put together the LCD board today.

I have a 20x4, so I know I'll have to work the code over pretty good, as I'd like to display everything on the same screen refresh, not two toggled screens...

anyhow... so far, using the code meant for the 16X2, everything looks good except for when the screen is supposed to switch from "Name" to "Title" - it happens in a flash, so I never actually see the "Title" screen (except for a noticable blip)

Also, the side-to-side scroll is very fast.

I've fiddled with the DELAY values in main.c , even set them to ridiculously high numbers and it doesn't seem to make a difference. Maybe something is wrong with my clock (crystal) or that particular circuit?

Re: LCD screen updates are way too fast

Posted: Sat Feb 20, 2010 12:54 am
by akula169
Ok - so I got a 16x2 today and tried it. Same issues.

I also decided to disconnect the soldered crystal circuit on my proto board and try with another set of crystal and caps on breadboard - still the same problem.

The long Title scrolling happens so fast I can barely see it, and I can see the station Name flash under it every second or so. Then after about 7-10 seconds the station Name will display for a while. Then back to the same loop.

I'm having a hard time figuring out where the issue is... hardware or software?

Re: LCD screen updates are way too fast

Posted: Sun Feb 21, 2010 11:15 am
by akula169
OK, so I'm closer...

I flashed your pre-compiled hex file and it works as expected.

Anything that I compile makes for f-ed up code who's timing is all off...

So maybe some avr-gcc switches need to be custom set for my environment?

Re: LCD screen updates are way too fast [FIXED]

Posted: Sun Feb 21, 2010 11:39 am
by akula169
OK - so instead of a linux host, I used a Mac to compile the code...

NOW WORKING!

Sorry for my thinking out loud here, but maybe it'll help someone with similar problems.

Re: LCD screen updates are way too fast [FIXED]

Posted: Mon Feb 22, 2010 8:27 pm
by mightyohm
Oh, that is very interesting!

I wonder what is going on... I'll have to look into this. What version of gcc-avr are you using on both platforms?

Re: LCD screen updates are way too fast [FIXED]

Posted: Mon Feb 22, 2010 8:30 pm
by akula169
on the MacPro (works):

Code: Select all

macpro:static bryan$ avr-gcc -v
Using built-in specs.
Target: avr
Configured with: ../configure --prefix=/usr/local/CrossPack-AVR-20100115 --disable-dependency-tracking --disable-nls --disable-werror --target=avr --enable-languages=c,c++ --disable-nls --disable-libssp --with-dwarf2
Thread model: single
gcc version 4.3.3 (GCC) 
On the Fedora box (version 8 - may be the issue):

Code: Select all

[akula@leia ~]$ avr-gcc -v
Using built-in specs.
Target: avr
Configured with: ../gcc-4.1.2/configure --prefix=/usr --mandir=/usr/share/man --infodir=/usr/share/info --target=avr --enable-languages=c,c++ --disable-nls --disable-libssp --with-system-zlib --enable-version-specific-runtime-libs
Thread model: single
gcc version 4.1.2 (Fedora 4.1.2-5.fc8)

Re: LCD screen updates are way too fast [FIXED]

Posted: Fri Feb 26, 2010 11:36 pm
by mightyohm
Grumble... I will have to play with this more. Thanks for the info.

I am involved with a project to write a book about AVR and I know this is going to come up at some point since we want to support all 3 major platforms, Win, OSX, Ubuntu/Linux...