UK
Offline
Newbie
Karma: 0
Posts: 41
|
 |
« on: July 11, 2012, 06:18:56 am » |
I've got a 40x4 display that has similar pinouts to the usual HD44780, except that it has dual ST7066U controllers (each 40x2 ?) and dual enable lines. Does anyone know if it is possible to spoof the library by setting one or other of the enable lines myself before writing to the display, thus allowing the use of all four lines ?
|
|
|
|
|
Logged
|
|
|
|
|
Leeds, UK
Offline
God Member
Karma: 35
Posts: 983
Once the magic blue smoke is released, it won't go back in!
|
 |
« Reply #1 on: July 11, 2012, 07:45:46 am » |
I've never tried this (other than it compiles), but can you not just have two instances of display, and give each the same data pins? Like this: #include <LiquidCrystal.h>
LiquidCrystal lcd[2] = {LiquidCrystal(12, 11, 5, 4, 3, 2),LiquidCrystal(12, 10, 5, 4, 3, 2)}; //Note they have a different EN pin
void setup() { // set up the LCD's number of columns and rows: lcd[0].begin(40, 2); lcd[1].begin(40, 2);
//First controller lcd[0].setCursor(0, 0); lcd[0].print("this is line 0"); lcd[0].setCursor(0, 1); lcd[0].print("this is line 1"); //second controller lcd[1].setCursor(0, 0); lcd[1].print("this is line 2"); }
void loop() { lcd[1].setCursor(0, 1); // print the number of seconds since reset: lcd[1].print(millis()/1000); }
|
|
|
|
« Last Edit: July 11, 2012, 07:52:20 am by TCWORLD »
|
Logged
|
~Tom~
|
|
|
|
Western New York, USA
Offline
Faraday Member
Karma: 17
Posts: 3465
|
 |
« Reply #2 on: July 11, 2012, 08:56:00 am » |
I've got a 40x4 display that has similar pinouts to the usual HD44780, except that it has dual ST7066U controllers (each 40x2 ?) and dual enable lines. Does anyone know if it is possible to spoof the library by setting one or other of the enable lines myself before writing to the display, thus allowing the use of all four lines ? Why don't you just use a library that is designed for this type of device? Check out http://code.google.com/p/liquidcrystal440/.Don
|
|
|
|
|
Logged
|
|
|
|
|
Western New York, USA
Offline
Faraday Member
Karma: 17
Posts: 3465
|
 |
« Reply #3 on: July 11, 2012, 08:58:39 am » |
I've never tried this (other than it compiles), but can you not just have two instances of display, and give each the same data pins? That technique works also. Check this out: http://www.arduino.cc/cgi-bin/yabb2/YaBB.pl?num=1265969050 (scroll down).Don
|
|
|
|
|
Logged
|
|
|
|
|
UK
Offline
Newbie
Karma: 0
Posts: 41
|
 |
« Reply #4 on: July 16, 2012, 11:02:44 am » |
Thanks for the guidance... I've got it running using the two instances method... same pins except for the enables. Apart from the numerous other bugs in my program, it works fine. For info, the backlight takes about 1/2 amp.
|
|
|
|
|
Logged
|
|
|
|
|
Western New York, USA
Offline
Faraday Member
Karma: 17
Posts: 3465
|
 |
« Reply #5 on: July 16, 2012, 11:45:10 am » |
For info, the backlight takes about 1/2 amp. Did you use a series current limiting resistor?Don
|
|
|
|
|
Logged
|
|
|
|
|
Leeds, UK
Offline
God Member
Karma: 35
Posts: 983
Once the magic blue smoke is released, it won't go back in!
|
 |
« Reply #6 on: July 16, 2012, 02:34:31 pm » |
They do take quite a bit of current. If they are anything like the ones I have previously used in a project, you can get away with a 4.7R resistor and can limit it to about 100mA, but anything more than that, it wont come one.
|
|
|
|
|
Logged
|
~Tom~
|
|
|
|
Western New York, USA
Offline
Faraday Member
Karma: 17
Posts: 3465
|
 |
« Reply #7 on: July 16, 2012, 05:13:12 pm » |
... you can get away with a 4.7R resistor and can limit it to about 100mA, but anything more than that, it wont come one. That looks about right.
The datasheet indicates a typical forward current of 480 mA when the forward voltage is 4.2 V which would suggest a 1.67 ohm resistor. With no resistor the maximum forward voltage rating of 4.6 V would be exceeded and the LED current would be limited only by the supply characteristics.Don
|
|
|
|
|
Logged
|
|
|
|
|
UK
Offline
Newbie
Karma: 0
Posts: 41
|
 |
« Reply #8 on: July 31, 2012, 12:41:21 pm » |
Yes, the current requirement is HUGE (on the CMOS scale) and will need its own regulation in the final build. Not enough and it doesn't light, too much and it will fry. I used a bench power supply with voltage and current limiters to check it out.
|
|
|
|
|
Logged
|
|
|
|
|
Samplefinger
Offline
God Member
Karma: 8
Posts: 819
ALWAYS ASK FOR THREE. One to use. One to lose. One to abuse.
|
 |
« Reply #9 on: August 02, 2012, 11:15:34 pm » |
I've got a 40x4 display that has similar pinouts to the usual HD44780, except that it has dual ST7066U controllers (each 40x2 ?) and dual enable lines. Does anyone know if it is possible to spoof the library by setting one or other of the enable lines myself before writing to the display, thus allowing the use of all four lines ? Why don't you just use a library that is designed for this type of device? Check out http://code.google.com/p/liquidcrystal440/.Don Oh, that is freaking sweet. I had no idea that existed and I have one of those displays too. Time to switch over to that library. Thanks!
|
|
|
|
|
Logged
|
Latest Sampling Scores: ATXMEGA64A3U-MH x3, ATXMEGA256A3U-MH x3, SST38VF6404-90-5C-EKE x3, SST38VF6402-90-5C-EKE x3, PGA870 x3, THS770006 x3
|
|
|
|
|