Searching \ for 'code problem' 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=code+problem
Search entire site for: 'code problem'.

Truncated match.
PICList Thread
'code problem'
1997\03\20@201904 by Bill Meadows

picon face
Can anyone please tell me why the following Pic16C84 code doesn't work!
;
count equ 0c
countn equ 0d
countm equ 0e
shift   equ     0f

   org 000
start
   movlw 00           ;set port B
   tris portb         ;           for output
   clrf portb         ;all lines low (8 LED's off)
;
   movlw .9           ;number of
   movwf count        ;          shifts
;
   bcf status, c      ;clear carry flag
   movlw b'00000001'  ;store
   movwf shift        ;      pattern
;
repeat
   movf shift, w      ;get pattern
   movwf portb        ;display pattern
   call delay         ;                slowly
   rlf shift          ;rotate pattern left
   decfsz count       ;count-1 to count register by default
   goto repeat        ;LEDs flash one at a time from right to left
done goto done         ;program never gets to 'done'!
;
delay                  ;Easy PIC'n pause routine(delay works great)

   movlw 0ff          ;m
   movwf countm       ;  to counter
loadn
   movlw 0ff          ;n
   movwf countn       ;  to counter
decn
   decfsz countn      ;decrement n
   goto decn          ;again
   decfsz countm      ;decrement m
   goto loadn         ;again
   return             ;done

Thanks for the help,
Bill Meadows

1997\03\20@212053 by Sarunas Cepulis

flavicon
face
Bill Meadows wrote:
>
> Can anyone please tell me why the following Pic16C84 code doesn't work!
> ;
> count equ 0c
> countn equ 0d
> countm equ 0e
> shift   equ     0f
>
>     org 000
> start

       clrf    portb
       bsf     status,rp0      ;SELECT REG. BANK 1

>     movlw 0            ;set port B
>     tris portb         ;for output

       bcf     status,rp0      ;SELECT REG. BANK 0

{Quote hidden}

Hi,
Try this.
Saras.

1997\03\20@223952 by Andrew Warren

face
flavicon
face
Bill Meadows <spam_OUTPICLISTTakeThisOuTspamMITVMA.MIT.EDU> wrote:

> Can anyone please tell me why the following Pic16C84 code doesn't work!

Bill:

Your code is fine... My guess is that you haven't disabled the
watchdog timer.  Try doing that (or adding a "CLRWDT" instruction
right after the "decn" label) and see if that fixes it.

-Andy

=== Andrew Warren - .....fastfwdKILLspamspam@spam@ix.netcom.com
=== Fast Forward Engineering - Vista, California
===
=== Custodian of the PICLIST Fund -- For more info, see:
=== www.geocities.com/SiliconValley/2499/fund.html

1997\03\20@231240 by piclist

flavicon
face
Bill Meadows wrote:
>
> Can anyone please tell me why the following Pic16C84 code doesn't work!
> ;
> count equ 0c
> countn equ 0d
> countm equ 0e
> shift   equ     0f
>
>     org 000
> start

       clrf    portb
       bsf     status,rp0      ;SELECT REG. BANK 1

>     movlw 00           ;set port B
>     tris portb         ;           for output

       bcf     status,rp0      ;SELECT REG. BANK 0

{Quote hidden}

Hi,
Try this.
Saras.

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