Speed optimization (framebuffer scrolling)


Results 1 to 17 of 17

Threaded View

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


    Did you find this post helpful? Yes | No

    Default Re: Speed optimization (framebuffer scrolling)

    try some asm

    untested but should be close
    bcnt var byte bank 1
    dcnt var byte bank 1
    dspbuff var byte[380] ;36 displays + 2 outside of display * 10

    Code:
    rotate_r:  ' pic18
    asm
        banksel _bcnt    ;ROW
        movlw   10       ;10 rows  
        movwf   _bcnt
        clrf    FSR0H
        movlw   low  (_dspbuff)
        movwf   FSR0L
        movlw   111        ;BUFFER SIZE low byte  (380-1) 36 displays + 2 outside of display * 10-1
        ADDWF   FSR0L,F
        movlw   high (_dspbuff)
        ADDWFC   FSR0H
        movlw   1        ;BUFFER SIZE high byte  (380)
        ADDWF   FSR0H
        banksel _bcnt     ;note place bcnt and dcnt in same bank
        MOVLW 38     ;36 displays + 2 outside of display  
    NROW       
        movwf   _dcnt
        bcf    STATUS, C
    Ncol
        rrcf   POSTDEC0 ,f     ;PER COLUMN
        DECFSZ  _dcnt ,F
        BRA    Ncol
        BNC    NBNC
        bsf    PLUSW0,7     ;max displays would be 127 to use plusw
    NBNC 
        DECFSZ  _bcnt ,F
        BRA    NROW
        banksel 0
    endasm










    this is my 4 panel code for reference


    Code:
    rotate: ;pic18
    asm
        banksel _bcnt    ;ROW
        movlw   8
        movwf   _bcnt
        clrf    FSR0H
        movlw   low  (_dspbuff)
        movwf   FSR0L
        movlw   31        ;BUFFER SIZE
        ADDWF   FSR0L,F
        movlw   high (_dspbuff)
        ADDWFC   FSR0H
        banksel _bcnt
        MOVLW 4
    NROW     
        bcf    STATUS, C
        rrcf   POSTDEC0 ,f     ;PER COLUMN
        rrcf   POSTDEC0 ,f     ;PER COLUMN
        rrcf   POSTDEC0 ,f     ;PER COLUMN
        rrcf   POSTDEC0 ,f     ;PER COLUMN
        BNC    NBNC
        bsf    PLUSW0,7
    NBNC 
        DECFSZ  _bcnt ,F
        BRA    NROW
    endasm
    Last edited by richard; - 10th October 2022 at 00:46.
    Warning I'm not a teacher

Similar Threads

  1. Re:Scrolling speed control problem in moving message display
    By machobob in forum mel PIC BASIC Pro
    Replies: 0
    Last Post: - 19th June 2010, 12:08
  2. Replies: 0
    Last Post: - 7th August 2008, 09:02
  3. code size VS speed optimization setting?
    By Kamikaze47 in forum mel PIC BASIC Pro
    Replies: 7
    Last Post: - 28th April 2008, 14:38
  4. While we're on the subject of optimization...
    By skimask in forum mel PIC BASIC Pro
    Replies: 31
    Last Post: - 11th March 2008, 12:51
  5. Multiple if then optimization
    By Mugelpower in forum mel PIC BASIC Pro
    Replies: 35
    Last Post: - 5th March 2008, 12: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