IPB

Welcome Guest ( Log In | Register )

> Controlling Multiple Lcd Displays
dfraser
post Jun 16 2007, 10:51 PM
Post #1


Newbrie


Group: Members
Posts: 3
Joined: 3-March 07
Member No.: 3,055



Sirs:

I have a project that needs to drive 4 16x1 lcds ( I will be using a 16f73) . I have used the lcd_driver to control a single lcd, and it works very well. If I understand these things correctly I can bus the data and control lines (except the enable line) to all the lcds. Then just toggle the enable line for the lcd I wish to talk to.

If this is correct, my question is how do I setup the "#define LCD_ARGS" for more then one enable line? I would use the same PORTC, TRISC for all the control ports but not being that strong a 'C' programmer I'm unsure how to insert a variable port bit number into the template. Or do I have to redefine the whole thing?

Also, is there any advantage / disadvantage to using 8-bit data over the 4-bit setup?

Thank-you for any help
Douglas
update Picpack 3.0 Released
Go to the top of the page
 
+Quote Post
 
Start new topic
Replies
Dave
post Jun 17 2007, 08:45 AM
Post #2


Super Maniac
*****

Group: Administrators
Posts: 1,830
Joined: 28-September 04
From: UK
Member No.: 469



dfraser,
QUOTE (dfraser @ Jun 16 2007, 11:51 PM) *
Sirs:

I have a project that needs to drive 4 16x1 lcds ( I will be using a 16f73) . I have used the lcd_driver to control a single lcd, and it works very well. If I understand these things correctly I can bus the data and control lines (except the enable line) to all the lcds. Then just toggle the enable line for the lcd I wish to talk to.

If this is correct, my question is how do I setup the "#define LCD_ARGS" for more then one enable line? I would use the same PORTC, TRISC for all the control ports but not being that strong a 'C' programmer I'm unsure how to insert a variable port bit number into the template. Or do I have to redefine the whole thing?

Take the existing code and change it so that it instead of directly setting and clearing the enable ( e = 0; and e = 1; ) to call a function. This function can then be used to set and clear the enable of the required display.
Doesn't look like too big a change.

QUOTE
Also, is there any advantage / disadvantage to using 8-bit data over the 4-bit setup?
4 bit mode needs less electrical connections, but the code to drive it is more complicated, needs more ROM and is slightly slower to execute (although because of delays in the displays, the speed aspect is not worth worrying about).

Regards
Dave
Go to the top of the page
 
+Quote Post
dfraser
post Jun 18 2007, 06:42 PM
Post #3


Newbrie


Group: Members
Posts: 3
Joined: 3-March 07
Member No.: 3,055



QUOTE (Dave @ Jun 17 2007, 01:45 AM) *
Take the existing code and change it so that it instead of directly setting and clearing the enable ( e = 0; and e = 1; ) to call a function. This function can then be used to set and clear the enable of the required display.
Doesn't look like too big a change.

4 bit mode needs less electrical connections, but the code to drive it is more complicated, needs more ROM and is slightly slower to execute (although because of delays in the displays, the speed aspect is not worth worrying about).

Regards
Dave


Dave:

Thanks for the pointer. I cloned the lcd_driver into my_lcd_driver and started by removing all the 4-bit functions. Cleared some extra rom space (a good thing). Added a function call for selecting the proper enable port. Now all I have to do is wire it all together.

Thanks
Douglas
Go to the top of the page
 
+Quote Post

Posts in this topic


Reply to this topicStart new topic
1 User(s) are reading this topic (1 Guests and 0 Anonymous Users)
0 Members:

 



Lo-Fi Version Time is now: 3rd September 2010 - 02:47 PM