Searching \ for '[PIC]:16F873 PortC bit 5 revisited - the death of!' 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/time.htm?key=rtc
Search entire site for: '16F873 PortC bit 5 revisited - the death of!'.

Exact match. Not showing close matches.
PICList Thread
'[PIC]:16F873 PortC bit 5 revisited - the death of!'
2002\04\03@230402 by DFansler

picon face
Dear PicList - I sent this email out yesterday asking why, or what I am
doing that would cause port c bit 5 to be pulled low internally to the chip.
The ensuing discussion has branched off to my use of using bcf, bsf to
toggle a bit on and off in order to get a feel for what the PIC was seeing -
this may or may not be proper code - it was just there for test purposes.
As to why bit 5 is hung low - not an educated - or even uneducated guess.
As I told my wife - I feel sort of like a guy who jumps out of an airplane -
his chute does not open and he radios for help.  The people on the ground
get into a long winded discussion about what kind of handle he has on his
rip cord and why it should be something else - never addressing the real
problem.  Sorry if I sound aggravated - I guess I was really hoping someone
had the answer as to why bit 5 is being held low instead of seeing
discussion on my use of bcf, bsf.

Thanks to all,
David

Since my last post, I have simplified my code to almost nothing to try to
find out why my 16F873 wants to pull port c bit 5 low - the code is below.
In this case I set port c up then input port C, check to see if bits 0,1,4
or 5 are low (they are pulled up to 5v by a 220 ohm resistor - pulling them
down is by a momentary push button switch).  If one of the inputs is low the
code determines which one and jumps to code that then pulses port c bit 3
either 1, 2, 3 or 4 times to indicate which button is pressed.  I then can
observe the output bit via my oscilloscope.  When the code runs in my
emulator all is well.  But when I burn a 16F873 and place it in the circuit
the output shows 4 pulses without a button being pushed - sure enough bit 5
is low on the oscope.  Pull the 16f873 from the circuit and the pin goes
high.  Something internal to the 16f873 is causing port c bit 5 to be low
(over riding the 220 ohm resistor).  The only peripheral I can find on the
16f873 that shares port c bit 5 is the Sync Serial Port, but I feel that I
have disabled it.

If anyone has any hints, I sure would be happy to hear them!
Thanks,
David


       include 'c:\ptools\16f873.inc'
               Fuses _CP_OFF
               Fuses _DEBUG_OFF
               Fuses _WRT_ENABLE_ON
               Fuses _CPD_OFF
               Fuses _LVP_OFF
               Fuses _BODEN_OFF
               Fuses _PWRTE_ON
               Fuses _WDT_OFF
               Fuses _HS_OSC

TEMP_B  equ 078h                        ;temporary register

               org 0000h

START

INIT_PORTS
       bsf RP0                 ;point to bank 1
       bcf RP1                 ;
       movlw 10110011b ;set port c to 7->Rx, 6->Tx, 5->Dim, 4->Bright
       movwf TRISC             ;3->test out, 2->PWM, 1-> Zero, 0->Hold/Cont
       movlw 00h               ;load 0 into W
       movwf SSPCON2   ;then into Sync Ser Port Cont 2
       movwf PIE1
       movwf PIE2
       bcf RP0                 ;point to bank 0
       movlw 00h               ;load 0 into W
       movwf PIR1
       movwf PIR2
       movwf SSPCON            ;then into Sync Ser Port Control
MAIN
       movf PORTC, W   ;read port C into W
       movwf TEMP_B            ;and into TEMP_B
       andlw 00110011b ;mask off key bits
       xorlw 00110011b ;any bits low?
       btfsc Z                 ;if key pressed then skip
       goto MAIN               ;else jump
       btfss TEMP_B,0  ;if Hold/Cont not set then jump
       goto SCAN_H:C           ;else jump
       btfss TEMP_B,1  ;if Zero not set then jump
       goto SCAN_ZERO  ;else jump
       btfss TEMP_B,4  ;if Brighten not set then jump
       goto SCAN_BRIGHT        ;else jump
       btfss TEMP_B,5  ;if Dim not set then jump
       goto SCAN_DIM   ;else jump
       goto MAIN
SCAN_H:C
       bsf Portc,3             ;port C bit 0 low
       bcf portc,3             ;so pulse bit 3 once
       goto MAIN

SCAN_ZERO
       bsf Portc,3             ;port C bit 1 low
       bcf portc,3             ;so pulse bit 3 twice
       bsf Portc,3             bcf portc,3
       goto MAIN

SCAN_BRIGHT
       bsf Portc,3             ;port C bit 4 low
       bcf portc,3             ;so pulse bit 3 three times
       bsf Portc,3
       bcf portc,3
       bsf Portc,3
       bcf portc,3
       goto MAIN

SCAN_DIM
       bsf Portc,3             ;port C bit 5 low
       bcf portc,3             ;so pulse bit 3 four times
       bsf Portc,3
       bcf portc,3
       bsf Portc,3
       bcf portc,3
       bsf Portc,3
       bcf portc,3
       goto MAIN

       end

David V. Fansler
S/V Annabelle
spam_OUTDFanslerTakeThisOuTspamMindSpring.com
http://www.dv-fansler.com

--
http://www.piclist.com hint: The list server can filter out subtopics
(like ads or off topics) for you. See http://www.piclist.com/#topics


2002\04\03@231855 by Byron A Jeff

face picon face
David,

With a simple chip it's impossible to tell why it behaves that way. Do you have
another 16F873? If so then try it.

Your problem seems to indicate that something is wrong with that particular
part.

BAJ

--
http://www.piclist.com hint: The list server can filter out subtopics
(like ads or off topics) for you. See http://www.piclist.com/#topics


2002\04\03@235529 by David Duffy

flavicon
face
At 10:59 PM 03/04/2002 -0500, you wrote:
{Quote hidden}

What speed crystal or resonator are you using?
If it's 4MHz, use XT_OSC mode.

{Quote hidden}

IIRC, you can't have a colon in the middle of a label.

{Quote hidden}

--
http://www.piclist.com hint: The list server can filter out subtopics
(like ads or off topics) for you. See http://www.piclist.com/#topics


2002\04\04@005844 by Tony Nixon

flavicon
picon face
"David V. Fansler" wrote:
>
> Dear PicList - I sent this email out yesterday asking why, or what I am
> doing that would cause port c bit 5 to be pulled low internally to the chip.
> The ensuing discussion has branched off to my use of using bcf, bsf to
> toggle a bit on and off in order to get a feel for what the PIC was seeing -
> this may or may not be proper code - it was just there for test purposes.
> As to why bit 5 is hung low - not an educated - or even uneducated guess.
> As I told my wife - I feel sort of like a guy who jumps out of an airplane -
> his chute does not open and he radios for help.  The people on the ground
> get into a long winded discussion about what kind of handle he has on his
> rip cord and why it should be something else - never addressing the real
> problem.  Sorry if I sound aggravated - I guess I was really hoping someone
> had the answer as to why bit 5 is being held low instead of seeing
> discussion on my use of bcf, bsf.
>
> Thanks to all,
> David

That sounds about right for a helpful list :-)

You haven't initialised any of PORTA B D or E.

These pins are inputs, and could be floating. This can cause all sorts
of code problems.

If the pins are unconnected, set them all to outputs and see if that
changes anything.


--
Best regards

Tony

mICros
http://www.bubblesoftonline.com
.....salesKILLspamspam@spam@bubblesoftonline.com

--
http://www.piclist.com hint: The PICList is archived three different
ways.  See http://www.piclist.com/#archives for details.


2002\04\04@080841 by Olin Lathrop

face picon face
> Dear PicList - I sent this email out yesterday asking why, or what I am
> doing that would cause port c bit 5 to be pulled low internally to the
chip.
> The ensuing discussion has branched off to my use of using bcf, bsf to
> toggle a bit on and off in order to get a feel for what the PIC was
seeing -
> this may or may not be proper code - it was just there for test purposes.
> As to why bit 5 is hung low - not an educated - or even uneducated guess.
> As I told my wife - I feel sort of like a guy who jumps out of an
airplane -
> his chute does not open and he radios for help.  The people on the ground
> get into a long winded discussion about what kind of handle he has on his
> rip cord and why it should be something else - never addressing the real
> problem.  Sorry if I sound aggravated - I guess I was really hoping
someone
> had the answer as to why bit 5 is being held low instead of seeing
> discussion on my use of bcf, bsf.

Sounds like you got everything you paid for.

I can't speak for others, but I didn't answer because your message was long
and it looked like it would take more time than I wanted to devote to
figuring it out.  Nothing personal, but I do have real paying customers to
take care of.


*****************************************************************
Embed Inc, embedded system specialists in Littleton Massachusetts
(978) 742-9014, http://www.embedinc.com

--
http://www.piclist.com hint: The PICList is archived three different
ways.  See http://www.piclist.com/#archives for details.


2002\04\04@082516 by David V. Fansler

picon face
Thanks Jeff - I have tried it with two chips - same result.

David V. Fansler
S/V Annabelle
DFanslerspamKILLspamMindSpring.com
http://www.dv-fansler.com

{Original Message removed}

2002\04\04@082520 by David V. Fansler

picon face
HS mode, 20 Mhz

David V. Fansler
S/V Annabelle
.....DFanslerKILLspamspam.....MindSpring.com
http://www.dv-fansler.com

-----Original Message-----
From:   pic microcontroller discussion list [EraseMEPICLISTspam_OUTspamTakeThisOuTMITVMA.MIT.EDU]
On Behalf Of David Duffy
Sent:   Thursday, April 04, 2002 12:02 AM
To:     PICLISTspamspam_OUTMITVMA.MIT.EDU
Subject:        Re: [PIC]:16F873 PortC bit 5 revisited - the death of!

At 10:59 PM 03/04/2002 -0500, you wrote:
>Dear PicList - I sent this email out yesterday asking why, or what I am
>doing that would cause port c bit 5 to be pulled low internally to the
chip.
>The ensuing discussion has branched off to my use of using bcf, bsf to
>toggle a bit on and off in order to get a feel for what the PIC was
seeing -
>this may or may not be proper code - it was just there for test purposes.
>As to why bit 5 is hung low - not an educated - or even uneducated guess.
>As I told my wife - I feel sort of like a guy who jumps out of an
airplane -
{Quote hidden}

the
{Quote hidden}

What speed crystal or resonator are you using?
If it's 4MHz, use XT_OSC mode.

{Quote hidden}

0->Hold/Cont
{Quote hidden}

IIRC, you can't have a colon in the middle of a label.

{Quote hidden}

--
http://www.piclist.com hint: The list server can filter out subtopics
(like ads or off topics) for you. See http://www.piclist.com/#topics

--
http://www.piclist.com hint: The PICList is archived three different
ways.  See http://www.piclist.com/#archives for details.


2002\04\04@141054 by Barry Gershenfeld

picon face
>...I feel sort of like a guy who jumps out of an airplane -
>his chute does not open and he radios for help.  The people on the ground
>get into a long winded discussion about what kind of handle he has on his
>rip cord and why it should be something else - never addressing the real
>problem.

Hmmm, I guess you aren't aware of where Engineers get their reputation...

Truth is, I was watching as the discussion ranged around as you described,
yet I was waiting for some reply from you to say what you might have
tried so far.   Also I may have erred in assuming you'd had a lot of
experience with PICs; after all, you were on this list back when I
joined it.  So I didn't even mention the bcf thing.  Others did.
It got too detailed.

In short, there is a syndrome (here I carefully avoid the bug/feature
discussion)  wherein you can shoot yourself in the foot.  You may
be the one who is setting that pin low, and not know why.  It is
directly connected to the bcf PORT instruction.

My suggestions were designed to get you past all the "maybe you
have a bad chip" type questions you would inevitably be
receiving.

The question remains: Can you get that pin to float, in your
circuit, under ANY circumstances?

Strip the code to setup the port all as all inputs, and
then go into a loop.  If that works, put back in the
some-in-and-some-outs setting for TRIS.  Keep adding
stuff until it breaks again.

HTH...Barry

--
http://www.piclist.com hint: The PICList is archived three different
ways.  See http://www.piclist.com/#archives for details.


2002\04\04@161632 by David V. Fansler

picon face
David V. Fansler
S/V Annabelle
@spam@DFanslerKILLspamspamMindSpring.com
http://www.dv-fansler.com

-----Original Message-----
From:   pic microcontroller discussion list [KILLspamPICLISTKILLspamspamMITVMA.MIT.EDU]
On Behalf Of Olin Lathrop
Sent:   Thursday, April 04, 2002 8:08 AM
To:     RemoveMEPICLISTTakeThisOuTspamMITVMA.MIT.EDU
Subject:        Re: [PIC]:16F873 PortC bit 5 revisited - the death of!

> Dear PicList - I sent this email out yesterday asking why, or what I am
> doing that would cause port c bit 5 to be pulled low internally to the
chip.
> The ensuing discussion has branched off to my use of using bcf, bsf to
> toggle a bit on and off in order to get a feel for what the PIC was
seeing -
> this may or may not be proper code - it was just there for test purposes.
> As to why bit 5 is hung low - not an educated - or even uneducated guess.
> As I told my wife - I feel sort of like a guy who jumps out of an
airplane -
> his chute does not open and he radios for help.  The people on the ground
> get into a long winded discussion about what kind of handle he has on his
> rip cord and why it should be something else - never addressing the real
> problem.  Sorry if I sound aggravated - I guess I was really hoping
someone
> had the answer as to why bit 5 is being held low instead of seeing
> discussion on my use of bcf, bsf.

Sounds like you got everything you paid for.

I can't speak for others, but I didn't answer because your message was long
and it looked like it would take more time than I wanted to devote to
figuring it out.  Nothing personal, but I do have real paying customers to
take care of.


*****************************************************************
Embed Inc, embedded system specialists in Littleton Massachusetts
(978) 742-9014, http://www.embedinc.com

--
http://www.piclist.com hint: The PICList is archived three different
ways.  See http://www.piclist.com/#archives for details.


To: Olin "Deathdrop"

My husband sent the request for help.  He is at work now so I would like to
respond as I would, not he.  It appears that money is more important to you
than helping another.  I hope there never comes a time that you need help
(if you do not you will be the first) and the response you receive is "I do
not have time for you, money is more important". We reap what we sew.

You probably do not know the answer anyway.  Pitiful cover-up.

Madlyn

--
http://www.piclist.com hint: The PICList is archived three different
ways.  See http://www.piclist.com/#archives for details.


2002\04\04@165928 by David Duffy

flavicon
face
David F wrote:
>HS mode, 20 Mhz

It is a -20 speed chip isn't it? (sounds dumb but has been done before!)
Try just doing the bit tests on the port directly and see how you go.
The code looks like it should work but you are assuming that it gets to
the scan routines at some point. Change it to just toggle RC3 in the main
loop instead and see if that works. Don't make too many assumptions! :-)
Regards...

--
http://www.piclist.com hint: The PICList is archived three different
ways.  See http://www.piclist.com/#archives for details.


2002\04\04@181006 by Olin Lathrop

face picon face
> To: Olin "Deathdrop"
>
> My husband sent the request for help.  He is at work now so I would like
to
> respond as I would, not he.  It appears that money is more important to
you
> than helping another.  I hope there never comes a time that you need help
> (if you do not you will be the first) and the response you receive is "I
do
> not have time for you, money is more important". We reap what we sew.

Look, Madlyn spamBeGoneDFanslerspamBeGonespamMINDSPRING.COM, you are way out of line.  I can see
you will find this hard to believe, but I am not your personal consultant.
I and everyone else on this lists who choses to answer questions does it on
their own time.  I don't owe you anything, including an explanation of why I
chose not to respond.  Nobody has the time to respond to all questions, so
we all have to pick which questions to answer.  Some factors that enter into
this decision are:

1  -  Is the question easy and quick to read?

2  -  Do I know the answer (assuming the question was easy and quick enough
to read)?  If not, how long might it take to find the answer?

3  -  Has the poster tried reasonable ways to find the answer himself, or is
he expecting me to do all the work for him?

4  -  Has some care been taken in asking the question?  People who write
like a mess usually think like a mess.  Answering a question to someone like
that is a waste of time.

In your case the question just seemed to long and I had urgent things to do.
This was not meant as an insult, only a reflection of the fact that my time
is finite and there isn't enough of it to do all things I and others would
like me to do.  I even took the trouble of explaining this.

> You probably do not know the answer anyway.  Pitiful cover-up.
>
> Madlyn

As I already said, I don't even know the question since I didn't have time
to read it.  What is pitiful is insulting someone because they didn't donate
their time to just you personally.


*****************************************************************
Embed Inc, embedded system specialists in Littleton Massachusetts
(978) 742-9014, http://www.embedinc.com

--
http://www.piclist.com hint: The PICList is archived three different
ways.  See http://www.piclist.com/#archives for details.


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