A tft addin for pbp3


Results 1 to 40 of 142

Threaded View

  1. #19
    Join Date
    May 2013
    Location
    australia
    Posts
    2,714


    Did you find this post helpful? Yes | No

    Default Re: A tft addin for pbp3

    The 2.2 " ili9341 (ili9340c how do tell) arrived today , after resoldering all the dry joints on the module it works .
    I have separated things out like this main pbp pgm --- usercommand pbpmod file , an include bas file for either st7735 or ili9341 and a font bas file


    in the pbp file
    your hardware connections
    Code:
    ;----GLOBAL----HW---------   
        SSP_IF VAR PIR3.7      ; must match your spi port 
       tft_dc_bit con  32     ;5      binary weighted pin values 
        tft_cs_bit con 16   ;4 
        tft_rst_bit con 128   ;7
        tft_port var lath ;          ; the output port for control signals
    includes

    Code:
        INCLUDE "glcd_chr.pbpmod"        ;glcdc
        include "tft-ILI9431.bas"      one or the other  not both
    ;    include "tft-ST7735.bas"      one or the other  not both
    
        INCLUDE "DT_INTS-18.bas"
        INCLUDE "ReEnterPBP-18.bas"
        INCLUDE "Elapsed_INT-18.bas"
        INCLUDE "font7x8.bas"
    in the usercommand file glcd_chr
    WIDTH con 320;160 X
    HEIGHT con 240; 128 Y
    set to appropriate values

    and this bit needs to match your spi port too a definite conditional compile potential here
    Code:
         
    TFT_CMD:
    spi_cbyte :
        tft_port =  tft_port & (~ tft_dc_bit )
    TFT_DATA:    
    spi_byte :
    @       movff    INTCON , _p_int 
    @       bcf     INTCON ,7 
        tft_port =  tft_port& (~ tft_cs_bit )
        SSP_IF = 0
        SSP2BUF = CMD 
        WHILE   SSP_IF =0 ' wait for SPI interupt flag
        wend
        tft_port = tft_port |   ( tft_dc_bit|  tft_cs_bit   )
        
    @     movff  _p_int  , INTCON 
    return

    and off you go

    I would have liked to have the hw connections and the height width in the relevant hw include file but that presented too many issues for me
    Attached Files Attached Files

Similar Threads

  1. Replies: 0
    Last Post: - 25th September 2013, 19:33
  2. code examples / libraries for ILI9320 2.8" TFT LCD Module
    By longpole001 in forum mel PIC BASIC Pro
    Replies: 10
    Last Post: - 6th June 2013, 09:50
  3. I really need some help with PBP3
    By Ramius in forum mel PIC BASIC Pro
    Replies: 5
    Last Post: - 26th February 2012, 17:05
  4. What's with PBP3?
    By BrianT in forum mel PIC BASIC Pro
    Replies: 3
    Last Post: - 10th August 2011, 18:09
  5. Experience of driving TFT screens?
    By isaac in forum General
    Replies: 1
    Last Post: - 26th September 2008, 01:15

Members who have read this thread : 1

You do not have permission to view the list of names.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts