I am using a STM32F030F4P6 MCU and a LCD 2004 with PCF8574T I2C display driver. I have tried the library from this tutorial: https://controllerstech.com/interface-lcd-16x2-with-stm32-without-i2c/. I have found a datasheet for the PCF8574T device, but there are no commands specified in there. I am quite new in the field, but I already communicated with other devices over I2C and SPI and got them to work. Can somebody tell me what I am doing wrong, or at least show me where to get a datasheet with commands for the device? I am sorry in advance if this is a noob question.
Asked
Active
Viewed 624 times
0
-
"Can't communicate" doesn't describe anything problem in meaningful way. PCF8574T is the I2C chip that convert i2c serial data to 8-bit data. It is not the display. For display, you need to search "LCD 2004 datasheet". – hcheung Apr 04 '22 at 02:30
-
@hcheung thank you for the info! I thought that it is a mcu that controls the diplay. I am gonna try and make it work with the new information. As I said before, I am still a noob! – Wolfiwolf Apr 05 '22 at 09:58
1 Answers
1
- As already mentioned, PCF8574T - is an i2c expander. So you need to write a driver which manipulates data pins on PCF8574T in way described in tutorial you found.
- Check the arduino code for this type of LCD. It may save your time/ https://github.com/fdebrabander/Arduino-LiquidCrystal-I2C-library
- If you have an Arduino board, you can test your LCD according this tutorial https://create.arduino.cc/projecthub/Arnov_Sharma_makes/lcd-i2c-tutorial-664e5a Nice to know that your device still alive before debug the code.

zolokonst
- 11
- 1
-
I tried it with the arduino and it worked. I figured out that the problem was, that 3.3V for logic was not enough dispite the datasheet information which said it was. – Wolfiwolf Apr 18 '22 at 23:14
-
It is very weird. May be you have a counterfit part. If the problem is in the logic levels the device still could be bring to work via setting GPIO output mode to open drain and using external pullup resistors about 1k. This method has some disadvantages and couldn't be recomended for serial production. Just to test. Another vay to test - power an arduino only from 3.3V. The device won't work if the problem in logic levels. But if the LCD powered from 3.3V in some cases you need provide a negative voltage to the contrast pin to get it work. – zolokonst Apr 20 '22 at 06:44
-
Maybe, i bought a 3.3V to 5v logic converter, and it now works with the stm32. Thanks for the information! – Wolfiwolf Apr 21 '22 at 09:06