Long shift register


Closed Thread
Results 1 to 21 of 21

Hybrid View

  1. #1
    Join Date
    Aug 2006
    Posts
    65


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by Chris Barron View Post
    That sounds very very cool !

    Just a look at the processing time......(your minimum execution time assembly example)

    2000 bits = 250bytes = 250 RLF's = 250 clock cycles

    At 4MHz (crystal) , clock cycles = 1MHz, shift frequency = 4kHz (1MHz/250)


    Chris,

    I'm using a 20mhz crystal, so cycle time is 200nsec. My ~260 cycle assembler SR should thus take about 52 usec, if my math is correct. I was planning to use the crystal to run a Timer1 timer to generate prescise 100usec interrupts. If I sample at 100usec (10khz), that leaves about 48usec to do 'other things'. That would do it in the assembler version.

    The big question, is there a PBP alternative that would be fast enough, and in fact leave a little time for other things?? I suspect not, and that I'll end up with a hybrid solution, using assembler for the SR, and PBP for the 'other things'.

    Joe

    Joe

  2. #2


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by Joe Rocci View Post
    Chris,

    I'm using a 20mhz crystal, so cycle time is 200nsec. My ~260 cycle assembler SR should thus take about 52 usec, if my math is correct. I was planning to use the crystal to run a Timer1 timer to generate prescise 100usec interrupts. If I sample at 100usec (10khz), that leaves about 48usec to do 'other things'. That would do it in the assembler version.

    The big question, is there a PBP alternative that would be fast enough, and in fact leave a little time for other things?? I suspect not, and that I'll end up with a hybrid solution, using assembler for the SR, and PBP for the 'other things'.

    Joe

    Joe
    I would go for the 100uS interrupt and do the basic shifting in the ISR. every 8th bitshift do a single byte pointer reallocation. That would be the circular buffer. You could trim it down to 10 clock cycles per interrupt, and every 8th interrupt 20 clock cycles.

    Picbasic, like C, and most other high level languages, are macro systems for assembler, of particular flavours depending on the main application. I consider myself lucky that I learned assembler first before any other langauge (with the exception of the file handler friendly OPL on Psion PDA's)

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