A tft addin for pbp3 - Page 3


Closed Thread
Page 3 of 4 FirstFirst 1234 LastLast
Results 81 to 120 of 142
  1. #81
    Join Date
    May 2013
    Location
    australia
    Posts
    2,386


    Did you find this post helpful? Yes | No

    Default Re: A tft addin for pbp3

    did a bit more fiddling with the buttons
    we now have rounded corners and self centering title text , and self scaling title text size too.

    the flash bit now has a flasheader cmd to read image nams and x y sizes .

    this demo has the flash bits commented out

    ps the button x,y value now is the centre of the button (was bottom lh cnr) and each button can have its own size still
    Attached Files Attached Files
    Last edited by richard; - 2nd August 2015 at 10:57.

  2. #82
    Join Date
    May 2013
    Location
    australia
    Posts
    2,386


    Did you find this post helpful? Yes | No

    Default Re: A tft addin for pbp3

    fixed touch module cs pin not initialised to unselected state on boot up and had some vars being used without being cleared first (real amateur hour stuff)
    Attached Files Attached Files

  3. #83
    Join Date
    May 2013
    Location
    australia
    Posts
    2,386


    Did you find this post helpful? Yes | No

    Default Re: A tft addin for pbp3

    now with sliders, might try to get the touch module on the spi bus next (should then be able to read touch x,y ps about 16 times faster than bit banging with shiftin )
    Attached Files Attached Files

  4. #84


    Did you find this post helpful? Yes | No

    Default Re: A tft addin for pbp3

    Excellent work Richard

    Regards
    Rui

  5. #85
    Join Date
    Nov 2003
    Location
    Greece
    Posts
    3,802


    Did you find this post helpful? Yes | No

    Default Re: A tft addin for pbp3

    This is so great work Richard. I believe you will put many here in the temptation to try at least the project.

    I am very anxious too, but unfortunately our country is still under capital control and no orders can be placed on ebay etc...

    Ioannis

  6. #86
    Join Date
    May 2013
    Location
    australia
    Posts
    2,386


    Did you find this post helpful? Yes | No

    Default Re: A tft addin for pbp3

    done a bit more

    have added tft_sleep tft_wake tft_on tft_off subs, added DRAWRRECT usercmd (draw round cornered rectangle).
    change way buttons are defined . can have rectangular buttons , a button colour scheme and the button "title" text is now stored in pgm memory
    attached is a demo for a pic18f2520 using sleep/ wake on touch interrupt , backlight modulation using a pnp trany bc557 (full 10 bit)

    can supply cct if req
    Attached Files Attached Files

  7. #87
    Join Date
    Oct 2013
    Posts
    41


    Did you find this post helpful? Yes | No

    Default Re: A tft addin for pbp3

    Hello people
    if someone tried Richard's example with PIC18F2520 or PIC18f4520
    I tried his example with PIC18F4520 and unfortunately not working. I have just a white screen.
    If someone can send me a hex file or an example of code that works with the PIC18F4520 so that I know if my screen working properly or it is damaged.

    my connection from TFT to PIC
    tft_dc_bit con 8 ;ie bit 3 PORT B.3
    tft_cs_bit con 32 ;ie bit 5 PORTB.5
    tft_rst_bit con 16 ;ie bit 4 PORTB.4
    tft mosi PORTC.5
    tft sck PORTC.3



    when I change value of this variable the led intensity is change on port C.2 , so PIC is working
    cont=50 ;half brightness

  8. #88
    Join Date
    Oct 2013
    Posts
    41


    Did you find this post helpful? Yes | No

    Default Re: A tft addin for pbp3

    Is it possible that I destroy my TFT-display because my power supply for PIC18f4520 is 5volt?Communication between PIC and ILI9341 is on 5 volt.

  9. #89
    Join Date
    May 2013
    Location
    australia
    Posts
    2,386


    Did you find this post helpful? Yes | No

    Default Re: A tft addin for pbp3

    these displays are 3.3v devices . the only pin that is different is the vcc pin that leads to a 3.3v ldo regulator . my displays function ok with vcc =3.3v . one has a jumper to bypass the regulator if desired but this has not been necessary .
    see schematic
    ps the schematic shows the mclr pullup resistor connected to gnd , this is wrong it should be vcc
    Attached Images Attached Images
    Last edited by richard; - 30th August 2015 at 23:25.

  10. #90
    Join Date
    Oct 2013
    Posts
    41


    Did you find this post helpful? Yes | No

    Default Re: A tft addin for pbp3

    OK,it works now.I replace a voltage regulator on EASYPIC 5 board from 5V to 3.3V and it works.
    What I need to do to send JPG picture to TFT display?

  11. #91
    Join Date
    May 2013
    Location
    australia
    Posts
    2,386


    Did you find this post helpful? Yes | No

    Default Re: A tft addin for pbp3

    What I need to do to send JPG picture to TFT display?
    start about post#41 I have provided some python code to convert arduino c code files generated by the "UTFT ImageConverter565.exe PGM " TO a pbp compatible format.
    be aware that a 200x200 pixel image takes 80,000 bytes of flash memory. an external flash chip is more practical for this sort of thing , I have provided code to do that also

  12. #92
    Join Date
    May 2013
    Location
    australia
    Posts
    2,386


    Did you find this post helpful? Yes | No

    Default Re: A tft addin for pbp3

    some more ways to define and animate buttons
    Attached Files Attached Files

  13. #93
    Join Date
    Oct 2013
    Posts
    41


    Did you find this post helpful? Yes | No

    Default Re: A tft addin for pbp3

    Because I'm not a good programmer there is a few things that are not clear to me.

    Where I can download the Arduino utft ImageConverter 565.exe.I found only a online converter on Rinky-Dink Electronics web page.

    What is the purpose of this file "flash.py.TXT" and where I must copied this file.

    When I get a image file from ImageConverter565 how I can send this file to external Flash memory w25q32.

  14. #94
    Join Date
    May 2013
    Location
    australia
    Posts
    2,386


    Did you find this post helpful? Yes | No

    Default Re: A tft addin for pbp3

    where can I get ImageConverter565
    to find the image converter just google arduino utft library

    I got mine from here
    http://www.rinkydinkelectronics.com/library.php?id=51
    download the utft.zip ,its in the utft/tools folder

    What is the purpose of this file "flash.py.TXT" and where I must copied this file.
    flash.py.TXT needs to be renamed to flash.py
    its a python 2.7 script . you will need to install python 2.7 on to your pc

    to be able to run it

    Code:
    #flash.py extract
    import os
    import time
    from Tkinter import *
    import serial
    import glob
    ser=serial.Serial("com27",38400)
    ser.flush()
    ser.timeout=.005
    there are some python apps that mat need to be installed too see above (os,time,Tkinter,serial,glob) most come preinstalled
    the code also wants a serial port (or it will crash and burn) mine uses com27 you can edit file to suit your setup , whatever port you supply needs to exist and be available for python to use


    this code can either make a pbp.bas include image file or transfer the image directly to external Flash memory via the serial port when used with my flash add in

  15. #95
    Join Date
    Oct 2013
    Posts
    41


    Did you find this post helpful? Yes | No

    Default Re: A tft addin for pbp3

    I download python 2.7.10 version for windows and when I run it I get some errors.
    When I open script FLASH.py and pres F5 button run module I got this message:




    Python 2.7.10 (default, May 23 2015, 09:40:32) [MSC v.1500 32 bit (Intel)] on win32
    Type "copyright", "credits" or "license()" for more information.
    >>> ================================ RESTART ================================
    >>>

    Traceback (most recent call last):
    File "C:\Python27\flash.py.TXT", line 6, in <module>
    import serial
    ImportError: No module named serial
    >>>

  16. #96
    Join Date
    May 2013
    Location
    australia
    Posts
    2,386


    Did you find this post helpful? Yes | No

    Default Re: A tft addin for pbp3

    ImportError: No module named serial

    as I said you need to install some python extensions too


    the serial module is pyserial
    http://www.lfd.uci.edu/~gohlke/pythonlibs/

  17. #97
    Join Date
    May 2013
    Location
    australia
    Posts
    2,386


    Did you find this post helpful? Yes | No

    Default Re: A tft addin for pbp3

    back in post #54 I uploaded another python script 565-pbp.py that code is a bit simpler , it just converts the data . also if you intend to use an external flash chip with my flash code then your pic18 needs to have two mssp ports . I found buffering image data between flash and tft with them on the same port was just too tedious and slow and gave up on the process , its doable but complicated .

  18. #98
    Join Date
    Oct 2013
    Posts
    41


    Did you find this post helpful? Yes | No

    Default Re: A tft addin for pbp3

    I managed to run a python script FLASH.py and ImageConvertor565
    .
    in the FLASH .py scripts can I put COM.1 as default port to communicate with PIC chip?


    On which the port and pin I connects serial communication between PC and PIC

    PIC RX-pin is ?
    PIC TX-pin is ?

    What is the maximum number of buttons possible to make the TFT screen.

    I tried to make a four keys and the fourth button is not working. The first three are working.

    here's the code for PIC18F4520 that I use:


    Code:
    '****************************************************************
    '*  Name    : pic18f2520_tft_demo.pbp                           *
    '*  Author  : [select VIEW...EDITOR OPTIONS]                    *
    '*  Notice  : Copyright (c) 2015 [select VIEW...EDITOR OPTIONS] *
    '*          : All Rights Reserved                               *
    '*  Date    : 8/28/2015                                         *
    '*  Version : 1.0                                               *
    '*  Notes   : sleep, pwm brightness (10 bit pwm)                *
    '*          :                                                   *
    '****************************************************************
     #CONFIG
      CONFIG  OSC = INTIO67
      CONFIG  FCMEN = OFF
      CONFIG  IESO = OFF
      CONFIG  PWRT = OFF
      CONFIG  BOREN = SBORDIS
      CONFIG  BORV = 3
      CONFIG  WDT = OFF
      CONFIG  WDTPS = 512
      CONFIG  CCP2MX = PORTC
      CONFIG  PBADEN = OFF
      CONFIG  LPT1OSC = OFF
      CONFIG  MCLRE = ON
      CONFIG  STVREN = ON
      CONFIG  LVP = OFF
      CONFIG  XINST = OFF
      CONFIG  DEBUG = OFF
      CONFIG  CP0 = OFF
      CONFIG  CP1 = OFF
      CONFIG  CP2 = OFF
      CONFIG  CP3 = OFF
      CONFIG  CPB = OFF
      CONFIG  CPD = OFF
      CONFIG  WRT0 = OFF
      CONFIG  WRT1 = OFF
      CONFIG  WRT2 = OFF
      CONFIG  WRT3 = OFF
      CONFIG  WRTC = OFF
      CONFIG  WRTB = OFF
      CONFIG  WRTD = OFF
      CONFIG  EBTR0 = OFF
      CONFIG  EBTR1 = OFF
      CONFIG  EBTR2 = OFF
      CONFIG  EBTR3 = OFF
      CONFIG  EBTRB = OFF
    #ENDCONFIG
     DEFINE NO_CLRWDT 1
     #DEFINE TOUCH_SCREEN 1
    '#DEFine  dbug 1 
     ;-----------connection---------- 
    ;        pic                     tft
    ; <tft_port.tft_dc_bit >-------< dc   >  
    ; <tft_port.tft_cs_bit >-------< cs   >
    ; <tft_port.tft_rst_bit>-------< rst  >
    ; <msspx.sdo >-----------------< mosi >
    ; <msspx.sck >-----------------< sck  >
    ; <back_light>-----------------< led  >   via pnp cct
    
    
    
        tft_dc_bit  con  8     ;ie bit 3
        tft_cs_bit  con  32    ;ie bit 5
        tft_rst_bit con  16    ;ie bit 4
        tft_port var latb 
        back_light var latc.2   ;portc.2
        cont var word     ;  backlight level
        WIDTH   con  320 ; 160   X     MUST MATCH TFT MODULE
        HEIGHT   con 240  ; 128   Y     
       
    ' my TOUCH_SCREEN connection definitions    
     T_CLK    VAR   PORTa.7
     T_INPin  VAR   PORTa.4
     T_OUTPin VAR   PORTa.6
     T_INT    VAR   PORTb.0
     T_CS     VAR   LATb.2
     
     number_of_buttons con 4
     number_of_sliders con 1    
     
         
            INCLUDE "TFT_SPI.pbpmod"        ;glcdc
            include "tft-ILI9431.bas" 
            'INCLUDE "flash_spi.pbpmod"
    
            include "TOUCH_TFT.PBPMOD"      ;uncomment  to use TOUCH_TFT
            INCLUDE "font7x8.bas"
        latb=255   ;  make sure tft etc are not selected ie all cs high
        TRISA=111111
        TRISB=000011    
        TRISC=010011
        TRISD=000000
        PORTD=0000000
    
        OSCCON = 110000         'Internal 8 Mhz Osc 
        OSCTUNE=000000        'PLL ON
        cont=500               ;half brightness
        DEFINE OSC 32
        buff var byte[32]
        t2con=5
        PR2 = 255; 
        CCPR1L = cont>>2;             ;set pwm
        ccp1con=12|((cont&3)<<4);
        SSPCON1=$20  ;$20-21-22 works 20 IS FASTEST
        SSPSTAT=$40
        TEXTSIZE=4
        gosub tft_init
        gosub TOUCH_INIT
        
          #ifdef dbug
        trisb.7=0    ;DEBUG OUT
        latb.7=1
        pause 4000 
        Serout2 PORTb.7,84,["ready ", 13,10]
        #ENDIF
     
        
        glcdc  font7x8       ;SET FONT
        bg=$ffff
        fg=0
        fillrect 0,0,WIDTH,height    ;cls
    
        MAKEBUTTON  30,180,0,50,   "CLEAR"     
        MAKEBUTTON  90,180,1,50,   "SLP"
        MAKEBUTTON  150,180,2,50,  "LED"
        MAKEBUTTON  210,180,3,50,  "VISNJA"
        MAKESLIDER  100,80,0
        slider_index  =0
        the_slider = slider_index *SL_SZ  ; set slider indexing properly
        slider_FG[the_slider ]=$ffe0    ;set slider bar colour if default not desired
        slider_count[the_slider]=cont/10   
        bg=0
        INTCON2.6=0 
    main:
        fg=$7FF    
        DRAWBUTTON  0
        DRAWBUTTON  1
        DRAWBUTTON  2
        DRAWBUTTON  3
        slider_index  =0
        the_slider = slider_index *SL_SZ
        slider_MODE[the_slider]=0    ;FORCE DRAW OF SLIDER
        DRAWSLIDER  0
    LOP:
        GOSUB  CK_BUTTON
        IF      BUTTON_STATE[0]=1   THEN
            BUTTON_STATE[0]=0  
            fg=0
            fillrect 0,0,WIDTH,height    ;cls  
            goto main
          
    ELSEIF   BUTTON_STATE[2]=1   THEN
              TOGGLE PORTD.0
              BUTTON_STATE[2]=0 
             
      ELSEIF   BUTTON_STATE[3]=1   THEN
              TOGGLE PORTD.1
              BUTTON_STATE[3]=0          
            
            
    elseIF      BUTTON_STATE[1]    THEN
               if BUTTON_STATE[1]==2 then     ; shut it all down
                gosub tft_sleep
                 ccp1con=0
                 back_light=1 
                 pause 100
                 intcon=$10
                 @ sleep
                 @ nop
                 intcon=0
                 gosub tft_wake
                 CCPR1L = cont>>2;
                 ccp1con=12|((cont&3)<<4);
                endif 
              BUTTON_STATE[1]=0   
        endif 
    
        
        
        slider_index  =0
        the_slider = slider_index *SL_SZ
        IF   slider_MODE[the_slider]&1 THEN         ; adjust brightness 
            cont = 1000 - slider_COUNT[0]*10
            CCPR1L = cont>>2;
            ccp1con=12|((cont&3)<<4);
            slider_MODE[the_slider]=slider_MODE[the_slider]&$FE
            TEXTSIZE=2 
            fg=$7FF 
            ARRAYWRITE buff,[dec3 slider_COUNT[the_slider],0]
            GLCDSTR 50,10 ,buff 
        ENDIF
        
               
     goto LOP

    VISNJA button not working.When I touch them nothing is happend.

  19. #99
    Join Date
    Oct 2013
    Posts
    41


    Did you find this post helpful? Yes | No

    Default Re: A tft addin for pbp3

    I have several questions about the code pic18f2520_tft_demo.pbp.

    how I can change color of screen wallpaper from black to yellow

    how I can changes color of buttons from red to green and how to change color of outline on buttons

  20. #100
    Join Date
    May 2013
    Location
    australia
    Posts
    2,386


    Did you find this post helpful? Yes | No

    Default Re: A tft addin for pbp3

    On which the port and pin I connects serial communication between PC and PIC
    I have used rx2/tx2 (the code could be altered to use tx1/rx1)

    What is the maximum number of buttons possible to make the TFT screen.
    this is the limiting factor
    button_flg VAR BYTE ;1 BIT PER BUTTON make it a word to have up to 16 buttons




    I tried to make a four keys and the fourth button is not working. The first three are working.
    button state is not defined when buttons are created easiest solution is to insert a clear command



    Code:
            INCLUDE "TFT_SPI.pbpmod"        ;glcdc
            include "tft-ILI9431.bas" 
            'INCLUDE "flash_spi.pbpmod"
    
            include "TOUCH_TFT.PBPMOD"      ;uncomment  to use TOUCH_TFT
            INCLUDE "font7x8.bas"
        latb=255   ;  make sure tft etc are not selected ie all cs high
        TRISA=111111
        TRISB=000011    
        TRISC=010011
        TRISD=000000
        PORTD=0000000
    
        OSCCON = 110000         'Internal 8 Mhz Osc 
        OSCTUNE=000000        'PLL ON
    
       clear
    
        cont=500               ;half brightness
        DEFINE OSC 32
        buff var byte[32]
        t2con=5
        PR2 = 255; 
        CCPR1L = cont>>2;             ;set pwm
        ccp1con=12|((cont&3)<<4);
        SSPCON1=$20  ;$20-21-22 works 20 IS FASTEST
    how I can change color of screen wallpaper from black to yellow
    the screen colour has two properties fg (foreground) bg (background)
    set them as you like

    use fg=bg and fillrect to clear an area

    how I can changes color of buttons from red to green and how to change color of outline on buttons
    button_scheme var word[4] ; [background,text,border,animated (background or border) ]

    defaults
    button_scheme[0]= $1f
    button_scheme[1]= $0
    button_scheme[2]= $7ff
    button_scheme[3]= $ffff

    buttons can have different animations too
    button_action.0[1]=1 ;flash text for this button1
    button_action.0[2]=0 ;flash outline for this button2 ; default action

  21. #101
    Join Date
    Oct 2013
    Posts
    41


    Did you find this post helpful? Yes | No

    Default Re: A tft addin for pbp3

    Why I can not write lovercase letters only capital letters work?When I write lovercase letter I got only a bad piksel on screen.
    Buttons now work excellent.

  22. #102
    Join Date
    May 2013
    Location
    australia
    Posts
    2,386


    Did you find this post helpful? Yes | No

    Default Re: A tft addin for pbp3

    are you using the font that has lowercase chars in it ?

    the first font has chr 32 to 90 post#54
    the second has chr 32 to 127 post#67

  23. #103
    Join Date
    Oct 2013
    Posts
    41


    Did you find this post helpful? Yes | No

    Default Re: A tft addin for pbp3

    Yes,wrong include I use,now it is work.

    I create a counter,and when I touch the button counter increase e his value for 1.Each press increase counter for 1.

    COUNTER=COUNTER+1
    Is it possible to make that when i press a button and hold pressed the counter increase his value throughout the whole period when it pressed

  24. #104
    Join Date
    May 2013
    Location
    australia
    Posts
    2,386


    Did you find this post helpful? Yes | No

    Default Re: A tft addin for pbp3

    Is it possible to make that when i press a button and hold pressed the counter increase his value throughout the whole period when it pressed
    yes good idea , I have added an auto repeat property to buttons

    Code:
      button_rpt.0[3]=1             ;button3 auto rpt
    Attached Files Attached Files

  25. #105
    Join Date
    Jan 2011
    Location
    Sydney, Australia
    Posts
    166


    Did you find this post helpful? Yes | No

    Default Re: A tft addin for pbp3

    Hi Richard,

    I am having some issues compiling your TFT_Demo program and hope you can steer me in the right direction.
    I am using Microcode Studio 5.0.0 5 and PBPX 3.0.7.4

    When I first compile I get a "Syntax Error (195)". The line of code is "fillcircle 60 , 60 , 20"
    I have looked through the include files and cannot find a USERCOMMAND for "fillcircle". What am I missing?

    Attempting to move on, I commented out the offending fillcircle line of code and tried to compile again.
    Now I get four ASM ERROR message "Address label duplication or different in second pass".
    (Z001D9) (Z001DA) (Z001DB) (Z001DC)

    I am very keen to get my new TFT Touchscreen operational so any advice on how to correct the above issues would be greatly appreciated.

    I have attached all relevant files (main program, includes etc.) for your reference.

    Cheers
    Barry
    VK2XBP
    Attached Files Attached Files

  26. #106
    Join Date
    May 2013
    Location
    australia
    Posts
    2,386


    Did you find this post helpful? Yes | No

    Default Re: A tft addin for pbp3

    hi barry


    the address dup messages come from having coff file generation turned on when using dt_ints , don't know why ,wish it wouldn't
    see the attached screen shot to remedy that

    the syntax error i think comes from not using the latest tft-spi.pbpmod file

    I have uploaded the latest just incase I stuffed up
    Attached Images Attached Images  
    Attached Files Attached Files

  27. #107
    Join Date
    May 2013
    Location
    australia
    Posts
    2,386


    Did you find this post helpful? Yes | No

    Default Re: A tft addin for pbp3

    I did stuff up , seems I forgot to upload the latest version with fillcircle command in it .
    apologies to all,

  28. #108
    Join Date
    Jan 2011
    Location
    Sydney, Australia
    Posts
    166


    Did you find this post helpful? Yes | No

    Default Re: A tft addin for pbp3

    Thanks Richard - that did the trick!
    Everything compiles and programs.
    Now to breadboard it and make it work

    Cheers
    Barry
    VK2XBP

  29. #109
    Join Date
    Jan 2011
    Location
    Sydney, Australia
    Posts
    166


    Did you find this post helpful? Yes | No

    Default Re: A tft addin for pbp3

    Hi Richard,

    I have had a small amount of success getting this thing going but still having a few problems.
    Firstly, your .pdf circuit diagram appears to have another mistake (apart from the MCLR issue)
    You show the LED connection on J2 as being Pin 9 however I believe it should be Pin 8 - or at least that's what is printed on the PCB silkscreen.
    I made the necessary adjustments but still nothing. I am getting a nice 50% duty cycle PWM signal (~7.8kHz) on CCP1.
    In frustration I connected the LED connection (J2 Pin 8) to the wiper of a 10k pot and adjusted it between 0V and 3.3V.
    Once I got to around 3V the screen came to life - or at least half of it did
    I think I might have a dodgy TFT screen.
    I can see the elapsed timer counting and some of the reset button but most of the right side of the screen is scrambled with a big black ovoid shape in the middle.

    Looks like I need to do another eBay purchase but don't really want to have to wait 3-4 weeks for it to arrive!

    Thanks for all your help thus far. I will be in touch again once I have a new screen to play with.

    Cheers
    Barry
    VK2XBP

  30. #110
    Join Date
    May 2013
    Location
    australia
    Posts
    2,386


    Did you find this post helpful? Yes | No

    Default Re: A tft addin for pbp3

    your right about the schematic I have uploaded a correct version , I have replaced the transistor with a pch mosfet (saves two resistors) but it still loses a little brightness and is no better than the transistor version

    most of the right side of the screen is scrambled with a big black ovoid shape in the middle.
    I had similar issues with mine , turns out the sil connector was very poorly soldered a bit of rework fixed it
    Attached Images Attached Images
    Last edited by richard; - 9th September 2015 at 22:25.

  31. #111
    Join Date
    Dec 2007
    Location
    Finland
    Posts
    191


    Did you find this post helpful? Yes | No

    Default Re: A tft addin for pbp3

    Quote Originally Posted by richard View Post
    your right about the schematic I have uploaded a correct version , I have replaced the transistor with a pch mosfet (saves two resistors) but it still loses a little brightness and is no better than the transistor version
    Thanks for the schematic update. Now I have to start gathering all needed components.
    Why you have selected BS250, which has quite huge Rds(on), it is round 10 Ohm or more @3.3V. Why not go with a good PFET like IRLML9301TRPbF, which has ~100-200mOhm Rds(on) @3.3V. Also price is half of the BS250. With this FET you will not burn energy in transistor -> LED will be brighter.

  32. #112
    Join Date
    Oct 2013
    Posts
    41


    Did you find this post helpful? Yes | No

    Default Re: A tft addin for pbp3

    I tried to test the repetitively button, it works but not as expected.

    When I touch the button the counter starts counting, and its value increases every 300ms for one and then suddenly accelerate and in few mS in increase his value very quikly and then slow down.

    If it happens to someone else or just me?

  33. #113
    Join Date
    May 2013
    Location
    australia
    Posts
    2,386


    Did you find this post helpful? Yes | No

    Default Re: A tft addin for pbp3

    Why you have selected BS250
    because it comes in a t092 package I can use in a breadboard for testing , yes a IRLML9301TRPbF would probably be better but they only come in a sot23 package.

    visnja30 repetitively button, it works but not as expected
    I would need to see your code to be sure ,button auto repeat works for me just fine . auto repeat won't begin until long_press_threshold has been reached and will repeat @ repeat_press_rate

    these constants in the TOUCH_TFT.PBPMOD file control button timing . they may need adjusting depending on OSC and "gosub CK_BUTTON " loop rate

    repeat_press_rate con 100 ;button auto repeat rate (must be less than long_press_threshold)
    long_press_threshold con 300 ; min time for a BUTTON long press result
    short_press_threshold con 20 ; min time for a BUTTON pressed result

  34. #114
    Join Date
    May 2013
    Location
    australia
    Posts
    2,386


    Did you find this post helpful? Yes | No

    Default Re: A tft addin for pbp3

    I put a bug in the CK_BUTTON: subroutine in the TOUCH_TFT.PBPMOD file , it stops a long_press being detected


    should be this
    IF button_count[the_button] >= long_press_threshold THEN
    instead of
    IF button_count[the_button] > long_press_threshold THEN
    I will post a amended version when I finish getting the >64k code location problem solved for strings

  35. #115
    Join Date
    May 2013
    Location
    australia
    Posts
    2,386


    Did you find this post helpful? Yes | No

    Default Re: A tft addin for pbp3

    some updates

    CK_BUTTON: subroutine in the TOUCH_TFT.PBPMOD file fixed
    const txt strings can now be anywhere in addressable pgm memory
    button txt strings can now be anywhere in addressable pgm memory


    pin definitions for tft dc/cs/rst have been simplified
    eg. for tft cs on bit 5 instead of tft_cs_bit con 32 is now

    Code:
    tft_cs_bit  con 5
    Attached Files Attached Files

  36. #116
    Join Date
    May 2013
    Location
    australia
    Posts
    2,386


    Did you find this post helpful? Yes | No

    Default Re: A tft addin for pbp3

    some changes to the touch add in
    now ready for 16 buttons ,makebutton is optimised a bit better, bank 0 dependency relaxed
    Attached Files Attached Files

  37. #117
    Join Date
    May 2013
    Location
    australia
    Posts
    2,386


    Did you find this post helpful? Yes | No

    Default Re: A tft addin for pbp3

    finally worked out why fillcircle was so slooooow
    a much faster solution
    Attached Files Attached Files

  38. #118
    Join Date
    Oct 2013
    Posts
    41


    Did you find this post helpful? Yes | No

    Default Re: A tft addin for pbp3

    I include file flash_spi.pbpmod there is two labels with the same name FL_IMG: is it OK or one labels is too much?

  39. #119
    Join Date
    May 2013
    Location
    australia
    Posts
    2,386


    Did you find this post helpful? Yes | No

    Default Re: A tft addin for pbp3

    its ok the same label is use twice but it is conditional,only one is selected depending on the display type when the code is compiled
    #ifdef st7735
    FL_IMG:

    or
    #ifdef ILI9431
    FL_IMG:

  40. #120
    Join Date
    May 2013
    Location
    australia
    Posts
    2,386


    Did you find this post helpful? Yes | No

    Default Re: A tft addin for pbp3

    some further refinements , drawarc (45deg arc ) fillarc (45 deg pie slice ) and a proper fillrrect (fill round cornered rectangle) and drarrrect , also fixed errors for button macros that had no text option selected
    Attached Files Attached Files

Similar Threads

  1. Replies: 0
    Last Post: - 25th September 2013, 18: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, 08:50
  3. I really need some help with PBP3
    By Ramius in forum mel PIC BASIC Pro
    Replies: 5
    Last Post: - 26th February 2012, 16:05
  4. What's with PBP3?
    By BrianT in forum mel PIC BASIC Pro
    Replies: 3
    Last Post: - 10th August 2011, 17:09
  5. Experience of driving TFT screens?
    By isaac in forum General
    Replies: 1
    Last Post: - 26th September 2008, 00:15

Members who have read this thread : 7

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