-
Notifications
You must be signed in to change notification settings - Fork 1.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Using the 12864-06D display, and how does flipmode work? (startup code and flipmode 0 code do not match) #1792
Comments
The code for flipmode is only sent to the display if the flipmode command (https://github.com/olikraus/u8g2/wiki/u8g2reference#setflipmode) is used. Ideally setFlipMode(0) should be executed automatically by the constructor. Unfortunately this isn't done (I missed this very early in the development now I am too lazy to fix this). In your case: Line 804 in d9402d5
The flip mode sequence is sent here: Lines 819 to 830 in d9402d5
And the commands are repeated in the normal startup sequence of that display: Lines 787 to 802 in d9402d5
Which is actually defined here: Lines 59 to 73 in d9402d5
But it seems, that the flip mode sequences are wrong. and the code for flip mode 0 and startup do not match. Is this the problem you observed? To fix this, I need to change Line 822 in d9402d5
to zflip1 and Line 827 in d9402d5
to zflip0 hmm looks like a bug in u8g2... |
Incidentally, the U8G2_ST7565_NHD_C12864_1_4W_SW_SPI constructor also stops the very first (current last) column of pixels being cut off. One line up from the bottom, the right most character is supposed to be a capital V . The clear border arround all the text is just how the display is made. there are no pixels there. I think the little black vertical line on the left is either left over in the buffer, or it's that cut off bit of the V that got put over there. |
Indeed you need to test which constructor fits best to your needs. So instead of just numbering the constructors from 1 to 32 i just took the first display name with a specific architecture and named it according to that display name (like NHD_C12864). So it indicates that this was once implemented for the New Haven https://www.newhavendisplay.com/nhdc12864a1zfsrgbfbwht1-p-3896.html display. But of course it might also fit to any other display with the same architecture. So my suggest is this: Please check all of the current constructors for a 128x64 display: ST7565 EA_DOGM128 Ignore the contrast, just observe whether the text is correct or not. |
wow, nice summary. The jlx is indeed identical to the nhd constructor: Lines 686 to 689 in d9402d5
The contranst should work also for your display, unless you have undefinde the macro here: Lines 167 to 173 in d9402d5
To test the contranst you could also use the set contranst example, which loops over the contrast. Another way would be to manually send the contrast value with You said you selected the correct constructor, but in your picture it seems to be shiftet by some pixel. I am confused. Is there an issue or: Which constructor / commands had been used to generate the shift in the picture? |
ok looks good
There should be no difference between SW SPI and HW SPI. So as a summary for this issue:
|
If you want to test contrast, i only have one kind of display. So for all we know there is no contrast instruction in this one and the changing contrast is just a result of something else funky. |
hmmm... I never came across a display, which does not allow contrast setup. The contrast itself is also changed by some other parameters like refresh rate. So it might indeed differ between LCDs. |
fixed flip sequence |
Discussed in #1791
Originally posted by RvanDeelen February 22, 2022
So a while ago i bought some displays of aliexpress. As one does. They were explicitly specified as being "right to left written".
It took me ages to get t the right constructor but in the end i found out that "U8G2_ST7565_NHD_C12864_1_4W_SW_SPI" will work. Because before this i used U8G2_ST7565_KS0713_1_4W_SW_SPI constructor, but altered the ADC reversal line manually in the library.
So now everything is oriented correctly (writing left to right and no mirrored letters), For my use case i did have to use rotation R2 but that's besides the point.
Something i don't understand tho is how the flipmode works in the constructor code. how can i know if the flipmode instruction actually works looking at the library?
The text was updated successfully, but these errors were encountered: