baev_al Posted December 17, 2015 Report Posted December 17, 2015 Hello.I'm just started to quest through the uGFX. Does it make sence to use it with the attached schematic? I made the lcd work sending commands vis SPI. It seems I need to form this into driver... Can you please advise me what part of the documentation should I read?Thanks
Joel Bodenmann Posted December 17, 2015 Report Posted December 17, 2015 Hello and welcome to the community!You will definitely be able to run uGFX on that hardware and it also makes sense to do so What display are you using? If the display module uses a controller that's already supported by the uGFX library then you don't have to do anything but implementing the board file. The board file contains a few functions which you have to implement so they send and receive data through SPI in your case.You can find a list of all implemented drivers here: http://ugfx.org/platformsIn case of your display controller is not yet supported you'll have to implement the driver yourself. We recommend having a look at some of the numerous existing drivers.Everything we have to offer in terms of documentation can be found here: http://wiki.ugfx.orgIf you have any questions do not hesitate to ask. We are happy to help where we can.~ Tectu
baev_al Posted December 18, 2015 Author Report Posted December 18, 2015 What display are you using? If the display module uses a controller that's already supported by the uGFX library then you don't have to do anything but implementing the board file. The board file contains a few functions which you have to implement so they send and receive data through SPI in your case.In case of your display controller is not yet supported you'll have to implement the driver yourself. We recommend having a look at some of the numerous existing drivers.Thank you for your support.I'am using a display with ST7735S driver. It seems there is no support for it yet.As an example I took SSD1289 driver.Am I right that my task is to make work the following functions (which use the functions communicating with hardware):set_cursor(GDisplay *g)set_viewport(GDisplay* g)gdisp_lld_init(GDisplay *g)Where is exactly the function sending the data to the LCD?Should I deal with dummy_read(g)?I added functions sending data and commands to board_ST7735S.h file as well as LLDSPEC void gdisp_lld_draw_pixel(GDisplay *g). Here is the part of the main() function:gfxInit();gdispGDrawLine(g, 0,0, 128, 128, 0xFF);When I step throug the last function I achieve Hard Fault when the programm tries to reach drawpixel(g) in gdisp.c.What did I do wrong?
baev_al Posted December 18, 2015 Author Report Posted December 18, 2015 The problem with Hard Fault is solved. I used gdispGxxxx function - so I needed to create an GDisplay variable - and that caused a problem. I changed the function to gdispXxxx.Now I have another problem.In gfxconfig.h I defined#define GDISP_HARDWARE_DRAWPIXEL TRUEI added the function to the .c driver file#if GDISP_HARDWARE_DRAWPIXEL LLDSPEC void gdisp_lld_draw_pixel(GDisplay *g) { LcdSendCommand(ST7735_CASET); LcdSendData(0x00); LcdSendData(g->p.x); LcdSendCommand(ST7735_RASET); LcdSendData(0x00); LcdSendData(g->p.y); LcdSendCommand(ST7735_RAMWR); LcdSendData(g->p.color); }#endifBut I never get here. Stepping through the code showed that in this part of the code (gdisp.c)static GFXINLINE void drawpixel(GDisplay *g) { // Best is hardware accelerated pixel draw #if GDISP_HARDWARE_DRAWPIXEL #if GDISP_HARDWARE_DRAWPIXEL == HARDWARE_AUTODETECT if (gvmt(g)->pixel) #endif { gdisp_lld_draw_pixel(g); return; }when I try to step into gdisp_lld_pixel(g) the program just steps over...
Joel Bodenmann Posted December 18, 2015 Report Posted December 18, 2015 It's correct to use gdispXxx() instead of gdispGxxx() as mentioned in the documentation. You only need the one that takes the display parameter if you are working with multiple displays (if you have more than one display connected to your microcontroller).First of all I would like to point you to the documentation that explains the GDISP driver interface. It contains some valuable information that might be helpful to understand what happens: http://wiki.ugfx.org/index.php?title=Di ... iver_ModelI assume that the reason that your gdisp_lld_draw_pixel() isn't getting called is because in your drivers configuration file you enabled some hardware accelerated drawing method. It's either possible that you set GDISP_HARDWARE_DRAWPIXEL to TRUE or that you enabled hardware accelerated area filling and you're trying to draw a rectangle in which case the GDISP code will use the hardware acceleration interface instead of gdisp_lld_draw_pixel().When implementing it's a good idea to disable all hardware acceleration first.An additional comment: I'd strongly recommend you to stick with the current existing naming conventions that are also used by the other drivers. You can see that the SSD1289 driver's board file functions are called write_reg() and write_data().I hope that helps. Let us know when you have any additional questions.~ Tectu
pgis Posted December 19, 2015 Report Posted December 19, 2015 I did try the ST7735 and also the similar ILI9163 with uGFX and found that the easiest way was to start from the ILI9341 driver.The only thing that needs changing was the init sequence for the display chip to get it running.There is already an working example in boards/base/Mikromedia-STM32-M4-ILI9341/board_ILI9341.h.Even though this is for the STM32F4xx I had no problems using it.
Joel Bodenmann Posted December 20, 2015 Report Posted December 20, 2015 Thanks for sharing your experience with the ST7735, pigs.Is it possible that you upload a ZIP archive of the driver that you created so we can include it into the repository?~ Tectu
hakmax Posted March 31, 2016 Report Posted March 31, 2016 Hello. Trying to connect the display and ST 7735, please tell me you got it plugged in? Sorry for my English.
Joel Bodenmann Posted July 31, 2016 Report Posted July 31, 2016 We just ordered a display module with an ST7735 display controller. We'll get that driver done. Once we receive it.
olegator Posted August 14, 2016 Report Posted August 14, 2016 Hi, I've just wrote uGFX ST7735 driver for my board. https://git.ugfx.io/olegator77/uGFX/src/master/drivers/gdisp/ST7735 It is basically working (at least with my ST7735 display). It seems, that on market number of slightly different modifications of ST7735, therefore may be necessary to adjust driver settings. RIght now this driver not support power control and reading back.
Joel Bodenmann Posted August 14, 2016 Report Posted August 14, 2016 Hello @olegator ! That's quite a coincidence, I just received the ST7735 based display module that I ordered as mentioned above. I guess there's not much fun left for me to do then Thank you very much for contributing this driver. We will have a look at it and include it in the repository eventually (you might want to pull request as soon as you think that it's ready).
olegator Posted August 14, 2016 Report Posted August 14, 2016 Right now i just copied init sequence from adafruit, and i am not very happy with image quality. Of course display is cheap, but may be it is possible to improve it (e.g. refresh rate, voltage settings, or smth else). Will deep read st7735 datasheet
Joel Bodenmann Posted August 14, 2016 Report Posted August 14, 2016 Yes, there's always a lot of optimization that can be done by tweaking some of the display controller values. Please keep us up to date about this!
olegator Posted August 14, 2016 Report Posted August 14, 2016 Actually current problem was - the flicker. When i look to the display from some angles - image is flickering. Finally found the solution - increase refresh rate in normal mode. It seems - flicker is disappeared.
Joel Bodenmann Posted August 18, 2016 Report Posted August 18, 2016 @olegator how is it looking? Do you think that your driver is ready for a pull-request?
olegator Posted August 18, 2016 Report Posted August 18, 2016 Unfortunately i've broke my board with ST7735, and right now can't continue test it. Last time, when i seen it, driver was working fine and stable and seems usefull for 99% cases. But pixel reading and power control still not implemented So, i can make right now pull request with current version. When i'll repair board, i can make additional request with pixel reading and power control.
Joel Bodenmann Posted August 19, 2016 Report Posted August 19, 2016 I am sorry to hear that you broke your display module If the driver works so far please feel free to pull request it. It can always be improved later on. Important is that the usual display features are working. There are many drivers in the repository that don't implement the full set of power modes and so on yet.
olegator Posted August 19, 2016 Report Posted August 19, 2016 I have just made pull request with ST7735 driver. Also i have made separate pull request with ILI9225 driver
Joel Bodenmann Posted August 20, 2016 Report Posted August 20, 2016 Both drivers have been added to the repository. Thank you very much for your contributions, we appreciate it a lot! Please feel free to create a new pull request adding the missing features if you ever decide to add then
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