LCD screen updates are way too fast [FIXED]

Discussion about my Wifi Radio project at http://mightyohm.com/wifiradio/ or my WL-520gU talk at NOTACON.
Post Reply
akula169
Posts: 16
Joined: Tue Feb 16, 2010 2:16 pm

LCD screen updates are way too fast [FIXED]

Post 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?
Last edited by akula169 on Sun Feb 21, 2010 11:38 am, edited 1 time in total.
akula169
Posts: 16
Joined: Tue Feb 16, 2010 2:16 pm

Re: LCD screen updates are way too fast

Post 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?
akula169
Posts: 16
Joined: Tue Feb 16, 2010 2:16 pm

Re: LCD screen updates are way too fast

Post 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?
akula169
Posts: 16
Joined: Tue Feb 16, 2010 2:16 pm

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

Post 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.
User avatar
mightyohm
Site Admin
Posts: 1063
Joined: Fri Apr 03, 2009 10:29 pm
Location: Seattle, WA
Contact:

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

Post 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?
akula169
Posts: 16
Joined: Tue Feb 16, 2010 2:16 pm

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

Post 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)
User avatar
mightyohm
Site Admin
Posts: 1063
Joined: Fri Apr 03, 2009 10:29 pm
Location: Seattle, WA
Contact:

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

Post 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...
Post Reply