A tft addin for pbp3


Closed Thread
Results 1 to 40 of 142

Hybrid View

  1. #1
    Join Date
    Oct 2005
    Location
    Sweden
    Posts
    3,612


    Did you find this post helpful? Yes | No

    Default Re: A tft addin for pbp3

    Hi Richard,
    Which device are you targeting?

    /Henrik.

  2. #2
    Join Date
    Oct 2005
    Location
    Sweden
    Posts
    3,612


    Did you find this post helpful? Yes | No

    Default Re: A tft addin for pbp3

    but a #define thats made here seems unreadable to the pbp compiler
    and I don't really want to do the whole routine in asm
    Exactly, that's what I meant by "but then it's too late". The assembler doesn't do its stuff until PBP is finished doing it stuff so whatever you do in and with the assembler is unkown to the compiler....

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


    Did you find this post helpful? Yes | No

    Default Re: A tft addin for pbp3

    Which device are you targeting?
    any pic18 was what I'm aiming at , hoping to get a default compile that would use mssp1 if it exists/shiftout if no mssp exits and mssp2 if user sets a define to do so.
    dare I say idiot proof , but I don't think I can do it , at this point users will need some knowledge of the pic hardware chosen for their application and will need to modify the code accordingly.

  4. #4
    Join Date
    Oct 2005
    Location
    Sweden
    Posts
    3,612


    Did you find this post helpful? Yes | No

    Default Re: A tft addin for pbp3

    Hi Richard,
    I tried the following very simple program
    Code:
    CMD VAR BYTE
    CMD = SSPBUF
    CMD = SSP1BUF
    CMD = SSP2BUF
    I compiled it for a couple of 18F devices, all with 2 MSSP modules. Some of them (like the 18F24J11, 18F44J50 and 18F46K22) worked fine while others didn't and gave a Bad Expression error on the CMD=SSPBUF. My conclusion is that Microchip isn't consistent in aliasing SSPBUF to SSP1BUF thru all their device header files :-(

    I don't know a way of doing it automatically - that's not to say it can't be done though!
    I'd probably use SSPBUF in the code and add a comment saying that if the compiler complains then add SSPBUF VAR SSP1BUF to the code. That's certainly not idiot proof but you do know that's an impossible thing to achieve ;-)

    /Henrik.

  5. #5
    Join Date
    May 2013
    Location
    australia
    Posts
    2,644


    Did you find this post helpful? Yes | No

    Default Re: A tft addin for pbp3

    henrik
    I think your right and what you suggest may be as good as it gets


    add SSPBUF VAR SSP1BUF on Expression error

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


    Did you find this post helpful? Yes | No

    Default Re: A tft addin for pbp3

    WILL call this version 1.0 , the python code now converts the pixels to suit (saves the pic18 from all that work)

    the usercommand file has a more meaningful name but I forgot to update the demo's include to the new name
    change glcd_chr include to INCLUDE "TFT_SPI.pbpmod" ;glcdc
    Attached Files Attached Files
    Last edited by richard; - 3rd July 2015 at 10:38.

  7. #7
    Join Date
    Jan 2013
    Location
    Texas USA
    Posts
    229


    Did you find this post helpful? Yes | No

    Default Re: A tft addin for pbp3

    Richard,

    Great amount of work on this library.
    I have to hand it to you, a lot of coding you worked out there.

    For my own edification, I have a question for you.

    In "TFT_SPI.PBPMOD" you have your setxy 8-element byte array for y0, y1, x0 & x1 declared.
    This I understand.
    You do this to support Word variables for x0 & x1 and space for y0 and y1 to be used as Word variables in the future,
    but used as byte variables today. This I assume as the TFT display's y axis in less than 255.

    One thing I notice though is that you have the following ASM address mapping for the individual x&y elements.
    Code:
    ASM       
    y0 = _setxy +1   
    y1 = _setxy +3
    x0 = _setxy +4
    x1 = _setxy +6
    ENDASM
    Then you have the following PBP variable declarations.
    Code:
    x0 var WORD EXT 
    x1 var WORD EXT
    y0 var byte EXT 
    y1 var byte EXT
    Understood at this point.
    x vars are Words and y vars are Bytes.

    But here is my question, I thought I noticed you use a lot of manual (CHK?RP/movlw/movwf) manipulation within the USERCOMMANDS for
    the y0 & y1 variables instead of using PBP standard macros for MOVE?xx.

    Could you not change the ASM address mapping for the y0 & y1 elements to use Little Endian style, instead of Big Endian, and then use the
    standard PBP macros (MOVE?BB, MOVE?CB, MOVE?WB)?
    Wouldn't that simplify the ASM in the USERCOMMAND macros?
    Doesn't the PBP standard MOVE?xx macros take care of the BankSel testing/switching and movement of the High and Low bytes for you?

    Code:
    ASM       
    y0 = _setxy +0   
    y1 = _setxy +2
    x0 = _setxy +4
    x1 = _setxy +6
    ENDASM
    I may be off base, but was just curious.
    I didn't read through the entire "TFT_SPI.PBPMOD", to see if there was another reason you have y0 & y1 defined in ASM as Big Endian.
    Regards,
    TABSoft

  8. #8
    Join Date
    May 2013
    Location
    australia
    Posts
    2,644


    Did you find this post helpful? Yes | No

    Default Re: A tft addin for pbp3

    good catch tabsoft , I missed that when I changed the setxy method and never finished "cleaning up" . the two hardware includes have been fixed also (same error)
    y0,y1 are now words and usercommand macros are more consistent
    version 1.1 for these files (already)
    Attached Files Attached Files

  9. #9
    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
    >>>

  10. #10
    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.

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


    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

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 : 0

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