DmKorneev Posted December 3, 2015 Posted December 3, 2015 Display 4 * 20 i2s. It will be used to display information from mpd. How to do?
zador.blood.stained Posted December 3, 2015 Posted December 3, 2015 i2s Did you mean i2c? Anyway, HD44780 has parallel 4/8 bit interface, what display do you have (with integrated i2c port expander I assume)? You need to know how HD44780 pins are mapped to port expander register bits, and power supply requirements (3.3v or 5v).
zador.blood.stained Posted December 3, 2015 Posted December 3, 2015 So, can you link to documentation page for your display or provide details (pin mapping and supply voltage)? If display requires 5v supply, then you need to make sure there are no pull-up resistors on i2c lines, and that you don't send read commands to HD44780, otherwise you can connect it to TWI1 pins on CN8 (section "Expansion ports" on wiki page https://linux-sunxi.org/Cubietruck )
DmKorneev Posted December 3, 2015 Author Posted December 3, 2015 i2s port expander - http://www.ebay.com/itm/131136966439?_trksid=p2057872.m2749.l2649&ssPageName=STRK%3AMEBIDX%3AIT lcd - http://www.ebay.com/itm/400448319287?_trksid=p2057872.m2749.l2649&ssPageName=STRK%3AMEBIDX%3AIT 5 volts from the power supply will take
zador.blood.stained Posted December 3, 2015 Posted December 3, 2015 Okay, still no chematics, but assuming it's a clone of this port expander, it has more or less "standart" pin mapping. Now comes the dangerous part. A20 GPIOs are not 5v tolerant, so connecting this port expander to cubietruck using 5v supply voltage may irreversibly damage cubie's CPU. You can try powering it from 3.3v, pcf8574 supports lower voltage, and there are HD44780 based displays designed for 3.3v, worst thing that could happen - contrast and backlight brightness will be lower than normal. Now, assuming you connected your display (VCC to 3.3v, GND to GND, SCL to TWI1 SCL and SDA to TWI1 SDA): install i2c-tools check if i2c-1 is configured ("ls /dev/i2c*" or "sudo i2cdetect -l") check if port expander is available on the bus ("sudo i2cdetect -y 1")
Holsteiner Posted December 3, 2015 Posted December 3, 2015 Hello zador.blood.stained, Actually I only know it from Raspberry and Banana Pi point of view. BPi is also an A20 board... Here you can find it: http://www.armbian.com/banana-pi/ see chapter "Connect your LCD display" Here it is powered with 5V. I have this working with 4x20 I2C LCD on my Banana Pi using WiringPi as described by armbian and lemaker... It works the same way on Raspberry Pi and Banana Pi, so it should be the same or at least similar on Cubietruck... regards SMH
zador.blood.stained Posted December 3, 2015 Posted December 3, 2015 I didn't say that it won't work, it's just not recommended. I also have HD44780 based LCD connected to RPi with pcf8574a, but I'm powering pcf with 3.3v and display with 5v - more or less "recommended" way. Better safe than sorry imho.
wsian Posted December 5, 2015 Posted December 5, 2015 If you do not use the vga port, there is a ready 5V I2C for you. Wiring your 4 wire I2C LCD using a vga connector is much more easier than connecting to the pins on board (which is tinier compare to rpi or bpi)
pancio Posted December 7, 2015 Posted December 7, 2015 Hi, I wrote (actually, I remade) a simple library in order to use I2C based HD44780. Please look into GitHub code: https://github.com/panciunio/pyCT-PCF8574 In my projects based on I2C I using 2 channels voltage converter, so be careful what you do! It's very simple, basic instruction set but easy to use and modify. It's not completely solution because at first you need working I2C layer (smbus). More information you may find on my forum: https://cubieboard.org.pl Sorry, it's only in Polish because of my English... Regards,
zador.blood.stained Posted December 7, 2015 Posted December 7, 2015 Actually I forked and modified Python library for this configuguration too : https://github.com/zador-blood-stained/RPLCD-i2c But topicstarter wanted to display info from mpd on the display, so for him the easiest solution would be compiling lcdproc (with some modifications due to different pinout) and using something like mpdlcd. Accessing smbus from python2 is easy, for python3 it needs to be compiled manually.
Recommended Posts