Mike DeMetz wrote: > Any one have a routine equivilant to the BS2's Shiftout? Mike: This question was asked just a few weeks ago; here's a copy of my reply: ------- Forwarded Message Follows ------ 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'll take 84 microseconds. At 8 MHz, of course, it would take half as long. ------- End of Forwarded Message ------ -Andy === Andrew Warren - fastfwd@ix.netcom.com === Fast Forward Engineering - Vista, California === http://www.geocities.com/SiliconValley/2499