[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[avr-gcc-list] 4-bit LCD source

From: Mike Jones
Subject: [avr-gcc-list] 4-bit LCD source
Date: Mon, 17 Dec 2001 21:51:10 -0600

For anyone that is interested...

I followed the link on AVR-Freaks to Peter Feury's site and am using his
code which is a derivative of O. Volker. I have modified the code slightly
to work with the FUTURLEC 8535 development board (cheap but nice).

Peter, if you are listening, I have added the changes such that a #define
FUTURLEC turns on the right code, otherwise it leaves your code alone. Would
you like a copy of the LCD.c and LCD.h files as an update to those on your
website? One of the big differences was that your interface uses bits 0-3
for the datalines and mine needed bits 4-7.

I did have to make a slight hardware change to the Futurlec board because
they over-simplified the interface by forcing the R/W line to be Write-Only.
The fix to this is to cut the trace to the R/W pin on the LCD interface and
then run a jumper wire from Port C/bit 2 to the R/W pin. Otherwise, things
went pretty smoothly. My board is running at 8 Mhz but didn't seem to be any
problem even though the code looks like it was designed around a 4 Mhz


>There is some LCD stuff at AVRfreaks.net...don't know if you can use it
>    Eivind
>----- Original Message -----
>From: "Mike Jones" <address@hidden>
>To: "AVR GCC mail list" <address@hidden>
>Sent: Wednesday, December 12, 2001 6:25 AM
>Subject: [avr-gcc-list] Needed: 4-bit LCD source
>> I have finally gotten an LCD attached to my Dev board and I would like
>> use it with GCC. Has anyone written a 4-bit (Hitachi controller)

>> routine for GCC that they would like to share? I have one in Assembly
>> would rather not tackle interfacing an Assembly routine to GCC just
>> Mike

----- Original Message -----
From: "Chris Elmquist" <address@hidden>
To: <address@hidden>
Sent: Monday, December 17, 2001 2:06 PM
Subject: [avr-gcc-list] GCC 3.0.2 unsigned int bug?

> I'm new here... just playing around with avr-gcc 3.0.2 on
> Linux.
> I'm having trouble understanding this:
> void delay(void)
> {
>         unsigned int d;
>         d = 0x1000;
>         while (d) d--;
> }
> generates this code (using avr-objdump --disassemble):
> 0000004a <delay>:
>   4a:   80 e0           ldi     r24, 0x00       ; 0
>   4c:   90 e1           ldi     r25, 0x10       ; 16
>   4e:   80 50           subi    r24, 0x00       ; 0
>   50:   94 40           sbci    r25, 0x04       ; 4
>   52:   e9 f7           brne    .-6             ; 0x4e
>   54:   08 95           ret
> I can clearly see that the MSB goes in r25 and the LSB in r24
> but then why does it subtract 0x04 from the MSB each iteration?
> Suspecting maybe a disassembler problem, the '94 40' opcode
> indeed would subtract 0x40 from the MSB wouldn't it?
> Am I missing something obvious here or is this a bug?
> Chris
> --
> Chris Elmquist      mailto:address@hidden
> _______________________________________________
> avr-gcc-list mailing list
> address@hidden
> http://avr.jpk.co.nz/mailman/listinfo/avr-gcc-list

reply via email to

[Prev in Thread] Current Thread [Next in Thread]