Yahoo Groups archive

AVR-Chat

Index last updated: 2026-04-28 22:41 UTC

Thread

Dave vanHorn's 4bit LCD lib

Dave vanHorn's 4bit LCD lib

2008-03-27 by steamphreaque

I am attempting to make use of Dave van Horn's 4 bit HD44780 LCD
control lib, but I am running into a problem

  The commands listed seem to suggest hat there is a register as well
as an "immediate" 8 bit value used to specify the command to the
display, but it is not clear which register, nor where/how the
"immediate" value is passed.

   Dave?

avrFreak

Re: Dave vanHorn's 4bit LCD lib

2008-03-27 by Don Kinzer

--- In AVR-Chat@yahoogroups.com, "steamphreaque" <tjkeller@...> wrote:
> it is not clear which register, nor where/how the
> "immediate" value is passed.
The RS signal distinguishes between instruction and data input.  
Information on programming HD44780-compatible displays is available in 
several places on the Internet.  I've found these pages useful:

http://home.iae.nl/users/pouweha/lcd/lcd.shtml
http://www.repairfaq.org/filipg/LINK/F_Tech_LCD.html
http://www.myke.com/lcd.htm

Don Kinzer
ZBasic Microcontrollers
http://www.zbasic.net

Re: [AVR-Chat] Dave vanHorn's 4bit LCD lib

2008-03-27 by David VanHorn

On Thu, Mar 27, 2008 at 12:58 PM, steamphreaque <tjkeller@inetnebr.com> wrote:
>   I am attempting to make use of Dave van Horn's 4 bit HD44780 LCD
> control lib, but I am running into a problem
>
>  The commands listed seem to suggest hat there is a register as well
> as an "immediate" 8 bit value used to specify the command to the
> display, but it is not clear which register, nor where/how the
> "immediate" value is passed.
>
>   Dave?


It's been a while, can you post a snippet to jog my memory?
Usually, if I need to pass anything to a routine, its' in TEMP, or TEMP2.

Re: Dave vanHorn's 4bit LCD lib

2008-03-28 by brewski922

This is the info that got me started with character LCD, 
specifically the HD44780 compatible LCDs.

http://www.epemag.wimborne.co.uk/resources.htm
You will find the following 2 PDFs there:
http://www.epemag.wimborne.co.uk/lcd1.pdf
http://www.epemag.wimborne.co.uk/lcd2.pdf

My opinion, its a great tutorial...
Mike


--- In AVR-Chat@yahoogroups.com, "Don Kinzer" <dkinzer@...> wrote:
>
> --- In AVR-Chat@yahoogroups.com, "steamphreaque" <tjkeller@> wrote:
> > it is not clear which register, nor where/how the
> > "immediate" value is passed.
> The RS signal distinguishes between instruction and data input.  
> Information on programming HD44780-compatible displays is 
available in 
Show quoted textHide quoted text
> several places on the Internet.  I've found these pages useful:
> 
> http://home.iae.nl/users/pouweha/lcd/lcd.shtml
> http://www.repairfaq.org/filipg/LINK/F_Tech_LCD.html
> http://www.myke.com/lcd.htm
> 
> Don Kinzer
> ZBasic Microcontrollers
> http://www.zbasic.net
>

RE: [AVR-Chat] Re: Dave vanHorn's 4bit LCD lib

2008-03-28 by Cat C

What a great tutorial indeed!
THANK YOU!

Cat
Show quoted textHide quoted text
> To: AVR-Chat@yahoogroups.com
> From: Brewskister@gmail.com
> Date: Fri, 28 Mar 2008 14:41:56 +0000
> Subject: [AVR-Chat] Re: Dave vanHorn's 4bit LCD lib
>
> This is the info that got me started with character LCD,
> specifically the HD44780 compatible LCDs.
>
> http://www.epemag.wimborne.co.uk/resources.htm
> You will find the following 2 PDFs there:
> http://www.epemag.wimborne.co.uk/lcd1.pdf
> http://www.epemag.wimborne.co.uk/lcd2.pdf
>
> My opinion, its a great tutorial...
> Mike
>

Re: [AVR-Chat] Re: Dave vanHorn's 4bit LCD lib

2008-03-28 by David VanHorn

On Fri, Mar 28, 2008 at 5:17 PM, Cat C <catalin_cluj@hotmail.com> wrote:
>
>  What a great tutorial indeed!
>  THANK YOU!

It is very good!

One of the most common failings is to forget to do the contrast
voltage, or not to respect the timings between signals.   If you think
these are fun, I did a project with a 240/180 color display, doing
30fps video to it.  http://www.everythingusb.com/rcard.html
The display had a  HUGE manual, LONG init sequence, and it was only
missing a couple of important steps...
And without those, you get NOTHING..  :-P

One of the most frustrating things I end up fighting is incomplete
documentation for peripherals.

RE: [AVR-Chat] Re: Dave vanHorn's 4bit LCD lib

2008-03-28 by Cat C

> To: AVR-Chat@yahoogroups.com
> From: microbrix@gmail.com
> Date: Fri, 28 Mar 2008 17:24:13 -0400
> Subject: Re: [AVR-Chat] Re: Dave vanHorn's 4bit LCD lib
>
...
> these are fun, I did a project with a 240/180 color display, doing
> 30fps video to it. http://www.everythingusb.com/rcard.html

You MADE THAT?
WOW!  Where's the tutorial, BOM, etc :-D

Cat

Re: [AVR-Chat] Re: Dave vanHorn's 4bit LCD lib

2008-03-28 by David VanHorn

>  You MADE THAT?
>  WOW!  Where's the tutorial, BOM, etc :-D

With the customer I did it for.
Three months from his first description of the product, to a delivered
prototype running a slideshow and video. Average of 70 hours a week,
non-stop.

RE: [AVR-Chat] Re: Dave vanHorn's 4bit LCD lib

2008-03-29 by Cat C

That is very cool, congratulations!
Show quoted textHide quoted text
> To: AVR-Chat@yahoogroups.com
> From: microbrix@gmail.com
> Date: Fri, 28 Mar 2008 19:13:48 -0400
> Subject: Re: [AVR-Chat] Re: Dave vanHorn's 4bit LCD lib
>
>> You MADE THAT?
>> WOW! Where's the tutorial, BOM, etc :-D
>
> With the customer I did it for.
> Three months from his first description of the product, to a delivered
> prototype running a slideshow and video. Average of 70 hours a week,
> non-stop.
>

Re: [AVR-Chat] Re: Dave vanHorn's 4bit LCD lib

2008-04-01 by David P Harris

Are they available?

David

Cat C wrote:
Show quoted textHide quoted text
> That is very cool, congratulations!
>
>
>
>   
>> To: AVR-Chat@yahoogroups.com
>> From: microbrix@gmail.com
>> Date: Fri, 28 Mar 2008 19:13:48 -0400
>> Subject: Re: [AVR-Chat] Re: Dave vanHorn's 4bit LCD lib
>>
>>     
>>> You MADE THAT?
>>> WOW! Where's the tutorial, BOM, etc :-D
>>>       
>> With the customer I did it for.
>> Three months from his first description of the product, to a delivered
>> prototype running a slideshow and video. Average of 70 hours a week,
>> non-stop.
>>
>>     
>
> ------------------------------------
>
> Yahoo! Groups Links
>
>
>
>
>

Re: [AVR-Chat] Re: Dave vanHorn's 4bit LCD lib

2008-04-02 by David VanHorn

On Tue, Apr 1, 2008 at 5:57 PM, David P Harris <dpharris@telus.net> wrote:
> Are they available?

I don't know.  Once I delivered the prototypes, they went off to do a
design for manufacturing.

Here's a fun question:  How did I get 30fps video out of an 8 MHz M128?  :)

Re: [AVR-Chat] Re: Dave vanHorn's 4bit LCD lib

2008-04-02 by David VanHorn

On Tue, Apr 1, 2008 at 10:26 PM, Cat C <catalin_cluj@hotmail.com> wrote:
>
>  > Here's a fun question: How did I get 30fps video out of an 8 MHz M128? :)
>
>  Answer: With some difficulty :-D


Sideways..

The data was stored in a gigabyte flash memory, predigested by a
windows program.

So on each frame, I had to read in only 16 words of data. After that,
all I had to do was to toggle an I/O pin for each word of data. On the
low transition the memory read the data onto the bus, and on the high
transition the display took the data off the bus. In the fastest
version, I used a long batch of straightline code to do bit set and
clear, rather than a loop, because the loop was slower. (had to
decrement a counter and decide whether to do it again)

There was a bunch of init code for the display and memory, and a bunch
of code to store the images, but playback was dead simple. It had to
be.  Further, each image was linked to the previous one and the next
one by part of that control data, so that the images didn't even have
to be loaded in any particular order, and four more words defined what
image you'd get sent to if you pressed any of the four buttons while
that image was on.

I used variable frame rate encoding with 16 words of each frame
dedicated to control information. A control word told me how many
milliseconds to wait before pulling up the next frame, unless you
pressed a button.

In addition to the appx 3k of code for the whole app, I could store
three color images in the M128's program space, which made it
convenient for testing.

Re: [AVR-Chat] Re: Dave vanHorn's 4bit LCD lib

2008-04-02 by David VanHorn

On Tue, Apr 1, 2008 at 11:11 PM, Cat C <catalin_cluj@hotmail.com> wrote:
>
>  VERY ingenious!
>  I don't quite get all of it, but I can say that again: Ingenious :-D

It worked.. :)

The key was storing the data in the flash "ready to go".

To display a frame (after initting the display to a black screen) just
set up the flash to read from the first word of the first frame (known
location) and set up the display to begin loading data.
The flash read pin is tied directly to the display write pin, and the
avrs I/O pin.  The 16 data bits are tied straight across from the
flash to the display, and the AVR pins that tie to those pins are set
up as inputs.

So, each time I take the one pin low, the flash outputs a word of data
and is ready to output the next one without further intervention from
me. When I take the pin high, the display writes whatever is on the
bus into it's memory, and also increments it's internal address.
Toggle that pin a bunch of times real fast, and you transfer a bunch
of 16 bit data without having to actually read it in and write it out.
  On the first 16 operations, I take the pin low, read the bytes,
stuff them into ram, and then carry on with the rest without reading.
Once I'm done with that operation, I start the frame delay timer, and
start looking for keypresses, and if I get one, I do what the control
information said to do.  If I don't get a keypress, then when the
frame delay timer expires, I go to whatever frame the control
information said to.

Note: there is no sound!  We could have done that too, but the client
didn't want sound.

Re: [AVR-Chat] Re: Dave vanHorn's 4bit LCD lib

2008-04-02 by Michael Haisley

Dave, I looked them up a while back when I was thinking about the
thing, and contacted one of the current vendors, MiCard, they will
happily sell you one.

http://www.micardinc.com/index.php?option=com_content&task=view&id=27&Itemid=55
Show quoted textHide quoted text
On Tue, Apr 1, 2008 at 11:39 PM, Cat C <catalin_cluj@hotmail.com> wrote:
>
>  Thanks Dave, you make it sound so easy that I wanna make one right now :-D
>
>
>
>
>  ------------------------------------
>
>  Yahoo! Groups Links
>
>
>
>

Re: [AVR-Chat] Re: Dave vanHorn's 4bit LCD lib

2008-04-02 by David P Harris

David VanHorn wrote:
> On Tue, Apr 1, 2008 at 10:26 PM, Cat C <catalin_cluj@hotmail.com> wrote:
>   
>>  > Here's a fun question: How did I get 30fps video out of an 8 MHz M128? :)
>>
>>  Answer: With some difficulty :-D
>>     
>
>
> Sideways..
>   
I had thought of doing that for sound. you were much braver to do video!

David

Move to quarantaine

This moves the raw source file on disk only. The archive index is not changed automatically, so you still need to run a manual refresh afterward.