|
Forum Index : Microcontroller and PC projects : RGB(x,y,z) - Red and Blue swapped?
| Author | Message | ||||
| Nimue Guru Joined: 06/08/2020 Location: United KingdomPosts: 425 |
PicoMite MMBasic Version 5.07.06 OPTION SYSTEM SPI GP10,GP11,GP28 OPTION COLOURCODE ON OPTION LCDPANEL ST7735, RLANDSCAPE,GP8,GP12,GP9,GP13 Using: Waveshare 1.44 Link to Waveshare board The panel is a ST7735S -- but if I initialise with ST7735S the screen resets to random noise. Using ST7735 seems to work. The panel is 128x128. Interestingly sometimes when the board fires up, there is a x1 pixel row at the bottom showing a random selection of colours which only goes away if I OPTION RESET and setup the LCDPANEL again. The LCD panel works fine - coordinate wise. But RGB(100,0,0) draws in BLUE and RGB(0,0,100) draws in RED. RGB(0,100,0) draws in green as expected. Have I lost the plot or am I missing something? Cheers N Entropy is not what it used to be |
||||
| Nimue Guru Joined: 06/08/2020 Location: United KingdomPosts: 425 |
Update --- the following sequence is reporducabel (at least for me). Option RESET OPTION SYSTEM SPI GP10,GP11,GP28 OPTION COLOURCODE ON OPTION LCDPANEL ST7735, RLANDSCAPE,GP8,GP12,GP9,GP13 -- Works Fine Power cycle the Pico >>> Bottom row of random pixels. Then: Option RESET OPTION SYSTEM SPI GP10,GP11,GP28 OPTION COLOURCODE ON OPTION LCDPANEL ST7735, RLANDSCAPE,GP8,GP12,GP9,GP13 Still garbled bottom row. Power cycle. Option RESET OPTION SYSTEM SPI GP10,GP11,GP28 OPTION COLOURCODE ON OPTION LCDPANEL ST7735, L,GP8,GP12,GP9,GP13 No random pixels. Power cycle -- random pixels (this time at the top row). What seems to "clear" the random pixels is to toggle the settings on the orientation - then the first time is fine --- until a power cycle when the random pixels are back (either top row -- when orientation is "L" or bottom row -- when orientation is "RL") As the panel is square will investigate "P" for orientation.... Any ideas or is my panel duff....? Cheers N Entropy is not what it used to be |
||||
| Nimue Guru Joined: 06/08/2020 Location: United KingdomPosts: 425 |
Update 2 It also appears that it is 1pixel out -- pixel 1,1 draws outside the lcdpanel pixel 1,2 draw upper left (when in RL orientation). Same behaviour when orientation set to "P". Cheers N Edited 2023-02-06 03:59 by Nimue Entropy is not what it used to be |
||||
| Nimue Guru Joined: 06/08/2020 Location: United KingdomPosts: 425 |
Final update... Digging into the Wiki for the Waveshare I find this.... "ST7735S is a 132*162 pixel LCD controller, and this product is a 128*128 pixel LCD, so some processing has been done on the display: the display starts from the second pixel in the horizontal direction, so that the display can be guaranteed. At that time, the position corresponding to the RAM in the LCD is consistent with the actual position." So that explains the pixel offset and the "processing" / references to positions in RAM (on the LCD) probably explains the slight incompatibility. Moral of the story --- read the Wiki before you buy "non standard" parts ;-) Cheers N Entropy is not what it used to be |
||||
| matherp Guru Joined: 11/12/2012 Location: United KingdomPosts: 10632 |
If you want to loan me the display I can create a variant of the driver to suit.PM me if interested |
||||
| Nimue Guru Joined: 06/08/2020 Location: United KingdomPosts: 425 |
I really appreciate the offer - am conscious of adding to your commitments with something that might be niche --- I suppose semi custom panels will keep popping up and its impossible to keep them all compatible (or even desirable). My use case (as most are) is to use in class somehow -- possibly to build a "simple" data logger. Have PM'd Diolch as we say in Wales. Entropy is not what it used to be |
||||
| TrevorH Senior Member Joined: 06/04/2018 Location: United KingdomPosts: 145 |
Hi, Nimue, you do realise that there are 3 versions of the ST7735 display, RED tab, GREEN tab and BLACK tab all of which require slightly different initialisation. Just a thought!!!! Trevor |
||||
| JohnS Guru Joined: 18/11/2011 Location: United KingdomPosts: 4147 |
Sorry to be dim but where are they? All I see is the one linked to (or similar but non-1.44 ones). John Edited 2023-02-06 20:30 by JohnS |
||||
| Nimue Guru Joined: 06/08/2020 Location: United KingdomPosts: 425 |
FWIW - they are GreenTabs. N Entropy is not what it used to be |
||||
| Nimue Guru Joined: 06/08/2020 Location: United KingdomPosts: 425 |
The tabs refer to the tab colour on the screen protector when shipped -- its not shown online ;-) (Least I hope that is what it is ;-) ) N Entropy is not what it used to be |
||||
| JohnS Guru Joined: 18/11/2011 Location: United KingdomPosts: 4147 |
No wonder I didn't know & searches hadn't helped! John |
||||
| TrevorH Senior Member Joined: 06/04/2018 Location: United KingdomPosts: 145 |
I only know this as I have met this before when programming using Arduino, the Adafruit libraries for these panels have different initialisations depending on Tab colour and of course size, I don't know if MMBasic has different options for them. Peter, over to you Trevor |
||||
| The Back Shed's forum code is written, and hosted, in Australia. | © JAQ Software 2025 |