Struggling to port an ILI9341 driver (display) from Arduino code to STM32 HAL, can someone check my code?
- July 31, 2022
- 1 reply
- 3677 views
Hello everyone,
I'm trying to write a driver for the ILI9341 display (8 bit parallel mode, not SPI) using the ST HAL. I couldn't get the libraries I found online working, I imagine for the same reason I can't get mine to work. Obviously I have double checked my wiring.
I took an existing Arduino library, stripped a bunch of code away and verified it worked on an Arduino. Then I changed the Arduino specific calls (pinMode, digitalWrite, digitalRead and delay) and converted them into ST HAL equivalent.
The code I attached is supposed to print the display ID (I have removed the auto-generated comments). On Arduino it prints `0x9341` (which is correct), instead the ST version prints `0x1a1a1a1a`.
I'm using a Nucleo 64 STM32L053R8T6 board and STM32CubeIDE. I have attached a screenshot of the configurations of the pins, but I also configure them at runtime (see the functions ILI9341_PrepareDataPinsForWriting and ILI9341_PrepareDataPinsForReading)
I have also added a screenshot of the IDE and of the back of the display.
I understand I'm asking for a lot, it's just that I've spent a week trying to get this stuff working and it's probably something stupid.
