Faster SHIFTOUT without dedicated hardware, possible?


Closed Thread
Results 1 to 20 of 20

Hybrid View

  1. #1
    Join Date
    Aug 2011
    Posts
    457


    Did you find this post helpful? Yes | No

    Default Re: Faster SHIFTOUT without dedicated hardware, possible?

    For MSBFIRST, just change the order of the 'WREG.bit' tests
    Code:
    ; SHOUT
    ; shift out 8 bits of data, MSB to LSB
    ; data clocked on rising edge of SHCLK
    ; WREG = data to send
    SHOUT:
    SHDAT = 0
    if WREG.7 then
      SHDAT = 1
    endif
    SHCLK = 1
    SHCLK = 0
    
    SHDAT = 0
    if WREG.6 then
      SHDAT = 1
    endif
    SHCLK = 1
    SHCLK = 0
    
    SHDAT = 0
    if WREG.5 then
      SHDAT = 1
    endif
    SHCLK = 1
    SHCLK = 0
    
    SHDAT = 0
    if WREG.4 then
      SHDAT = 1
    endif
    SHCLK = 1
    SHCLK = 0
    
    SHDAT = 0
    if WREG.3 then
      SHDAT = 1
    endif
    SHCLK = 1
    SHCLK = 0
    
    SHDAT = 0
    if WREG.2 then
      SHDAT = 1
    endif
    SHCLK = 1
    SHCLK = 0
    
    SHDAT = 0
    if WREG.1 then
      SHDAT = 1
    endif
    SHCLK = 1
    SHCLK = 0
    
    SHDAT = 0
    if WREG.0 then
      SHDAT = 1
    endif
    SHCLK = 1
    SHCLK = 0
    
    return

  2. #2
    Join Date
    Feb 2013
    Posts
    1,150


    Did you find this post helpful? Yes | No

    Default Re: Faster SHIFTOUT without dedicated hardware, possible?

    Thank you again!
    Only today I managed to adapt this code to my hardware and it works very fast!

  3. #3
    Join Date
    Feb 2013
    Posts
    1,150


    Did you find this post helpful? Yes | No

    Default Re: Faster SHIFTOUT without dedicated hardware, possible?

    But I have a question, WREG is not an variable, but a register name, right?

Similar Threads

  1. Replies: 29
    Last Post: - 20th May 2010, 03:47
  2. Is there a faster way to compare?
    By RussMartin in forum mel PIC BASIC Pro
    Replies: 12
    Last Post: - 8th February 2010, 19:48
  3. Dedicated LCD Controller question
    By chuckles in forum mel PIC BASIC Pro
    Replies: 6
    Last Post: - 27th February 2006, 14:44
  4. Is there a faster/better way of doing this?
    By Mad_Labs in forum mel PIC BASIC Pro
    Replies: 1
    Last Post: - 8th October 2005, 11:01

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