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
New 1.8 Inch LCD, Works partial with Hack, but still problems. #156
Comments
BTW : Thanks a lot to the developer(s) of FBTFT. Amazing job. MPG sample play, whether someone believes it or not, is close to 20 to 25 FPS, which should be sufficient to play normal videos. So great job Tinylcd and FBTFT. This is my first Color LCD integration to any Embedded device, and I was thrilled to see it working without a lot of hard work. Even though the colors are swapped, I think, it is still a good thing to be able to get it to this stage and have a terminal running on it. |
Actually it could be this section : Working good - Arduino Code : Colors Swapped - FBTFT Driver code : |
Conversion of the Arduino code
All in one line
bgr= isn't supported with fb_tinylcd as it was made for an unknown controller on a display (the seller won't disclose this information.). Register 0x36 usually sets BGR/RGB and the direction in which the RAM is scanned out to the display. Used to control rotation. |
Cool, SO happy to get a quick response. My First Try returned in the same result with the colors swapped. There is even now another problem with the init code you provided. The Rotation does not work well. Pretty weird. I will keep trying sending different parameters and check it out today. Will you be able to tell if this display is 8Bit or 9Bit from looking at the Arduino Code ? If you want, I can post the entire arduino code that actually works well with this display. Or if you can share your email address, I can send it to you by email, Anyway, we can send private messages in GIThub ? |
You have to read the datasheet to get this right. |
Hi Notro, Thanks for the quick response. So What I am going to do is spend whatever time I can afford on this and keep this post updated with my findings. There has to be a way for this to work since it works fine on the Arduino. All code of Arduino is Open and in readable form. I do not believe if making accessories that are exclusively for Arduino or Raspberry Pi. When the protocols are same, the pins' purposes are same, leaving apart the logic voltage (3.3 and 5V) , everything else being same, it can and should be made to work on the Pi and still be as efficient if not more than the Arduino and obviously without hacks of any kind. I am from India, and we do not get the regular Adafruit and Sparkfun stuff easily, even if we import or get through someone who has imported, they are far from being affordable. So we have no other way than to depend on these chinese products unfortunately. TinyLcd products are the only ones I can vouch being the cheapest anywhere you could source online. Their Customer support is also very friendly on the Phone (at least the people who are in India). Not disclosing the controller is surely their own choice for their business interests and we cannot force them for the same. They will soon realize that Disclosing the details can only result in far better sales, but I would leave it for their management to decide on that. What you have done so far is just astounding indeed, Getting so many of these beasty and elusive various LCDs working all under one roof. That is truely commendable ! We need more people like you. Summarizing, This 1.8 Inch LCD needs to work on the FBTFT platform. It is the most affordable to get going on the Raspberry Pi with an LCD. I am going to keep finding info and look for info in forums to get this working. In the meantime, I request you not to close this issue at least for a few days so that it draws a little but of whatever attention it deserves. Regards, |
From my Findings, so far, I can say, this may not work based on the 7735 codebase. |
Hi Notro, From your first reply about asking where the comment was ending : I have an updated link that you can refer to here with the commented areas removed so that you could check if the init strings were right in your reply. http://transworldsoft.net/raspberry/lcd/initlcd_comments_removed.h I think the init string that you posted, will need to be changed again. I will keep trying and posting updates here. Thanks |
Hi Notro, Excellent Work, thanks for guiding me so far. With a little bit of fiddling around, and then changing the init code to remove the additional characters which were in comment, it worked. YAY !!!
and then run : any idea how, the fonts can be made smaller ? this is such a tiny screen, that the prompt itself takes almost all the width. Please guide how I can make those fonts smaller. Also, please do not close this thead yet. I am going to run a few tests and see how video, images etc go and what framerates I can achieve including the contrast quality. Contrast looks good now, but need to check how it looks in videos. |
HI Notro, I was wrong about the contrast in my success message above. The colors seems to be working well and red and blue are in their correct place. The overall brightness reduces, but contrast is still poor. I think I must be getting between 18 to 22 frames from what I can observe, will measure later when the contrast issue is fixed. Any ideas, how the contrast could be made better ? Any changes to the init string help it ? If so, please help in providing the suitable register part and possible Values that I could try with. |
Another Query, Is there a way to find out the sequence of init commands a driver sends in default mode ? Any special debug flag or mode that can be called from command line or checked in dmesg ? |
cat /sys/class/graphics/fb1/gamma shows : 000f 001a 000f 0018 002f 0028 0020 0022 001f 001b 0023 0037 0000 0007 0002 0010 But I do not know how to use that information in the command line and pass them to the init command. Can someone please translate above info into a suitable gamma=xxxxx parameter so that I can check with the modprobe command |
https://github.com/notro/fbtft/wiki/Debug This is the default gamma curve from the fb_st7735r:
This is the arduino gamma curve converted to something fbtft can understand:
More info: https://github.com/notro/fbtft/wiki/Gamma |
Thank you so much for such quick replies, You are a gem already for all of us. I am going to probe more, will keep doing it till I get it working without a flaw like other devices. Shall keep this post updated as I find more info. |
Closing issue since there has been no activity for more than 2 months. Reopen if needed. |
I have got a 1.8 LCD which is supposed to be ST7735S if that controller actually exists.
I downloaded the precompiled image which allows dynamic loadable modules for different displays.
With the Arduino Code that came with it, it just worked fine. I have attached a link to the COde from Arduino that works well.
This is a Tiny LCD module. The only driver that exists in FBTFT for tinylcd modules is the one which is 3.5 inch one. So I tried to use the same and Bingo, I got it working . YAY !!! used the command below to actually get it working :
sudo modprobe fbtft_device custom name=fb_tinylcd buswidth=8 speed=32000000 width=128 height=160 gpios=reset:25,dc:24,led:18 rotate=90
Above command makes the screen blank confirming the initialization working fine. Please note how I am sending width and height params to make the driver work with the smaller resolution.
and then
sudo con2fbmap 1 1
Above command Starts the terminal on the LCD. and I can do everything as usual of course with very little space.
Everything works well except the following :
I think this is a RGB vs BGR issue. I assume the 3.5 Display is BGR and this one probably expects RGB. Most likely BGR(color space) is hard coded in the driver and hence sending params in module load function do not work.
Sending either bgr=1 or bgr=0 in the module load initialization command do not put any difference.
I looked at the driver code within FBTFT tinylcd driver and also compared it to the Arduino code that shows colors properly. Here are my findings.
Arduino and working commands :
LCD_Write_COM(0x36); //MX, MY, RGB mode
LCD_Write_DATA(0xC0);
FBTFT 3.5 tinylcd driver commands :
write_reg(par, 0x36, 0x58); // There is no comment in this driver, so I assume this is the one that must be sending the RGB/BGR modes and which is hard coded I think.
I am requesting someone who is expert at internal details to generate a modprobe command using the arduino code so that I can test this LCD to be working well with proper colors. I am sure, it should be quite simple for someone who is expert at this.
Here is the link to the complete arduino code that works pretty well.
http://transworldsoft.net/raspberry/lcd/initlcd.h
Code to tinylcd 3.5 inch can be seen in code section in this repo, or you can check the link below too.
http://transworldsoft.net/raspberry/lcd/fb_tinylcd.c
I will be thankful is someone can send me the init code that I can use to send the proper init codes as per the arduino header above. Request you to please provide a complete command that I can run on the shell.
I tried to generate it myself, however, it just went above my head.
The text was updated successfully, but these errors were encountered: