![]() |
Forum Index : Microcontroller and PC projects : Forget the ILI9488, The ST7796S is the new kid in town
Page 1 of 2 ![]() ![]() |
|||||
Author | Message | ||||
matherp Guru ![]() Joined: 11/12/2012 Location: United KingdomPosts: 10088 |
Have a look The moire patterns are artifacts of the camera/screen combination This panel will be fully supported in V6.00.02RC23. It can work with the existing ILI9488 driver but anything involving reading the VRAM doesn't work. OPTION LCDPANEL ST7796S,orientation, DCpin, RESETpin, CSpin [,backlightpin] [,INVERT] It runs in RGB565 both on read and write so updates only take 2/3rds of the time of the ILI9488 and reads are much faster as the data rate doesn't need to be throttled like on the ILI9488 (and the ILI9341) The screen is 4" and nice and bright and it doesn't need any sort of H/W hack like the ILI9488 to work with touch and the SDcard. Implementation was reasonably easy except for one gotcha on switching from reading the on-board VRAM to writing it (as used in BLIT and transparent text). To do this I had include a delay until the next HSYNC otherwise the write was simply ignored. The display supports the new H/W scrolling in portrait mode. Edited 2025-05-07 22:26 by matherp |
||||
ville56 Senior Member ![]() Joined: 08/06/2022 Location: AustriaPosts: 220 |
Peter, as far as I've seen therer are some variants on Aliexpress available that can be configured in 4 modes: SPI3, SPI4 wire, parallel 8 bit and 16 bit. Does it make sense/is it feasable, from your point of view, to also support the parallel modes? This would make a very powerful and flexible display for almost all purposes. Tnx for your work on MMBasic, Gerald 73 de OE1HGA, Gerald |
||||
stanleyella![]() Guru ![]() Joined: 25/06/2022 Location: United KingdomPosts: 2409 |
thanks Peter, checking prices now. using the ILI9488 (and the ILI9341) and diode resistor for reading sd card they are ok ST7796S not cheap... what is now? Edited 2025-05-08 01:47 by stanleyella |
||||
dddns Guru ![]() Joined: 20/09/2024 Location: GermanyPosts: 359 |
sounds amazing. Does it reach the ssd1963 in terms of responsiveness and scrolling e.g. in editor? Edited 2025-05-08 01:38 by dddns |
||||
matherp Guru ![]() Joined: 11/12/2012 Location: United KingdomPosts: 10088 |
Pretty much but only in portrait mode i.e 320x480. All of these smaller displays are organised that way. |
||||
Sasquatch![]() Guru ![]() Joined: 08/05/2020 Location: United StatesPosts: 376 |
I see that the ST7796 displays are available with either resistive touch or capacitive touch using the FT6336 touch controller for a few $ more. My experience has been that in general the capacitive touch screens are usually more stable without the calibration offsets and drift that the resistive screens seem to have, although I have no direct experience with the FT6336 screens. On the other hand, the resistive touch controllers are more "mature" in terms of MMBasic use. Anyone have any thoughts or experience to share before I order a few panels? Edited 2025-05-08 04:36 by Sasquatch -Carl |
||||
matherp Guru ![]() Joined: 11/12/2012 Location: United KingdomPosts: 10088 |
Resistive touch seems to me to be more accurate. i.e. you can use a fine pointer whereas capacitive you need a finger or finger equivalent which tends to be chunky |
||||
stanleyella![]() Guru ![]() Joined: 25/06/2022 Location: United KingdomPosts: 2409 |
I got the impression capacitive touch better, like phone screens but as said resistive ili works fine, thanks, I think stick with ili. tbo I like parking monitor with hdmi, vga, composite video £14 if they can make a 8" monitor why not just the screen? |
||||
dddns Guru ![]() Joined: 20/09/2024 Location: GermanyPosts: 359 |
A bit of a downside with portrait. The ssds seems to get dumped now and the IlI9488 was upgraded..IPS is coming but I think the controller chips will stay Many thanks for implementing, when I started with PicoMite this was not supported so I bought an ILI9341 but I would like to change it now to st7796 :) Edited 2025-05-09 03:25 by dddns |
||||
matherp Guru ![]() Joined: 11/12/2012 Location: United KingdomPosts: 10088 |
SSD is still my favourite and now we have the RP2350B it becomes more practical. The only trouble is that the panels tend to be expensive, looking on buydisplay.com, the cheapest one they have is the 4.3" 480x272 at USD31 with a touch chip |
||||
dddns Guru ![]() Joined: 20/09/2024 Location: GermanyPosts: 359 |
I just saw 7" for 26€, that why I've said on aliexpress. I'm not allowing cookies but they do tricks. I'm not sure but I've seen them go down now over weeks Edited 2025-05-09 03:44 by dddns |
||||
disco4now![]() Guru ![]() Joined: 18/12/2014 Location: AustraliaPosts: 983 |
Peter, I have an ST7796S and have sort of got it going on the Armmite F4. I had to set the delay to switch back to Write mode to 5ms to get it to work. i.e. //#define ST7796Schangetowrite 1600 #define ST7796Schangetowrite 5000 Also BLIT READ and BLIT WRITE need a extra read in ReadBufferSPI before they work and the colour of WRITE copy is not quite correct. On a Picomite I had to recompile with the same changes to use any read operations. As a first step can you confirm this program behaves as expected on your ST7796S display. i.e. Transparent text,BLIT, BLIT READ/WRITE I will try and read out the ID of the display to see if yours is the same. Print "st7796S Test" CLS RGB(GREEN) Box 100,100,40,40,,RGB(RED),RGB(RED) Print Hex$(Pixel(1,1)) Blit READ 1,100,100,40,40 Blit WRITE 1,150,100,40,40 Blit 100,100,200,100,40,40 Print Hex$(Pixel(121,125)) Print Hex$(Pixel(171,125)) Print Hex$(Pixel(221,125)) Text 300,150,"HELLO" Text 300,100,"HELLO",,,,RGB(RED),-1 Timer =0 Box 0,0,10,10,1,RGB(red),RGB(red) Box 10,10,10,10,1,RGB(BLUE),RGB(BLUE) Print "WRITE TIME: ",Timer Timer =0 Blit 0,0,200,200,20,20 Print "BLIT TIME: ", Timer Timer =0 'CLS Print " CLS TIME: ",Timer Latest F4 Latest H7 FotS |
||||
matherp Guru ![]() Joined: 11/12/2012 Location: United KingdomPosts: 10088 |
The program worked perfectly for me. I did tune the wait down to the absolute minimum possible so it may need to be a bit more generous to cater for all controllers/wiring. What PicoMite version are you testing? Let me know and I'll post a more "relaxed" version |
||||
disco4now![]() Guru ![]() Joined: 18/12/2014 Location: AustraliaPosts: 983 |
Standard Picomite 2040 Latest F4 Latest H7 FotS |
||||
matherp Guru ![]() Joined: 11/12/2012 Location: United KingdomPosts: 10088 |
Try this PicoMite.zip If you can work out why the delay is needed at all it would be good ![]() |
||||
dddns Guru ![]() Joined: 20/09/2024 Location: GermanyPosts: 359 |
Does the ST7796U work as well? IPS And the same for 9143V? 320x240 and 480x320 I trust these as my delivery of tinker parts took only 1 week. |
||||
disco4now![]() Guru ![]() Joined: 18/12/2014 Location: AustraliaPosts: 983 |
Hi Peter, No luck with that one. I can get it to work reliably with the following changes The delay set to 4500 and doing a wait at the end of ReadBufferSPI. #define ST7796Schangetowrite 4500 void ReadBufferSPI(int x1, int y1, int x2, int y2, unsigned char* p) { . . . . if(Option.DISPLAY_TYPE==ST7796S){ int n=(x2- x1+1) * (y2- y1+1)*3; while(N){ h=p[N-2]; l=p[N-1]; N-=2; p[n-1]=h & 0xF8; p[n-2]=((h & 0x7)<<5) | ((l & 0xE0)>>3); p[n-3]=(l & 0x1F)<<3; n-=3; } uSec(ST7796Schangetowrite); ST7796Swritestate=true; } else { This is my test program result. ![]() The first column is the source. Next column is result of BLIT READ / BLIT WRITE Next column is result of a BLIT. Next is TEXT and Transparent Text Triangle and LINE AA I think call ReadBufferSPI as well. Various subtle things occur when it not right. e.g. BLIT and BLIT READ/WRITE can give incorrect colours. It seems to be correct with the two changes above. Maybe its worth printing out the chip ID and see if its different from yours. The test code is below. Print "st7796S Test" CLS RGB(RED) Print Hex$(Pixel(1,1)),"RED F80000" Print Hex$(Pixel(171,125)) CLS RGB(GREEN) Print Hex$(Pixel(1,1)),"GREEN FC00" Print Hex$(Pixel(171,125)) CLS RGB(BLUE) Print "------------" Print Hex$(Pixel(1,1)),"BLUE F8" Print Hex$(Pixel(1,1)) Print Hex$(Pixel(1,1)) Print Hex$(Pixel(1,1)),"BLUE F8" Print Hex$(Pixel(1,1)) Print Hex$(Pixel(1,1)) Print Hex$(Pixel(1,1)),"BLUE F8" Print Hex$(Pixel(1,1)) Print Hex$(Pixel(1,1)) Print "----------------" CLS RGB(GREEN) 'CLS RGB(RED) Box 0,98,320,50,,RGB(BLUE),RGB(BLUE) Box 0,48,320,50,,RGB(yellow),RGB(yellow) Box 0,50,40,40,,RGB(RED),RGB(RED) Print Hex$(Pixel(1,1))':Pause 5 'Text 150,50," TRANSP ",,2,,RGB(RED) 'Pause 10 Blit READ 1,0,50,40,40 Blit WRITE 1,50,50 Print Hex$(Pixel(1,1)) Blit 0,50,100,50,40,40 Box 0,100,40,40,,RGB(RED),RGB(RED) 'Print Hex$(Pixel(1,1)) Print Hex$(Pixel(1,1)) Blit CLOSE 1 Blit READ 1,0,100,40,40 Blit WRITE 1,50,100 'Print Hex$(Pixel(1,1)) Print Hex$(Pixel(1,1)) Blit 0,100,100,100,40,40 'Print Hex$(Pixel(121,125)) 'Print Hex$(Pixel(171,125)) Print Hex$(Pixel(221,125)) Text 150,70," NORMAL ",,2 Text 150,50," TRANSP ",,2,,RGB(RED),-1 Text 150,120," NORMAL ",,2 Text 150,100," TRANSP ",,2,,RGB(RED),-1 Timer =0 Box 0,0,20,20,1,RGB(red),RGB(red) Box 20,20,20,20,1,RGB(BLUE),RGB(BLUE) Print "WRITE TIME: ",Timer Timer =0 Print Hex$(Pixel(1,1)) Blit 0,0,100,0,40,40 Print Hex$(Pixel(1,1)) Blit close 1 Blit Read 1,0,0,40,40 Blit Write 1,50,0 Print "BLIT TIME: ", Timer Timer =0 'CLS Print " CLS TIME: ",Timer Triangle 30,180,125,190,90,220,RGB(RED),RGB(RED) Line AA 150,180,220,230,5,RGB(BLUE) Latest F4 Latest H7 FotS |
||||
homa![]() Guru ![]() Joined: 05/11/2021 Location: GermanyPosts: 461 |
OK, my ST7796S display has arrived. Which pins are best to use with the Pico? Do you have any recommendations, Peter? OPTION LCDPANEL ST7796S,orientation, DCpin, RESETpin, CSpin [,backlightpin] [,INVERT] I don't have a pin header soldered into J4 yet, but I need to do so for SD card use, don't I? Otherwise, could you just provide me with your option list? I'll try to make sense of it. Thanks in advance. Matthias |
||||
disco4now![]() Guru ![]() Joined: 18/12/2014 Location: AustraliaPosts: 983 |
Hi Peter, I think I have stumbled on the solution for not requiring the delay. On the Armmite I have it working with #define ST7796Schangetowrite 1 i.e. 1 uSec. I have not pulled out all the code for the delay but I suspect its not need at all. P.S. All delay code removed and its still good! also removed from Picomite RC23 and recompiled. All good. ![]() The fix is to bypass D1 in series with CS on the board as covered in the post below. I added jumper J1 (for 3.3v) as well at the same time so not 100% sure which fixed it, but suspect its the D1 bypass. Extract from post..... Some ST7796 (and ILI9486) displays have a diode inline with the TFT chip select. This is a board design error as there is nothing the other side of the diode to pull the TFT chip select high. If there are other devices on the SPI bus, such as a touch controller then this diode is likely to cause problems. It would affect how long before CS wanders to the high state, so we needed a delay to ensure CS went high after the read, before it was pulled low again on a write. Link to solution ![]() Edited 2025-05-19 14:41 by disco4now Footnote added 2025-05-19 15:55 by disco4now From the datasheet 8.4.2.2 Read Sequence The read mode of the interface means that the micro controller reads register value from the driver. To achieve read function, the micro controller first has to send a command (read ID or register command) and then the following byte is transmitted in the opposite direction. After that CSX is required to go to high before a new command is send ...... Latest F4 Latest H7 FotS |
||||
phil99![]() Guru ![]() Joined: 11/02/2018 Location: AustraliaPosts: 2449 |
One arrived this afternoon. Another data point. > option list Using Peter's last .uf2 PicoMite MMBasic RP2040 Edition V6.00.02RC23 OPTION SYSTEM SPI GP18,GP19,GP16 OPTION SYSTEM I2C GP8,GP9 OPTION COLOURCODE ON OPTION CONTINUATION LINES ON OPTION CPUSPEED (KHz) 378000 OPTION DISPLAY 55, 155 OPTION LCDPANEL ST7796S, PORTRAIT,GP15,GP14,GP13,GP7 OPTION TOUCH GP12,GP11 GUI CALIBRATE 1, 154, 3980, 863, -1279 OPTION SDCARD GP17 OPTION RTC AUTO ENABLE > gui test lcdpanel > gui test touch > RUN ST7796S Test by disco4now 19-05-2025 F80000 RED F80000 F80000 1CC0 GREEN FC00 1CC0 ------------ F80000 BLUE F8 F80000 F80000 F80000 BLUE F8 F80000 F80000 F80000 BLUE F8 F80000 F80000 ---------------- F80000 1CC0 1CC0 F80000 1CC0 WRITE TIME: 0.684 1CC0 F80000 BLIT TIME: 16.948 CLS TIME: 0.104 > |
||||
Page 1 of 2 ![]() ![]() |
![]() |
![]() |
The Back Shed's forum code is written, and hosted, in Australia. | © JAQ Software 2025 |