This is a multi-part message in MIME format. ------=_NextPart_000_0015_01C2069F.2690DD70 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Bob I adopted this snipet you gave me the other day and iv included the enitire source file so you can see what i ve come up with. I think you where talking about macros when you usde the skpc and skpnc instructions. I think i have them right as this what they cooresponded to in the assembler quick reference guide. here is there problems i see number one is that i need to see data going to the max7219 at all times well it doesn't appear to do this until the clock sequence is counted up to each max. Ive shortened the sequnces so i can see it increment. And when it decrements the count register it starts counting from 255 to 0 when it gets here it starts over again any suggestion are very appreciated Thanks Again Mike Johnston ----- Original Message ----- From: "Bob Ammerman" To: Sent: Thursday, May 16, 2002 6:40 PM Subject: Re: [PIC] Max7219 interfacing (was Shift Register Useage-TPIC6A595) > 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 > ------=_NextPart_000_0015_01C2069F.2690DD70 Content-Type: application/octet-stream; name="archeon2.asm" Content-Transfer-Encoding: quoted-printable Content-Disposition: attachment; filename="archeon2.asm" ;------------------archeon2.0 mwj = 021902--------------------------------------=09 list p=3D16c54=09 radix dec ;------------------------------------------------------------------------= -------- cblock 0 =09 indf rtcc pc status fsr porta portb ;------------------------------------------------------------------------= --------- ; clock variables =09 sec=09 min hrs count srlo srhi ; s1 ; s2 ;------------------------------------------------------------------------= --------- endc ;------------------------------------------------------------------------= ------------- org 0 ;------------------------------------------------------------------------= ------- start movlw b'00001000' ;port a bit3 in rest out =09 tris porta movlw b'00110000' ;port b bit4 3 in rest out=09 tris portb wtforlo btfsc porta,3=09 goto wtforlo wtforhi btfss porta,3 goto wtforhi ;------------------------------------------------------------------------= ------- seconds incf sec,f ;increment the sec timer movlw 60 ;compare it to 60 xorwf sec,w btfss status,2 ;has it reach 60 yet goto wtforlo =09 ; =09 movwf sec ;------------------------------------------------------------------------= ---- minutes incf min,f ;increment the minutes timer movlw 2 xorwf min,w btfss status,2=09 goto wtforlo ;=09 movf 0,f movwf min ;-------------------------------------------------------------------- hours incf hrs,f movlw 2 xorwf hrs,w btfsc status,2 goto wtforlo=09 ; movlw 1 movwf hrs ;------------------------------------------------------------------------= ----- =09 bcf portb,2 ;activate Load cs movlw 17 ;i per bit,plus one extra goto rotate ;------------------------------------------------------------------------= ----- loop bsf portb,0 ;toggle clock nop bcf portb,0 ;------------------------------------------------------------------------= ----- rotate rlf srlo,f ;rotate 16-bit value , hi bit to carry rlf srhi,f ; btfsc status,0 ;copy carry to data pin bsf portb,1 btfss status,0 ; decfsz count,f goto loop bsf portb,2 ;------------------------------------------------------------------------= ----- = =20 goto wtforlo goto start ; end =09 =09 =09 =09 =09 =09 =09 ------=_NextPart_000_0015_01C2069F.2690DD70-- -- http://www.piclist.com hint: The PICList is archived three different ways. See http://www.piclist.com/#archives for details.