>But why is the following >code not working (more exactly hangs the pic) Code proper may or may not work (quick glance suggests MAY have 1 bug I can see) BUT the hanging is caused (at least) by the DLY3 label being on the MOVLW line. It should be one line further down. As it is now it keeps reloading the delay forever But, you knew that, didn't you:-) regards Russell McMahon _____________________________ >From other worlds - www.easttimor.com www.sudan.com What can one man* do? Help the hungry at no cost to yourself! at http://www.thehungersite.com/ (* - or woman, child or internet enabled intelligent entity :-)) -----Original Message----- From: Joep Schro‘n To: PICLIST@MITVMA.MIT.EDU Date: Sunday, 27 February 2000 00:54 Subject: A simple Question from a newby >Hello, > >I'm new at the Pic Micro's > >This is my problem: I'am working with a Pic16f84 > >I need to set a Hef4094 ser/par converter.. I want it to do it as follows: > >I've got a fileregister say: "schuif" > >I want to put for example: 00000001 in the fileregister > >And then clock this out, how can I do this clocking out with the less >possible code? > >I was thinking to "call" for example "update4094" But why is the following >code not working (more exacly hangs the pic) > >Can anybody help me with it? Or give any examples? > >out_q0 > MOVLW B'00000001' > MOVWF schuif > CALL update4094 > > >update4094 bsf _clock ; clock up to 4094 >period. > movlw D'8' ; .8 >; 8 bits to go. > movwf CounterReg >nextout bcf _clock ; lower the clock. > bcf _data ; initially, >data output low > rlf schuif,1 ; rotate >OutputReg through carry. > btfsc STATUS,C ;cy ; check out if >carry is '1'. > bsf _data ; yep! so set the >DataOut. > bsf _clock ; clock into >4094. > decfsz CounterReg ; 8 bits done? > goto nextout ; no, do some more >bits. > > bcf _clock ; clock low. > > BCF _enable ;now give strobe: value >is set on >DLY3 MOVLW D'250' ; > MOVWF TEMP1 ; LITTLE DELAY > DECFSZ TEMP1,1 ; > GOTO DLY3 > BSF _enable > retlw 0 > RETURN > > >Many thank's in advance, > Joep Schroen (pd3rog) >