LCD i2c for STM32 with ArduinoIDE.
Posted: Mon Mar 23, 2020 2:24 am
Hello friends!
I've been doing some experiments, trying to compile a simple i2c communication program with an LCD display using ArduinoIDE to work on the STM32L476RG. Again, nothing is so simple ...
In the process of compiling the program, numerous errors arise.
Researching a little more, I discovered a good example of a program for STM32, but made with STM32CubeIDE: https://controllerstech.com/i2c-lcd-in-stm32/
The author kindly provided not only the program for download but also made an explanatory video.
I had to make some minor changes, such as changing the address for sending i2c commands to the LCD display model JHD204A. As I am using a Robotdyn LCD i2c serial module, I used the PCA8574A chip datasheet for information on the addressing of the commands. So, in the "i2c-lcd.c" file, I had to change the slave address to 0x70h. Worked perfectly.
After that, I tried in many different ways to change the program to work with ArduinoIDE, but without success. I tried to reproduce the logic contained in "main.c" of the program made in STM32CubeIDE but using ArduinoIDE and including all libraries, but the errors generated are countless! With each change I make to correct them, the situation seems to get worse.
I uploaded the files, in case anyone wants to check: http://tbf.me/a/CiQu9
Could someone help me with this please? How do I make this work on ArduinoIDE?
I've been doing some experiments, trying to compile a simple i2c communication program with an LCD display using ArduinoIDE to work on the STM32L476RG. Again, nothing is so simple ...
In the process of compiling the program, numerous errors arise.
Researching a little more, I discovered a good example of a program for STM32, but made with STM32CubeIDE: https://controllerstech.com/i2c-lcd-in-stm32/
The author kindly provided not only the program for download but also made an explanatory video.
I had to make some minor changes, such as changing the address for sending i2c commands to the LCD display model JHD204A. As I am using a Robotdyn LCD i2c serial module, I used the PCA8574A chip datasheet for information on the addressing of the commands. So, in the "i2c-lcd.c" file, I had to change the slave address to 0x70h. Worked perfectly.
After that, I tried in many different ways to change the program to work with ArduinoIDE, but without success. I tried to reproduce the logic contained in "main.c" of the program made in STM32CubeIDE but using ArduinoIDE and including all libraries, but the errors generated are countless! With each change I make to correct them, the situation seems to get worse.
I uploaded the files, in case anyone wants to check: http://tbf.me/a/CiQu9
Could someone help me with this please? How do I make this work on ArduinoIDE?