View previous topic :: View next topic |
Author |
Message |
gpat
Joined: 18 Apr 2006 Posts: 24
|
Posted: Thu Mar 07, 2013 1:14 pm Post subject: LCD 20*4, C2004A, on i2C. E, E1, E2 signals and PCF8574 prob |
|
|
Dear all
I just bought the LCD:
http://www.ebay.com/itm/180939111604?ssPageName=STRK:MEWNX:IT&_trksid=p3984.m1439.l2649
which has the LCD C2004A +PCF8574
with
PIN ASSIGNMENT / PIN SYMBOL FUNCTION
1 Vss Power Supply (0V)
2 Vdd Power Supply (+5V)
3 Vo Contrast Adjust
4 RS Data/Instruction Register Select
5 R/W Read/Write
6 E Enable Signal
7~14 DBO~DB7 Data bus Line
15 A Power Supply for LED BL (+)
16 K Power Supply for LED BL (-)
I disconnected the PCF 8574 from the LCD board and works fine with 4pin mode.
I cant operate it with the I2C and PCF8574.
As I can see in the lcd_i2c.lib we need pins E1 and E2 (?) as seen in the
AN #118 - I2C LCD and Keboard library example ( http://www.mcselec.com/index.php?option=com_content&task=view&id=82&Itemid=57)
since
P6 of PCF8574 is connected to LCD-E2
P7 of PCF8574 is connected to LCD-E1
But the LCD has only one Enable signal.
What is your suggestion? concerning the E,E1,E2 signals
PS: Don't buy this LCD, since the pinout is different than the normally used pinout of PCF8574+LCD in Bascom, which I had to change also, but I dont know what to connect to E....
(BASCOM-AVR version : 2.0.7.3 , Latest : 2.0.7.6 ) |
|
Back to top |
|
|
kimmi
Joined: 24 Feb 2006 Posts: 1922 Location: Denmark
|
Posted: Thu Mar 07, 2013 10:00 pm Post subject: |
|
|
Hi,
Check pins on I2c board to lcd it may NOT be same setup as used in Lcd_i2c
as I see 8574 pins to lcd is NOT same layout pin by pin !!
8574 pin 12 is data7 (pin 14 lcd)
8574 pin 11 is data6 (pin 13 lcd)
ect
see i2c to lcd interface.pdf in AN #118 for pins
LCD- E1 (or E on 1 and 2 line LCD) use P7 for 2 line _________________ / Kim |
|
Back to top |
|
|
gpat
Joined: 18 Apr 2006 Posts: 24
|
Posted: Fri Mar 08, 2013 8:29 am Post subject: |
|
|
kimmi wrote: | Hi,
Check pins on I2c board to lcd it may NOT be same setup as used in Lcd_i2c
as I see 8574 pins to lcd is NOT same layout pin by pin !!
8574 pin 12 is data7 (pin 14 lcd)
8574 pin 11 is data6 (pin 13 lcd)
ect
see i2c to lcd interface.pdf in AN #118 for pins
LCD- E1 (or E on 1 and 2 line LCD) use P7 for 2 line |
Thanks kimmi for your time.
Well of course the pinout is not the same as described in Lcd_i2c. I already changed the circuit with proper pins according to the library
I didnt understand your point for the E
Lcd_i2c. describes :
8574 P6 -> E2 (on 1 or 2 line display nc)
8574 P7 -> E1
But my LCD has only E.
What am I missing?
Or if you think that is not possible to implement this LCD, tell me to quit efforts and suggest me an LCD that will work with Bascom ->I2C, if possible from Ebay
Really thanks for your time
And something else
I have already made a program >2000lines comments blanks etc.
Its hard to find something inside...
Can we brake a *.bas file to several and combine them together in the main program? (like we do in vb, classes, modules etc....)
George |
|
Back to top |
|
|
Paulvk
Joined: 28 Jul 2006 Posts: 1257 Location: SYDNEY
|
Posted: Fri Mar 08, 2013 8:54 am Post subject: |
|
|
Hello gpat
"Can we brake a *.bas file to several and combine them together in the main program?"
Yes bascom has a project mode where you can put all your sub's ect into seperate files then with an $include it brings them in have a look at my ENC28J60 webserver project in the blog section its over 10000 lines long.
Regards Paul |
|
Back to top |
|
|
kimmi
Joined: 24 Feb 2006 Posts: 1922 Location: Denmark
|
Posted: Fri Mar 08, 2013 10:07 am Post subject: |
|
|
Quote: | Lcd_i2c. describes :
8574 P6 -> E2 (on 1 or 2 line display nc)
8574 P7 -> E1
But my LCD has only E.
What am I missing?
|
you missing the NC
8574 P6 -> E2 (on a lcd with one or two line display nc) >> NC (no connect)
8574 P7 -> E1 (or to E on a lcd with one or two line LCD) you have 2 line use P7 _________________ / Kim |
|
Back to top |
|
|
gpat
Joined: 18 Apr 2006 Posts: 24
|
Posted: Fri Mar 08, 2013 4:51 pm Post subject: |
|
|
Thank you all.
I will check them out the next days
George |
|
Back to top |
|
|
vvogeley
Joined: 20 Feb 2008 Posts: 8
|
|
Back to top |
|
|
vvogeley
Joined: 20 Feb 2008 Posts: 8
|
Posted: Sat Mar 09, 2013 5:57 pm Post subject: |
|
|
Sorry, now the correct link
http://bascomforum.de/
best regards
Volker |
|
Back to top |
|
|
aphawk
Joined: 23 Jan 2010 Posts: 168 Location: Brazil
|
Posted: Tue Jul 16, 2013 3:39 pm Post subject: |
|
|
I see in the German Bascom Forum that someone make modifications in the lcd_i2c_v2.lib, creating the lcd_i2c_v3.lib, that can control the backlite if I use only 4 bits mode and R/W tied to ground. This is very interesting !
But I can't understand German, and using only the Google Translate is very difficult to get the code and the new library.
Maybe someone that is fluent in both German and English can post here this new library, with the example code ?
Thanks !
Paulo |
|
Back to top |
|
|
Mrshilov
Joined: 24 Jan 2009 Posts: 314 Location: Russia
|
Posted: Mon Jul 22, 2013 7:31 pm Post subject: |
|
|
Library, example code and Proteus design in archive. But it don't work.
I tried first version from AN#118, second from Ludwig and this with 16x2, 40x2, 20x4 LCD. In Proteus and hardware, but nothing. Init display, cursor is shown, text not shown.
I don't know what's wrong... |
|
Back to top |
|
|
MWS
Joined: 22 Aug 2009 Posts: 2262
|
Posted: Tue Jul 23, 2013 11:23 am Post subject: |
|
|
Mrshilov wrote: | Library, example code and Proteus design in archive. But it don't work. |
Hmmm, had a look, but just to make sure: do you refer to the original topic about the arduino lcd extension with the ebay link?
Well, concerning the v3-lib, the type of code the guy wrote is really not my style and comments in German in an international used lib are imho completely clueless.
While comments describing an opcode and rather not what's the purpose of the code, aren't already pretty smart. LOL
I refer therefore to the lib with my mod, which was nothing else than twisting bits, it's name in my lib-directory here is: lcd_i2c.lib
Looking through arduino-docs, especially for LiquidCrystal_I2C.h/cpp, connections for the arduino-I2C-extension are made as follows:
Pcf P0 -> D4
Pcf P1 -> D5
Pcf P2 -> D6
Pcf P3 -> D7
Pcf P4 -> En
Pcf P5 -> R/W
Pcf P6 -> Rs
Pcf P7 -> Backlight
And that doesn't match your code. |
|
Back to top |
|
|
Mrshilov
Joined: 24 Jan 2009 Posts: 314 Location: Russia
|
Posted: Tue Jul 23, 2013 3:59 pm Post subject: |
|
|
I check this in non-arduino LCDs and non-Arduino PCF8574 plate. Maybe Proteus model of PCF8574 is not fully correct, but in hardware don't work too. Chipsets of LCDs is unknown (compound drop), but while connected wia 4- or 8-bit directly to controller they works fine like HD44780 & KS0066 compatible. |
|
Back to top |
|
|
MWS
Joined: 22 Aug 2009 Posts: 2262
|
|
Back to top |
|
|
Mrshilov
Joined: 24 Jan 2009 Posts: 314 Location: Russia
|
Posted: Tue Jul 23, 2013 9:16 pm Post subject: |
|
|
External pullup, of course, connected.
I use hardware I2C-pins because I try hardware and software I2C. In both cases PCF8574 works, display is inits and cursor is shown.
I try without I2C delay and with it from 1 to 30.
Note! Without string "Display On" cursor is not shown. In all examples I don't see this string.
Mr. MWS! Code is very simple and Proteus design is in archive. Please, make it work. It will be more informative for me. |
|
Back to top |
|
|
MWS
Joined: 22 Aug 2009 Posts: 2262
|
Posted: Tue Jul 23, 2013 11:59 pm Post subject: |
|
|
Neither I do have nor use Proteus.
Don't see your code in front of me now, so I'm not sure, if you already use Init LCD, in case not, try to issue some Wait an then InitLCD, maybe the hardware needs more time to get ready.
Did you double-check the actual clock frequency of the ATM32 against the code? In case this is wrong, timing for the display is not correct. Why it would work then without expander, would be the next question then.
Basically I see nothing wrong in the lcd_i2c.lib, others have used it successfully.
About the v3-lib I can't and won't tell anything. |
|
Back to top |
|
|
|