Searching \ for 'Shifting bits out' in subject line. ()
Make payments with PayPal - it's fast, free and secure! Help us get a faster server
FAQ page: techref.massmind.org/techref/index.htm?key=shifting+bits+out
Search entire site for: 'Shifting bits out'.

Truncated match.
PICList Thread
'Shifting bits out'
1998\01\03@070226 by Virtual

picon face
part 0 357 bytes
HTML> I had just been using my basic stamp 2, with the shiftout command.
I was wondering if anyone had any code to do this on the PIC handy, I am using the 16c84 and would like an explanation of how quicky the data will be shifted out too depending on my clock freq.

Thankyou
John

1998\01\03@231129 by Virtual

picon face
I had just been using my basic stamp 2, with the shiftout command.
I was wondering if anyone had any code to do this on the PIC handy, I am
using the 16c84 and
would like an explanation of how quicky the data will be shifted out too
depending on my clock
freq.

Thankyou
John

1998\01\04@001537 by Andrew Warren

face
flavicon
face
Virtual <spam_OUTPICLISTTakeThisOuTspamMITVMA.MIT.EDU> wrote:

> I had just been using my basic stamp 2, with the shiftout command. I
> was wondering if anyone had any code to do this on the PIC handy, I
> am using the 16c84 and would like an explanation of how quicky the
> data will be shifted out too depending on my clock freq.

John:

The straightforward assembly-language translation of this PBASIC
fragment:

   Shiftout DataP,Clock,msbfirst,[counter] ' Send the bits.
   pulsout Latch,1                         ' Transfer to outputs.

is:

       MOVLW   8           ;Setup to shift 8 bits.
       MOVWF   COUNT       ;

   LOOP:

       BCF     DataP       ;Assume the next bit is a 0; pull the
                           ;DataP pin low.

       RLF     counter     ;Shift the next bit into the carry.
       SKPNC               ;If it really is a 0, skip ahead.
       BSF     DataP       ;Otherwise, pull the DataP pin high.

       BSF     Clock       ;Pulse the Clock line (the NOP may not be
       NOP                 ;necessary; check your device's timing
       BCF     Clock       ;requirements).

       DECFSZ  COUNT       ;Have we shifted all 8 bits out?
       GOTO    LOOP        ;if not, loop back and sjift another.

       BSF     Latch       ;Otherwise, pulse the Latch line.  Again,
       NOP                 ;the NOP may be unnecessary.
       BCF     Latch       ;

With the NOPs in place, this routine takes 84 clock cycles to shift
a byte out... So if your clock frequency is 4 MHz, it'd take 84
microseconds.  At 8 MHz, of course, it would take half as long.

-Andy

=== Andrew Warren - .....fastfwdKILLspamspam@spam@ix.netcom.com
=== Fast Forward Engineering - Vista, California
=== http://www.geocities.com/SiliconValley/2499

1998\01\04@003033 by Virtual

picon face
part 0 288 bytes
HTML> Cool, thanks a lot Andy,
for some reason i was confusing myself the more I thought about this  :)
It must be the thought of my christmas vacation coming to an end and having to go back to school.

John

1998\01\05@124145 by Gary Chung

flavicon
face
part 0 576 bytes
HTML> Hey, is there anything wrong with your PC's clock ???
It was dated 3 Jan 1996 !!!!
Maybe something is wrong with my PC then :-(
 

Virtual wrote:

 

I had just been using my basic stamp 2, with the shiftout command.
I was wondering if anyone had any code to do this on the PIC handy, I am using the 16c84 and would like an explanation of how quicky the data will be shifted out too depending on my clock freq.

Thankyou
John

 

More... (looser matching)
- Last day of these posts
- In 1998 , 1999 only
- Today
- New search...