Searching \ for 'PIC16C84 problem' in subject line. ()
Make payments with PayPal - it's fast, free and secure! Help us get a faster server
FAQ page: www.piclist.com/techref/microchip/devices.htm?key=16C
Search entire site for: 'PIC16C84 problem'.

Truncated match.
PICList Thread
'PIC16C84 problem'
1998\10\23@045442 by Radoni Calin

flavicon
face
part 0 5175 bytes
<P><TT>-------------------</TT><TT></TT>

<P><TT>&nbsp;&nbsp;&nbsp; Sistem description :</TT>
<BR><TT>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; I build a little system
with a PIC16C84, an XT oscillator, and five LED's connected on the RB0-RB4
lines.</TT>
<BR><TT>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; In configuration word
WDT is NOT enabled.</TT><TT></TT>

<P><TT>-------------------</TT><TT></TT>

<P><TT>This program works well</TT>
<BR><TT>&nbsp;&nbsp;&nbsp; LIST P=16C84</TT>
<BR><TT>&nbsp;&nbsp;&nbsp; __CONFIG 0x3FF9</TT>
<BR><TT>&nbsp;&nbsp;&nbsp; #include "p16c84.inc"</TT>
<BR><TT>&nbsp;&nbsp;&nbsp; #define bank0 bcf STATUS,RP0</TT>
<BR><TT>&nbsp;&nbsp;&nbsp; #define bank1 bsf STATUS,RP0</TT>
<BR><TT>&nbsp;&nbsp;&nbsp; ORG 0</TT>
<BR><TT>start:</TT>
<BR><TT>&nbsp;&nbsp;&nbsp; clrf PORTB</TT>
<BR><TT>&nbsp;&nbsp;&nbsp; bank1</TT>
<BR><TT>&nbsp;&nbsp;&nbsp; clrf TRISB^0x80</TT>
<BR><TT>&nbsp;&nbsp;&nbsp; movlw 0x1F</TT>
<BR><TT>&nbsp;&nbsp;&nbsp; movf TRISA^0x80</TT>
<BR><TT>&nbsp;&nbsp;&nbsp; bank0</TT>
<BR><TT>&nbsp;&nbsp;&nbsp; movlw 0xEE</TT>
<BR><TT>&nbsp;&nbsp;&nbsp; movwf PORTB</TT>
<BR><TT>loop:</TT>
<BR><TT>&nbsp;&nbsp;&nbsp; goto loop</TT>
<BR><TT>&nbsp;&nbsp;&nbsp; END</TT><TT></TT>

<P><TT>-------------------</TT><TT></TT>

<P><TT>This program works BAD ! (it lights the whole five LED's)</TT>
<BR><TT>&nbsp;&nbsp;&nbsp; LIST P=16C84</TT>
<BR><TT>&nbsp;&nbsp;&nbsp; __CONFIG 0x3FF9</TT>
<BR><TT>&nbsp;&nbsp;&nbsp; #include "p16c84.inc"</TT>
<BR><TT>&nbsp;&nbsp;&nbsp; #define bank0 bcf STATUS,RP0</TT>
<BR><TT>&nbsp;&nbsp;&nbsp; #define bank1 bsf STATUS,RP0</TT>
<BR><TT>&nbsp;&nbsp;&nbsp; ORG 0</TT>
<BR><TT>start:</TT>
<BR><TT>&nbsp;&nbsp;&nbsp; clrwdt</TT>
<BR><TT>&nbsp;&nbsp;&nbsp; clrf PORTB</TT>
<BR><TT>&nbsp;&nbsp;&nbsp; bank1</TT>
<BR><TT>&nbsp;&nbsp;&nbsp; clrf TRISB^0x80</TT>
<BR><TT>&nbsp;&nbsp;&nbsp; movlw 0x1F</TT>
<BR><TT>&nbsp;&nbsp;&nbsp; movf TRISA^0x80</TT>
<BR><TT>&nbsp;&nbsp;&nbsp; bank0</TT>
<BR><TT>&nbsp;&nbsp;&nbsp; movlw 0xEE</TT>
<BR><TT>&nbsp;&nbsp;&nbsp; movwf PORTB</TT>
<BR><TT>loop:</TT>
<BR><TT>&nbsp;&nbsp;&nbsp; goto loop</TT>
<BR><TT>&nbsp;&nbsp;&nbsp; END</TT><TT></TT>

<P><TT>-------------------</TT><TT></TT>

<P><TT>This program also works BAD ! (it lights the whole 5 LED's)</TT>
<BR><TT>&nbsp;&nbsp;&nbsp; LIST P=16C84</TT>
<BR><TT>&nbsp;&nbsp;&nbsp; __CONFIG 0x3FF9</TT>
<BR><TT>&nbsp;&nbsp;&nbsp; #include "p16c84.inc"</TT>
<BR><TT>&nbsp;&nbsp;&nbsp; #define bank0 bcf STATUS,RP0</TT>
<BR><TT>&nbsp;&nbsp;&nbsp; #define bank1 bsf STATUS,RP0</TT>
<BR><TT>&nbsp;&nbsp;&nbsp; ORG 0</TT>
<BR><TT>start:</TT>
<BR><TT>&nbsp;&nbsp;&nbsp; clrf PORTB</TT>
<BR><TT>&nbsp;&nbsp;&nbsp; bank1</TT>
<BR><TT>&nbsp;&nbsp;&nbsp; clrf TRISB^0x80</TT>
<BR><TT>&nbsp;&nbsp;&nbsp; movlw 0x1F</TT>
<BR><TT>&nbsp;&nbsp;&nbsp; movf TRISA^0x80</TT>
<BR><TT>&nbsp;&nbsp;&nbsp; bcf OPTION_REG,PSA</TT>
<BR><TT>&nbsp;&nbsp;&nbsp; bank0</TT>
<BR><TT>&nbsp;&nbsp;&nbsp; movlw 0xEE</TT>
<BR><TT>&nbsp;&nbsp;&nbsp; movwf PORTB</TT>
<BR><TT>loop:</TT>
<BR><TT>&nbsp;&nbsp;&nbsp; goto loop</TT>
<BR><TT>END</TT><TT></TT>

<P><TT>---------- Message end ---</TT>
<BR><TT></TT>&nbsp;</HTML>

</x-html>

1998\10\25@180011 by Tony Nixon

flavicon
picon face
Radoni Calin wrote:
>
> This program works BAD ! (it lights the whole five LED's)
>     LIST P=16C84
>     __CONFIG 0x3FF9
>     #include "p16c84.inc"
>     #define bank0 bcf STATUS,RP0
>     #define bank1 bsf STATUS,RP0
>     ORG 0
> start:
>     clrwdt

Don't know about this one.
I can only suggest that you delete the CLRWDT instruction, because you
don't need it any way with the WDT disabled.

{Quote hidden}

There is a procedure to change the prescaler assignment to avoid the PIC
from resetting. If this is happening it may give the appearance of all
LED's on when the TRIS registers are reset at a high rate.

>     bank0
>     movlw 0xEE
>     movwf PORTB
> loop:
>     goto loop
> END
>

--
Best regards

Tony

Multimedia 16F84 Beginners PIC Tools.
**New Improved PicNPost**

http://www.picnpoke.com
Email spam_OUTpicnpokeTakeThisOuTspamcdi.com.au

1998\10\26@041402 by Dr. Imre Bartfai

flavicon
face
On Wed, 1 Jul 1998, Radoni Calin wrote:

{Quote hidden}

Hi,

all your problem have a common cause:

you MUST reset the watchdog timer periodically, i. e. WITHIN THE LOOP!

loop:
       ClrWdt
       goto    loop

The watchdog restarts after every ClrWdt. Then, after 18 msec (approx) it
restarts the processor (except you re-initialize the watchdog timer with
ClrWdt again).
I hope this helps.

Imre

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