Forum - MCS Electronics

 

FAQFAQ SearchSearch RegisterRegister Log inLog in

LCD4BUSY Question

 
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.    www.mcselec.com Forum Index -> BASCOM-AVR Archive
View previous topic :: View next topic  
Author Message
Blake

Bascom Member



Joined: 31 Dec 2004
Posts: 31

blank.gif
PostPosted: Sun Jan 31, 2010 10:46 pm    Post subject: LCD4BUSY Question Reply with quote

In the sample file lcd4busy.bas it shows:

Const _lcdport = Porta
Const _lcdddr = Ddra
Const _lcdin = Pina
Const _lcd_e = 1
Const _lcd_rw = 2
Const _lcd_rs = 3

From what I can understand by reading the comments in the lcd4busy.lib file pins 4-7 of the port must be connected to db4-db7

Also it appears that E, R/W, and the RS pins from the LCD attach to pins 1,2,3 from the SAME port, is this correct?

Also, if I wanted to use Port D instead of Port A do I just change 'A' to 'D' in the Const definitions in the lcd4busy.bas sample?

Does the lcd4busy.lib file support 4 line LCD displays?

Thanx
Back to top
View user's profile
Blake

Bascom Member



Joined: 31 Dec 2004
Posts: 31

blank.gif
PostPosted: Mon Feb 01, 2010 12:52 am    Post subject: Reply with quote

I am not sure about the lcd4busy.lib routine in the LIB folder of the MCS Electronics but I downloaded the LUC_lcd4busy.lib file from another thread and it works fine on a 20*4 LCD with only one Enable line.

Its corresponding .bas file gives a good example of how different port pins can be used.

Thanks Luciano

Blake
Back to top
View user's profile
olhexy

Bascom Member



Joined: 03 Apr 2011
Posts: 192
Location: Tilburg, Netherlands

netherlands.gif
PostPosted: Fri Mar 30, 2012 12:20 pm    Post subject: Reply with quote

I also have some trouble finding my way in the lcd libraries.
The timings for initializing the display seem to be taylored for 4 Mhz 8515. When you really need to initialize the lcd wih a 20 Mhz device will this standard "lcd4busy.lib" be successfull?

There is the "lcd4busy_anypin.lib" that seems better in fullfillling this task, because it uses @genus() to adjust timings.

This library (date 28 feb 2011) is the slightly optimized version of Luciano's LUC_lcd4busy.lib.
Because the missing "LUC_" part in the name it is somewhat hard to recognize, but "lcd4busy_anypin.lib" is in my Bascom version 2.0.7.3.
Back to top
View user's profile
Luciano

Bascom Member



Joined: 29 Nov 2004
Posts: 3149
Location: Italy

blank.gif
PostPosted: Fri Mar 30, 2012 12:49 pm    Post subject: Reply with quote

Hi,

Here is the LIB: LINK
There is a version with and without timeout.
(See the first post of the thread).

* * *

The original Bascom lcd4busy_anypin.LiB is based on the code of the above link.
(Based on the version without timeout).

Best regards,

Luciano
Back to top
View user's profile
albertsm

Administrator



Joined: 09 Apr 2004
Posts: 5922
Location: Holland

blank.gif
PostPosted: Fri Mar 30, 2012 12:51 pm    Post subject: Reply with quote

there is no need to use customized lcd libraries. the default lib code will do.
And when you need the busy pin, you need to add the WR pin to the config. Look at the help for config lcdpin.

some libs are only intended as an example. but the supported ones all work with all speeds. if not, you need to send a small example.
luciano's lib was derived from the lcdbusy. And in turn i derived from Luciano's work and added the WR option.
So the default libs should/will work. if you use an example you probably need to adjust timings.
So there is no need to 'find your way' : all is built into the compiler. only when you write a driver for a new type of lcd, or want special handling you can use these libs as a starting sample.

_________________
Mark
Back to top
View user's profile Visit poster's website
dl7sep

Bascom Member



Joined: 26 Feb 2006
Posts: 81

germany.gif
PostPosted: Fri Mar 30, 2012 2:07 pm    Post subject: Reply with quote

Hello Mark,

one question about the help between CONFIG LCDPIN:

Quote:
CONFIG LCDPIN = PIN , DB4= PN,DB5=PN, DB6=PN, DB7=PN, E=PN, RS=PN [WR=PIN] [BUSY=PIN] [MODE=mode]



Need the compiler both (WR= PIN and BUSY=PIN) ore need the compiler only one of them?
Is WR for write / read funktion and BUSY for timing, ore will do both the same?

Best regards

Josef
Back to top
View user's profile
albertsm

Administrator



Joined: 09 Apr 2004
Posts: 5922
Location: Holland

blank.gif
PostPosted: Fri Mar 30, 2012 3:08 pm    Post subject: Reply with quote

The busy pin is only required for the 20x4VFD display. this is a special display and lib.

for normal lcd all you need is to add the WR pin. When the WR pin is used, there is no fixed timing, but instead the busy signal will be checked. The busy signal is on the data lines.

_________________
Mark
Back to top
View user's profile Visit poster's website
dl7sep

Bascom Member



Joined: 26 Feb 2006
Posts: 81

germany.gif
PostPosted: Fri Mar 30, 2012 4:13 pm    Post subject: Reply with quote

Thank you very much for your answer.
This make it clear for me, in the time before i always had used WR on GND.
But to get the maximum on speed for display routines there is a good thing to do this by check the busy bit.


Best regards

Josef
Back to top
View user's profile
Display posts from previous:   
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.    www.mcselec.com Forum Index -> BASCOM-AVR Archive All times are GMT + 1 Hour
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You cannot download files in this forum