A tft addin for pbp3


Results 1 to 40 of 142

Threaded View

  1. #9
    Join Date
    Sep 2009
    Posts
    755


    Did you find this post helpful? Yes | No

    Default Re: A tft addin for pbp3

    Never done something like that, but as DT said there is no better manual than .mac and .lib files.
    So here is what I found.

    Compiler use this macro from pbppic18.mac file when LCDOUT STR is used
    Code:
    ;****************************************************************
    ;* LCDOUTSTR?B : Macro - Lcdout string                          *
    ;*                                                              *
    ;* Input      : B[]                                             *
    ;* Output     : None                                            *
    ;*                                                              *
    ;* Notes      :                                                 *
    ;****************************************************************
    
    LCDOUTSTR?B macro Bin
            MOVE?CW LCDOUTJ, R8 'dont know what this line do
    	MOVE?CB	high (Bin), FSR2H 'load highbyte of adr, from pbppic18.lib Macro - Move BYTE Variable into WORD Variable
            MOVE?CA	low (Bin) 'load low byte of adr to w, from pbppic18.lib MOVE?CA    : Macro - Move constant into W 
     
            L?CALL  SEROUT2STR
        endm
    SEROUT2STR is in file pbppic18.
    Code:
    SEROUT2STR movwf FSR2L          ; Set up for index
    serout2strloop movf POSTINC2, W	; Get a character
    	bnz	serout2str1	; Not null char
    So you could use in your program something like this:
    Code:
    TFTSTR?B macro Bin
    	MOVE?CB	high (Bin), FSR2H ;load highbyte  
            MOVE?CB	low  (Bin), FSR2L ;load low byte  
    local tftstrloop 
    local tftStrDone
    tftstrloop movf POSTINC2, W	; Get a character, then increment pointer
            BZ  tftStrDone ;All strings must end with 0
           ;Not Null char 
            L?CALL tftWoutput; CALL print char in W to TFT 
            BRA tftstrloop ;Get next chr
          
    tftStrDone: ;Null char
    
    endm ;end of macro
    EDIT:
    You could also use PBP's routine like LCDOUTSTR do, but you must see what this flags do
    LCDOUTJ_USED = 1
    SEROUT2STR_USED = 1
    And how JUMPMAN is used.
    Last edited by pedja089; - 22nd June 2015 at 02:11.

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