You need a very similar technique, but not identical technique Using the 3-wire interface you would: set CS to zero for each of 16 bits: output data bit to data pin set CLK hi set CLK lo end for lower CS Bob Ammerman RAm Systems ----- Original Message ----- From: "Michael Johnston" To: Sent: Thursday, May 16, 2002 6:49 PM Subject: Re: [PIC] Shift Register Useage-TPIC6A595 > Bob > Could i use this code for a max7219 ic to display time? > My clock uses this chip to display time like a regular clock > Thanks > Mike Johnston > ----- Original Message ----- > From: "Bob Blick" > To: > Sent: Thursday, May 16, 2002 2:09 PM > Subject: Re: [PIC] Shift Register Useage-TPIC6A595 > > > > Try this, it is set to drive two '595 registers in series, and follow Bob > > A's other instructions. > > > > You can expand or shrink it as you desire. > > > > I did not need any delays at 4 MHz, you might need a nop here or there at > > 20MHz > > > > Cheers, > > > > Bob Blick > > > > ; SRDATA on PORTB,7 > > ; SRCLOCK on PORTB,6 > > ; SROUT on PORTB,5 > > ; data to send in srlo,srhi > > ; uses temporary register "count" > > ; does not trash srlo or srhi > > > > movlw 0x11 ; 17 decimal > > movwf count > > goto ROTATE > > LOOP: > > bsf 6,6 ; toggle clock > > bcf 6,6 > > ROTATE: > > rrf srhi ; rotate right > > rrf srlo ; rotate into carry > > btfsc 3,0 ; test carry > > bsf 6,7 ; set pin if carry > > btfss 3,0 ; test carry > > bcf 6,7 ; clear pin if not carry > > decfsz count > > goto LOOP > > bsf 6,5 ; toggle output register > > bcf 6,5 > > return > > > > -- > > http://www.piclist.com hint: To leave the PICList > > mailto:piclist-unsubscribe-request@mitvma.mit.edu > > > > -- > http://www.piclist.com hint: To leave the PICList > mailto:piclist-unsubscribe-request@mitvma.mit.edu > > -- http://www.piclist.com hint: To leave the PICList mailto:piclist-unsubscribe-request@mitvma.mit.edu