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.
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.
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
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.
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.
An assembly-language subroutine would certainly allow for a faster SHIFTOUT.
Charles Linquist
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.
Bookmarks