SHIFTOUT Clock rate


Closed Thread
Results 1 to 11 of 11

Hybrid View

  1. #1
    Join Date
    Jul 2006
    Location
    USA
    Posts
    26

    Default SHIFTOUT Clock rate

    Is there any way to get the clock rate higher than 50kHz? Has anyone
    contacted ME Labs about this? I need more speed!!! Just checking before I
    change the design to use the hardware MSSP.

  2. #2
    Join Date
    May 2006
    Location
    Del Rio, TX, USA
    Posts
    343


    Did you find this post helpful? Yes | No

    Default

    Brock,
    I am curious about this as I plan on using this feature, but have not gotten to that point in my project yet. The manual is a bit vague in it's statement "The shift clock runs at about 50KHz dependent on the oscillator". Have you tested the actual speed?

    Here's why I ask. Looking at the ASM produced by PBP, the SHIFTIN/SHIFTOUT seem to control the speed of the clock using the same subroutine ("shifttoggle"). This routine adds dummy BRA calls based on the defined OSC. If I've counted correctly the "shifttoggle" routine takes 6 instructions cycles for OCS 4MHz (6us), and 24 instructions cycles for 40MHz (2.4us). There are about 14 or so additional instructions in the SHIFTOUT routine. So for 4MHz, 20 total instruction cycles (20us) would result in around 50kHz. But, at 40MHz, 38 instruction cycles (3.8us) would be about 263KHz. Which leads me to believe that at faster OSC, the actual frequency of the clock would be faster (otherwise I would have expected the routine to have 60 instruction cycles for 40MHz OSC). I may have missed something, but don't have the time to actually check it out and measure it on a scope at this time.

    I'm already using the MSSP for I2C and, like you, would have to change my design to accomadate using the MSSP for SPI.

    Curiously,
    Steve

  3. #3
    Join Date
    Jul 2006
    Location
    USA
    Posts
    26


    Did you find this post helpful? Yes | No

    Default

    That's interesting. I will check it with a scope today. I run the circuit at 20MHz
    right now and didn't want to bump it to 40MHz because it would completely
    change my datalogging scheme which uses the overflow of Timer 1. But is still
    easier than changing to the MSSP. I'll post results of the clock after I check it.

  4. #4
    Join Date
    Jul 2006
    Location
    USA
    Posts
    26


    Did you find this post helpful? Yes | No

    Default

    OK, at 20MHz with a PIC18F2520, the clock rate for SHIFTOUT is 5.2 us or
    192 KHz. It would be nice to get this clock rate up to 500 kHz or even 1 MHz.
    I'm open to ideas or suggestions.

    [Edit] Just checked it at 40 MHz and the clock rate is 3.6 us or 278 kHz.

    I sure would like to get a faster clock without increasing to 40 MHz.
    Last edited by Brock; - 8th July 2006 at 16:22.

  5. #5
    Join Date
    Sep 2005
    Location
    Campbell, CA
    Posts
    1,107


    Did you find this post helpful? Yes | No

    Default

    An assembly-language subroutine would certainly allow for a faster SHIFTOUT.
    Charles Linquist

  6. #6
    Join Date
    Jul 2006
    Location
    USA
    Posts
    26


    Did you find this post helpful? Yes | No

    Default

    It would be no small task inserting an assembly routine... I would have to insert
    many routines. I also don't know assembly very well. Speaking of assembly, is
    it possible to modify the PBPPIC18.LIB file (shiftout routine)?

    If I could double the speed of the shiftout clock, that would do it.

Similar Threads

  1. 7 Segment Displays and MAX7219
    By Bill Legge in forum mel PIC BASIC Pro
    Replies: 13
    Last Post: - 31st October 2010, 18:30
  2. Smart Star (how to use shift registers)
    By mackrackit in forum Code Examples
    Replies: 3
    Last Post: - 30th November 2008, 20:06
  3. reducing shiftout clock freq and PS2/PC interfacing ....
    By wireless magic in forum mel PIC BASIC Pro
    Replies: 18
    Last Post: - 26th February 2008, 20:15
  4. After Shiftout where is the clock signal???
    By makson in forum mel PIC BASIC Pro
    Replies: 0
    Last Post: - 31st August 2007, 18:27
  5. Help with sound command in 2 programs
    By hyperboarder in forum mel PIC BASIC Pro
    Replies: 4
    Last Post: - 5th July 2007, 20:36

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