Author Topic: TFT 7-inch Sample Code Questions  (Read 2230 times)

Tim_Cole

  • Jr. Member
  • **
  • Posts: 18
  • Karma: 0
    • View Profile
TFT 7-inch Sample Code Questions
« on: December 26, 2014, 12:03:35 AM »
Greetings and Happy New Year!
While working through the sample code files TFT_7_0.c and Arduinio_nhd-7_0-800480EF.ino, I've found puzzling register settings for initialization settings.

Looking at TFT_7_0.c, I notice in function TFT_7_Init
  TFT_7_Write_Command(0xb0);      //SET LCD MODE  SET TFT 18Bits MODE
  GPIO_SetBits(GPIOC, RS);
  TFT_7_Write_Data(0x08);         //SET TFT MODE & hsync+Vsync+DEN MODE

This first parameter suggests that FRC (which I assume is "Frame Rate Control") is turned on, which would make sense for 18-bit pixels (as described in in the old data sheet for an 8-bit MCU interface). But, wouldn't it be best to specify 24-bit pixels?

Next, I notice the line:

   TFT_7_Command_Write(0x3a, 0x60) // SET R G B format = 6 6 6
However, the data sheet now describes command 0x3A as reserved.

A little farther down:
  TFT_7_Write_Command(0xe2);         //SET PLL freq=113.33MHz
  GPIO_SetBits(GPIOC, RS);
  TFT_7_Write_Data(0x22);
  TFT_7_Write_Data(0x03);
  TFT_7_Write_Data(0x04);

 
Using the formula in the section describing command 0xE2 (set_pll_mn) yields fVCO = 350 MHz and fPLL = 87.5 MHz

And:
  TFT_7_Write_Command(0xe6);         //SET PCLK freq=33.26MHz
  GPIO_SetBits(GPIOC, RS);
  TFT_7_Write_Data(0x02);
  TFT_7_Write_Data(0xff);
  TFT_7_Write_Data(0xff);


Using the formula in the section describing command 0xE6 (set_lshift_freq) yields fPCLK = 0.1875 fPLL = 16.41 MHz
When I downloaded a new copy of the SSD1963 data sheet from your Application Notes section, I noticed it is now Rev 1.1, dated Jan 2010. The data sheet I'd previously downloaded was Rev 0.20, dated Dec 2008. There are a few significant differences. In particular, commands 0x0C and 0x3A have been removed, the formulas for calculating PLL frequencies have changed (as described in the section on command 0xE2), and the pixel data format table (Table 7.1) shows LSBs for R,G, and B bytes are no longer marked as don't cares. I suspect this might have something to do with the oddities I've mentioned.

Folks, I'm not trying to be a pedantic PITA here. What I'm concerned about is that I mightn't have the right data sheet for the SSD1963  -- perhaps this new data sheet doesn't describe the devices you're using. And, of course, I might not have understood the data sheet properly.

Could you folks take a quick  look at the data sheet and the sample code to see if they reflect the devices you're shipping in the NHD-7.0-800480EF series controller boards?

Regards,
Tim Cole

Michael_L

  • Administrator
  • Hero Member
  • *****
  • Posts: 356
  • Karma: 33
    • View Profile
Re: TFT 7-inch Sample Code Questions
« Reply #1 on: December 29, 2014, 04:33:53 PM »
Happy Holidays to you too!  After reading your post, I understand you have several questions regarding the example code for the TFT controller board we offer.  I would first like to say that this code is meant to serve as merely an example of working code to get you started.  It is in not necessarily the "best" or most optimized code, but it has been tested to work.  The code can be modified with your desired parameters that are best for your application.  As for some of your last comments, you are correct.  The commands 0x0C and 0x3A have been removed (which is why you see it in the example code unfortunately).  Leaving the lines in there still allows for the SSD1963 to work, but yes they "should" be removed for the more current chip.

Tim_Cole

  • Jr. Member
  • **
  • Posts: 18
  • Karma: 0
    • View Profile
Re: TFT 7-inch Sample Code Questions
« Reply #2 on: December 30, 2014, 02:12:32 PM »
Thanks for the quick reply, Micheal. It's a relief to know that I've downloaded the correct documentation --- which is all that really matters.

Once again,  you folks really come through with customer service. It's one of the best reasons for doing business with you.

Regards, Tim

 

NHD‐0420CW‐AG3 + I2C + PIC assembly code: trouble getting started

Started by RichardRBoard OLEDs

Replies: 4
Views: 3178
Last post December 17, 2015, 03:12:49 AM
by RichardR
Korean Hex GB code for OLED multi font display NHD-2.7-12864UMY3

Started by newhavenuserBoard OLEDs

Replies: 3
Views: 687
Last post November 23, 2017, 07:57:43 PM
by tolikkk
Use of Timing characteristics in the initialization code of the display

Started by ShabdaBoard TFTs

Replies: 1
Views: 2943
Last post May 20, 2014, 08:00:39 AM
by Michael_L
NHD-5.0-800480TF-ATXL linux driver code

Started by carlovalBoard TFTs

Replies: 1
Views: 2276
Last post March 27, 2015, 08:20:26 AM
by Paul_B
Initialization code for M0220SD-202SDAR1 module??

Started by Javier OrtizBoard Vacuum Fluorescent Displays

Replies: 1
Views: 2546
Last post November 17, 2015, 05:12:51 PM
by Saurabh_B