Long shift register


Closed Thread
Results 1 to 21 of 21

Hybrid View

  1. #1
    Join Date
    Aug 2006
    Posts
    65

    Default Long shift register

    I need to make a long shift register with 1000 taps or so. I'd like to be able to clock bits into it at a minimum 10 khz rate. I know how I'd do it in assembler, but I'd really like to implement it in PBP if feasable. Are there any tricks to streamline this process?

    Joe

  2. #2
    Join Date
    Nov 2005
    Location
    Bombay, India
    Posts
    967


    Did you find this post helpful? Yes | No

    Default

    How about inline assembly enclosed by ASM....ENDASM statements?

  3. #3
    Join Date
    Aug 2006
    Posts
    65


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by Jerson View Post
    How about inline assembly enclosed by ASM....ENDASM statements?
    That would defeat my goal. I wanted to see if I could do it all (or mostly) in PBP.

    Thanks

    Joe

  4. #4


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by Joe Rocci View Post
    That would defeat my goal. I wanted to see if I could do it all (or mostly) in PBP.

    Thanks

    Joe
    Are the picbasic commands 'shiftin' and 'shiftout' too slow for you ?

  5. #5
    Join Date
    Aug 2006
    Posts
    65


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by Chris Barron View Post
    Are the picbasic commands 'shiftin' and 'shiftout' too slow for you ?

    Chris

    SHIFTOUT is an I/O function that toggles an output port with the bitwise contents of a data variable. SHIFTIN does the same thing in the other I/O direction.

    What I want to do is set up a 'virtual' 1000 tap shift-register in the PIC's memory and be able to clock data through it. It's basically a digital delay line in memory, commonly used for digital signal processing applications. I need to clock it at a well-defined rate and also be able to read any of the 1000 tap points at any time.

    It's quite straightforward in assembler, but I wanted to try to incorporate it into an existing PBP program using PBP's ">>" (shift right) and or "<<" (shift left) instructions instead of using assembler. I was hopng someone would tell me there are secret PBP system variables that capture the bits that are shifted OUT of an array variable so they can be shifted back IN to the next variable in the array. This way, a 63-word array could be set up as the 1000-bit shift-register, and bits could be clocked through the 1000 bits as though it were one long shift-register.

    Joe

  6. #6
    Join Date
    Jan 2009
    Location
    California, USA
    Posts
    323


    Did you find this post helpful? Yes | No

    Default

    well, I guess that you can only have bit arrays up to 256 elements, but I was thinking something like this..

    Code:
    bigarray 	var	  bit[256] 'Large array to hold data
    newdata	var	  bit   'newest bit to be shifted in
    index		var	  byte
    
    
    for 0 to 255
        bigarray[index] = bigarray[index +1] 
        next index
        
    bigarray[255] = newdata  'put the newest data bit into the array
    Maybe with 4 big arrays you could shift through 1024 steps?
    Or have I missed the point entirely...

Similar Threads

  1. Active low input?
    By CosMecc in forum mel PIC BASIC Pro
    Replies: 14
    Last Post: - 8th August 2010, 20:31
  2. PIC16F877A pwm use for IR transmission
    By mcbeasleyjr in forum General
    Replies: 0
    Last Post: - 11th July 2009, 18:51
  3. Replacing shift register with PIC
    By TonyA in forum mel PIC BASIC Pro
    Replies: 6
    Last Post: - 7th April 2008, 18:31
  4. Shift Register Woes, specifically the STP16DP05
    By elec_mech in forum mel PIC BASIC Pro
    Replies: 2
    Last Post: - 11th November 2007, 23:22
  5. Replies: 15
    Last Post: - 30th January 2005, 03:58

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