Any idea's on porting this to PBP?


Results 1 to 21 of 21

Threaded View

  1. #1
    Join Date
    Sep 2006
    Location
    Indiana, USA
    Posts
    72

    Default Any idea's on porting this to PBP?

    I copied this from scott edwards, all the code is his, i just modified it a little to try it out with PBP, all i get is a blank LCD. my version gets rid of the nibble variable, which is where i think it might go wrong, if someone could get this to work it would benifit everyone im sure. im using a 4X20 LCD, i've used a different aproach to large letters that worked fine but ate up most of my 16F648A's resorces (for a compass heading display).

    ALL PROPS TO SCOTT EDWARDS AND SEETRON!!!
    Code:
    CMCON = 7                              ' Turn off un-needed PIC hardware
    VRCON = 0                              '   ''             ''
    CCP1CON = 0                            '   ''             ''
    INTCON = %00000000                     '   ''             ''
    
    I       con  $FE    ' Instruction prefix.
    ClrLCD  con  1      ' Clear-LCD instruction.
    
    cgRAM   con  $40    ' Address 0 of CG RAM.
    EEptr   var  word   ' Pointer into EEPROM.
    pat     var  EEptr  ' Alias for EEptr.
    dispVal var  word   ' Value to be displayed as big digits.
    temp    var  byte   ' Temporary byte variable.
    decade  var  word
    nbl     var  byte    ' Index into number-pattern tables. changed.was a NIBBLE  
    digit   var  byte    ' Current digit to display
    line    var  byte    ' LCD line
    
    ' ====This section may be omitted with newer (post July 96)
    ' ====4x20 Serial LCD modules. Cut from here...============== >>>
    
    bitPat0 DATA  0,0,0,1,3,7,15,31  ' Left-right up-ramp shap
    bitPat1 DATA  0,0,0,16,24,28,30,31  ' Right-left "       "
    bitPat2 DATA  31,15,7,3,1,0,0,0  ' Left-right down ramp.
    bitPat3 DATA  31,30,28,24,16,0,0,0  ' Right-left "    "
    bitPat4 DATA  0,0,0,0,31,31,31,31  ' Lower block.
    bitPat5 DATA  31,31,31,31,0,0,0,0  ' Upper block.
    bitPat6 DATA  31,31,31,31,31,31,31,31  ' Full block.
    bitPat7 DATA  0,0,0,0,0,0,0,0  ' Full blank
    
    ' <<<...to here. ===============================================
    
    low 0  ' Make the serial output low
    pause 1000  ' Let the LCD wake up.
    
    ' ====This section may be omitted with newer (post July 96)
    ' ====4x20 Serial LCD modules. Cut from here...============= >>>
    
    LCDOUT I,cgRAM  ' Enter CG RAM.
    for EEptr = 0 to 63  ' Write the bit patterns
      Read EEptr,temp  '   to the LCD.
    LCDout temp
    next
    
    ' <<<...to here. ===============================================
    LCDOUT I,ClrLCD  ' Clear the LCD.
    pause 1
    
    ' ========================================================================
    '       Demo Loop: Show dispVal in Big Numerals, Increment, Loop
    ' ========================================================================
    
    again:
      gosub bigLCD
      dispVal = dispVal + 1
      pause 500
    goto again:
    
    ' ========================================================================
    '                 Subroutine Displaying Large Numbers
    ' ========================================================================
    
    bigLCD:
    for line = 0 to 3
    decade = 1000
      lookup line,[$80,$C0,$94,$D4],temp
      LCDOUT I,temp
      for digit = 3 to 0
        nbl = dispVal dig digit
        gosub getPattern:
        if dispVal = 0 and digit = 0 then skip0:
        if dispVal < decade then blankIt:
    skip0:
        LCDOUT pat.bIT15,pat.bit14,pat.bit13,pat.bit12,pat.bit11,pat.bit10,pat.bit9,pat.bit8,pat.bit7,pat.bit6,pat.bit5,pat.bit4,pat.bit3,pat.bit2,pat.bit1,pat.bit0 ' was NIBS!
        goto cont:
    blankIt:
       LCDOUT "    "
    cont:
        if digit = 0 then skip1:
        LCDOUT 32
    skip1:
      decade = decade/10
      next
    next
    return
    
    ' ========================================================================
    '               Subroutines Defining Big-Character Patterns
    ' ========================================================================
    getPattern:
    branch line,[first,second,third,fourth]
    '             0     1     2     3     4     5     6     7     8     9
    '            ---   ---   ---   ---   ---   ---   ---   ---   ---   ---
    first:
    lookup nbl,[$0551,$7067,$0551,$0551,$6776,$6555,$0557,$2556,$0551,$0551],pat
    return
    second:
    lookup nbl,[$6776,$7767,$7743,$7743,$6776,$2441,$6041,$7703,$2443,$6776],pat
    return
    third:
    lookup nbl,[$6776,$7767,$0577,$7751,$2556,$7776,$6776,$7767,$0551,$2536],pat
    return
    fourth:
    lookup nbl,[$2443,$7464,$6444,$2443,$7776,$2443,$2443,$7767,$2443,$7443],pat
    return
    Last edited by ScaleRobotics; - 19th July 2010 at 05:18.

Similar Threads

  1. PBP Book
    By Bruce in forum Off Topic
    Replies: 83
    Last Post: - 4th October 2021, 12:55
  2. Generating Timed Fades in PBP - ideas ?
    By bcd in forum mel PIC BASIC Pro
    Replies: 2
    Last Post: - 10th August 2008, 00:18
  3. Compiler differences between PBP 2.33 & 2.46
    By nikopolis in forum mel PIC BASIC Pro
    Replies: 3
    Last Post: - 2nd May 2006, 19:01
  4. Newby- PBP wont compile for 18F (MPLAB)
    By jd76duke in forum mel PIC BASIC Pro
    Replies: 1
    Last Post: - 17th December 2005, 23:30
  5. PBP / XP Crash
    By pondindustrial in forum mel PIC BASIC Pro
    Replies: 1
    Last Post: - 27th November 2005, 03:16

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