It is currently 20 Apr 2018 02:15

All times are UTC + 1 hour




Post new topic Reply to topic  [ 8 posts ] 
Author Message
PostPosted: 13 Mar 2018 01:04 
Offline

Joined: 28 Oct 2007 03:16
Posts: 88
Location: West Australia
I am trying to set up a new project with:

1. PIC32MX795F512L using the compiler 4.0.0 with 'built in TFT'
2. The MikroEletronika TFT Proto 7 inch display with SSD1963 screen controller and STMPE811 I2C touch controller

The 'EDIT PROJECT' with 'TFT PROTO 7' selected will not accept the STMPE811 touch setting

Any advice please?

Regards Bill Legge
In Australia


Top
 Profile  
 
PostPosted: 15 Mar 2018 04:44 
Offline

Joined: 28 Oct 2007 03:16
Posts: 88
Location: West Australia
Some progress:
1. Screen is illuminated
2. Text and graphics working
3. But only about half of the screen is displayed

Despite setting the display size to 800 X 480.
Any advice please.
Code used follows:
////////////////////////////////////////////////////////////////////////////////
// Project:         DB_Template                                               //
// File:            DB_Template_Main.c                                        //
// Function:        Drive TFT Proto 7 inch in 16 bit mode                     //
// MCU:             32MX795F512L                                              //
// Board:           WVL_Dev_Board                                             //
// Power:           3.3V for MCU and TFT                                      //
// Xtal:            Running at 80MHz                                          //
// Compiler:        mikroC PRO for PIC32 version 4.0.0                        //
// Author:          WVL                                                       //
// Date:            March 2018                                                //
////////////////////////////////////////////////////////////////////////////////

////////////////////////////////////////////////////////////////////////////////
// TFT module connections                                                     //
char TFT_DataPort       at LATE;                                              //
char TFT_DataPort_Direction at TRISE;   // TRISE is lower PMD0 to PMD7        //
sbit TFT_RST            at LATA0_bit;                                         //
sbit TFT_CS             at LATA1_bit;                                         //
sbit TFT_RS             at LATA2_bit;                                         //
sbit TFT_RD             at LATD5_bit;   // PMRD                               //
sbit TFT_WR             at LATD4_bit;   // PMWR                               //
sbit TFT_RST_Direction  at TRISA0_bit;                                        //
sbit TFT_CS_Direction   at TRISA1_bit;                                        //
sbit TFT_RS_Direction   at TRISA2_bit;                                        //
sbit TFT_RD_Direction   at TRISD5_bit;  // PMRD                               //
sbit TFT_WR_Direction   at TRISD4_bit;  // PMWR                               //
////////////////////////////////////////////////////////////////////////////////

void PMPWaitBusy() {
  while(PMMODEbits.BUSY);
}
void Set_Index(unsigned short index) {
  TFT_RS = 0;
  PMDIN = index;
  PMPWaitBusy();
}
void Write_Command( unsigned short cmd ) {
  TFT_RS = 1;
  PMDIN = cmd;
  PMPWaitBusy();
}
void Write_Data(unsigned int _data) {
  TFT_RS = 1;
  PMDIN = _data;
  PMPWaitBusy();
}

void main() {
    AD1PCFG = 0xFFFF;           // configure AN pins as digital I/O
    JTAGEN_bit = 0;             // disable JTAG
    // Init ports and pins
    TRISA = 0;                  // RST/RA0, CS/RA1, RS/RA2
    TRISB = 0;
    TRISC = 0;
    TRISD = 0;
    TRISE = 0;
    TRISF = 0;
    TRISG = 0;
    // Init PMP for 16 bit copied from Mikro site
    PMMODE = 0;
    PMAEN  = 0;
    PMCON  = 0;
    PMMODEbits.MODE = 2;        // Master 2
    PMMODEbits.WAITB = 0;       // data setup - default
    PMMODEbits.WAITM = 1;       // data read -
    PMMODEbits.WAITE = 0;       // data hold after strobe - default
    PMMODEbits.MODE16 = 1;      // 16 bit mode
    PMCONbits.CSF = 0;          // chip select function bits
    PMCONbits.PTRDEN = 1;       // read strobe port enabled
    PMCONbits.PTWREN = 1;       // write strobe port enabled
    PMCONbits.PMPEN = 1;        // enable
    // Init TFT
    TFT_Set_Active(Set_Index,Write_Command,Write_Data);
    TFT_Init_SSD1963(800,480);  // for 16 bit mode
    TFT_Set_MM_Plus();          // necessary for correct colours
    TFT_Set_DBC_SSD1963(255);   // dynamic backlight

    // Set font and screen colour
    TFT_Fill_Screen(CL_YELLOW);
    // Identify
    TFT_Write_Text("L1",0,0);
    TFT_Write_Text("L2",0,100);
    TFT_Rectangle(20, 20, 219, 107);

     while(1){
            LATE3_bit = ~LATE3_bit;
            delay_ms(100);
     }
}


Regards Bill Legge in Australia


Top
 Profile  
 
PostPosted: 15 Mar 2018 07:30 
Offline

Joined: 28 Oct 2007 03:16
Posts: 88
Location: West Australia
Photograph of partially filled screen is attached.
The text is just visible on the left of screen.


Attachments:
IMG_2585.JPG
IMG_2585.JPG [ 44.76 KiB | Viewed 169 times ]
Top
 Profile  
 
PostPosted: 15 Mar 2018 17:45 
Offline
User avatar

Joined: 05 Mar 2018 09:44
Posts: 84
Location: Belgrade
Hi,

I`m working on your problem.
In the meantime if anything comes up, do inform me.

Regards,
Petar


Top
 Profile  
 
PostPosted: 15 Mar 2018 20:21 
Offline
User avatar

Joined: 05 Mar 2018 09:44
Posts: 84
Location: Belgrade
Hi,

Can you post the pinout of the connection between board and TFT?
What development board is that?

I successfully connected PIC32 with Proto TFT on EasyPIC Fusion v7 using this examples.
so you can check it out :

https://www.youtube.com/watch?v=VZ9jTYRINtc
and
https://www.youtube.com/watch?v=SgtP4MZ9Hys

Regards,
Petar


Top
 Profile  
 
PostPosted: 16 Mar 2018 00:48 
Offline

Joined: 28 Oct 2007 03:16
Posts: 88
Location: West Australia
Thanks for looking into this difficulty.

Wiring diagram is attached:
1. The data pins are connected to the Parallel Master Data (PMD) pins of the PIC32.
2. Read is connected to PMRD - RD5
3. Write is connected to PMWR - RD4
4. The others (SRT,RS,CS,) are connected to RA0,RA1,RA2.
I have double checked and can not find an error.
Any advice would be welcome

Regards Bill Legge in Australia

Attachment:
WVL PIC32MX TFT to MCU Connections Small Format.jpg
WVL PIC32MX TFT to MCU Connections Small Format.jpg [ 182.48 KiB | Viewed 152 times ]


Top
 Profile  
 
PostPosted: 16 Mar 2018 07:36 
Offline

Joined: 28 Oct 2007 03:16
Posts: 88
Location: West Australia
Thanks for the link to U Tube. I have seen the videos.
Just to check that there was nothing odd about using PORTA for RST,CS and RS, I swapped to RB9,RB10 and RB11 - but the problem persists?
Looking into the file _Lib_TFT_Defs.c there is a function FTF_Reset_SSD1963() that contains these lines:

  TFT_Write_Command_Ptr(0x01);      //SET horizontal size=480-1 HightByte
  TFT_Write_Command_Ptr(0xdf);      //SET horizontal size=480-1 LowByte
  TFT_Write_Command_Ptr(0x01);      //SET vertical size=272-1 HightByte
  TFT_Write_Command_Ptr(0x0f);      //SET vertical size=272-1 LowByte
  TFT_Write_Command_Ptr(0x00);      //SET even/odd line RGB seq.=RGB

I tried changing this to the display size 800X480:
  TFT_Write_Command_Ptr(0x03);      //SET horizontal size=800 HightByte
  TFT_Write_Command_Ptr(0x20);      //SET horizontal size=800 LowByte
  TFT_Write_Command_Ptr(0x01);      //SET vertical size=480 HightByte
  TFT_Write_Command_Ptr(0xE0);      //SET vertical size=480 LowByte
  TFT_Write_Command_Ptr(0x00);      //SET even/odd line RGB seq.=RGB

And as the U tube video said 'add 1' to the width and height, to 801X481:
  TFT_Write_Command_Ptr(0x03);      //SET horizontal size=800+1 HightByte
  TFT_Write_Command_Ptr(0x21);      //SET horizontal size=800+1 LowByte
  TFT_Write_Command_Ptr(0x01);      //SET vertical size=480+1 HightByte
  TFT_Write_Command_Ptr(0xE1);      //SET vertical size=480+1 LowByte
  TFT_Write_Command_Ptr(0x00);      //SET even/odd line RGB seq.=RGB

Display filled up - but the vertical sync was off and the image jumping around?
I think something is wrong in this file for the 800X480 display?
Has anyone used is successfully with a PIC32?

Regards Bill Legge in Australia


Top
 Profile  
 
PostPosted: 20 Mar 2018 23:48 
Offline

Joined: 28 Oct 2007 03:16
Posts: 88
Location: West Australia
Petar,

Any progress yet on your tests?
Other things I have tried with no luck:
1. +1, -1 and = in the file _Lib_TFT_Defs.c that sets the vertical and horizontal size 800X480.
2. Copied all the settings for the SSD1963 from the MikroC Pro for ARM file in the demo software.
3. Played about with the sync and timing variables as described in the video on U Tube.

All with no luck.
It is nearly working. Depending on the settings described above:
1. Only about half of the display is working or
2. The vertical and horizontal sync is not correct and the screen image is fyling around.

Anyone got any software in C32 for this 7 inch display?


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 8 posts ] 

All times are UTC + 1 hour


Who is online

Users browsing this forum: No registered users and 1 guest


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to: