jano Posted January 16, 2018 Report Share Posted January 16, 2018 After many hours reading data in the scope and comparing the behaviour of this with the Mbed library, I get it to work! The main difference is the Mbed library after each sequence of data it puts the CS line to high level (releases the bus), that is not the case of the uGFX lib for ILI9341 (at least on the init sequence, which is what I used to compare), so I added the code at the end of the transmission function on the board file, and it works For those who can be interested in using this combination of tools for this screen/microcontroller, I will attach the relevant files. To generate the project I used CubeMX, enabling SPI1 and some pins for CS, RST, DC ( D10, D9, D8 on the right side of the nucleo board), mixed this with the project generated in Eclipse and followed the procedure on the uGFX wiki to import the library. main.c stm32f4xx_hal_msp.c stm32f4xx_it.c board_ILI9341.h Link to comment Share on other sites More sharing options...
Joel Bodenmann Posted January 16, 2018 Report Share Posted January 16, 2018 Hello @jano and welcome to the µGFX community! Thank you very much for sharing your experience with us - we appreciate it greatly and I'm sure other uses will do too in the future Link to comment Share on other sites More sharing options...
mash273 Posted January 17, 2018 Report Share Posted January 17, 2018 Hello Jano, you use Mbed OS with CubeMX and a ready Project from Eclipse? Can you post your IOC file ? Link to comment Share on other sites More sharing options...
jano Posted January 17, 2018 Author Report Share Posted January 17, 2018 (edited) Quote you use Mbed OS with CubeMX and a ready Project from Eclipse? no, a library I found in Mbed works out of the box (for a old version of Mbed OS), then I used this to compare his behaviour (measuring with the oscilloscope) with the behaviour of the project I generated with the GNU MCU Eclipse + CubeMX and followed the instructions on the wiki of uGFX to integrate it on an Eclipse project. I wanted to have this working on Eclipse because of the better debugging possibilities. I was changing the parameters in the main.c (attached on the first post) on the init section of the SPI until the numbers I read on the oscilloscope where the same as in the init sequence for the screen (frequency, polarity, etc.), for that reason these parameter can differ from the ones in the ioc file I will attach now, the valid parameters are the ones in the main.c Is important to have the right parameters in the SPI init, but even when this is correct and the numbers where the same all along the init sequence for the screen, it doesn't work until I added the order for releasing the bus at the end of each transmission. I think this should be corrected on the driver to avoid unnecessary instructions here, the driver I have of Mbed releases the bus between every data-cmd sequence. spi_1-pb6.ioc Edited January 17, 2018 by jano Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now