Searching \ for '[PIC]: weird I/O 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/ios.htm?key=i%2Fo
Search entire site for: 'weird I/O problem'.

Exact match. Not showing close matches.
PICList Thread
'[PIC]: weird I/O problem'
2001\10\13@174808 by Dennis Noordsij

flavicon
face
Heips,

I am using a PIC16F877 and am stuck with a strange problem, which I hope is
due to a mistake on my part rather than a broken PIC.

Summary:

       bsf   STATUS, RP0       ; Use register bank number 1

       movlw b'10000110'       ; Set port A as digital I/O
       movwf ADCON1            ;  instead of ADC

       movlw b'00000000'       ; All pins set to output
       movwf TRISA             ;  on port A

       movlw   H'FF'           ; Assert all pins
       movwf PORTA             ; on port A

I upload it to the chip using a bootloader and serial connection, and reset
the circuit.

All pins on port A now measure 5.00 volts between them and GND, EXCEPT for
pin 4 (RA4/T0CKL), which measures something between 0.8 and 3.3 volts.

Usually I would blame this on a connection problem somewhere, but now I am
using a breadboard and the pin in question is not connected to anything
(neither are the other port A pins).

Maybe it has something to do with the timer associated with that pin? I have
tried some different configurations, and each one got a different voltage,
but never the normal +5V.

What do I need to do (starting with the default startup configuration) in
this case, using the PIC16F877 @ 4 MHz with a crystal oscillator using the
following config word:
_CP_OFF
_WDT_OFF
_BODEN_ON
_PWRTE_ON
_XT_OSC
_WRT_ENABLE_ON
_LVP_OFF
_DEBUG_OFF
_CPD_OFF

Hope the chip is ok :-)
Thanks for any pointers,
Kinds regards
Dennis Noordsij

--
http://www.piclist.com hint: To leave the PICList
spam_OUTpiclist-unsubscribe-requestTakeThisOuTspammitvma.mit.edu


2001\10\13@175215 by Dennis Noordsij

flavicon
face
Sorry for the follow-up

Does it sound like an obvious case of floating-pin-syndrome? I haven't yet
made sure all pins are going somewhere (testing incrementally is easier this
way), but is it still strange only pin RA4 has this problem?


In a faraway galaxy, Dennis Noordsij wrote on Sunday 14 October 2001 00:50 :
{Quote hidden}

--
http://www.piclist.com hint: To leave the PICList
.....piclist-unsubscribe-requestKILLspamspam@spam@mitvma.mit.edu


2001\10\13@180804 by PY2NI

flavicon
face
   Hi Dennis!

   I'm not sure but I believe RA4 is an open colector output, so you need
some sort of pull up resistor.

Regards
Hamilton Horta

{Original Message removed}

2001\10\13@180818 by Ned Konz

flavicon
face
On Saturday 13 October 2001 02:50 pm, Dennis Noordsij wrote:

> All pins on port A now measure 5.00 volts between them and GND, EXCEPT for
> pin 4 (RA4/T0CKL), which measures something between 0.8 and 3.3 volts.
>
> Usually I would blame this on a connection problem somewhere, but now I am
> using a breadboard and the pin in question is not connected to anything
> (neither are the other port A pins).

As described in the data sheet, this pin has an open drain output, and would
require a pullup resistor if you need a high voltage (though it could sink
current fine by itself).

--
Ned Konz
currently: Stanwood, WA
email:     nedspamKILLspambike-nomad.com
homepage:  http://bike-nomad.com

--
http://www.piclist.com hint: To leave the PICList
.....piclist-unsubscribe-requestKILLspamspam.....mitvma.mit.edu


2001\10\13@182718 by Josh Koffman

flavicon
face
I might be totally wrong here, but here's my off the top of my head, no
paperwork in front of me, semiguessing response. First, your summary
didn't show you switching back to bank 0. I am pretty sure the porta
register is in bank 0. Second, I think pin 4 might be open collector. I
think this would mean that it can sink but not source current. I could
be wrong though. Best bet is to check the datasheet at
http://www.microchip.com.

Hope this helps,

Josh Koffman

Dennis Noordsij wrote:
{Quote hidden}

--
http://www.piclist.com hint: To leave the PICList
piclist-unsubscribe-requestspamspam_OUTmitvma.mit.edu


2001\10\13@192515 by Dennis Noordsij

flavicon
face
On Sunday 14 October 2001 01:13, you wrote:
>     Hi Dennis!
>
>     I'm not sure but I believe RA4 is an open colector output, so you need
> some sort of pull up resistor.
>
> Regards
> Hamilton Horta
>

Hi,

I am just not too familiar with the open-collector open-drain etc concepts,
the explanation on piclist.com is also a bit cryptic (for me anyway :)

I put a 10k resister between RA4 and VDD, and now everything works as
expected :-)

Does anyone have a pointer to somewhere I can learn a little more about these
concepts? My background is programming (which is why I got interested in the
PIC's) and not electronics (which I am learning as I go whenever I want the
PIC to do something new :-)

Thanks again for the quick and great replies, this list is truly a great
source of information.

Thanks again
Dennis

--
http://www.piclist.com hint: To leave the PICList
@spam@piclist-unsubscribe-requestKILLspamspammitvma.mit.edu


2001\10\13@195035 by Kathy Quinlan

flavicon
face
Hi all, Back out of hospital and just living till the next operation :o(

Ok Dennis,

I have not got any online examples at hand, but I can describe it easily.

I  assume that you are familiar with the totem poles of the North American
Indians (IIRC) where they carved heads in to the pole one on top of the
other. Now just look at a pair of heads, Imagine each head is a Transistor
or FET, The top Transistor / FET is tied to Vdd (+5V), and the bottom one is
tied to Vss (0V).the space between the two heads (transistors / FETs) is
where we take our output. Inside the chip behind out totem pole is some
logic to provide the signal for the output, but also a complimentary
(inverted) signal, the normal signal goes to the top device (Transistor /
FET) and the complimenty signal goes to the bottom device. A few parts
(resistors, diodes etc) are used to make sure that while the voltage changes
that BOTH devices are not switched on as that would short the +5v to 0V.

When the true signal is a logic 1 (+5V) the out put will be ~+5V (due to
losses in the junctions of the transistor), and the bottom device will be
switched off.

Now if the true signal is 0 the top device is off and the bottom device is
on , causing the output to be pulled low (0V).

As you can see a fair few parts are needed to drive the top device,
compliment the logic, and provide a dead crossover region.

It soon became clear when mixing logic devices, that a totem pole output was
no good, as maybe you needed more than +5V to signal logic high, A cmos
device for example may need 10V but our poor Pic sitting on +5V (and no we
can not give him more voltage in) can not drive the cmos pin to a logic 1
(we would only see 0V and an undefined voltage, both could possibly be
interpreted as a logic 0)

To over come the above problem open collector was designed, Instead of
pulling the output High, we let it float and use an EXTERNAL pull up
resistor to pull the signal to what ever level we like, all we need to watch
is that we do not overload the driving pin by pulling to much current, or
pushing a too higher voltage in.

If you have any further questions, pleas ask :o)

Regards,


Kat.

____________________________________________________________________________
/"\   ASCII Ribbon Campaign  |              K.A.Q. Electronics
\ / - NO HTML/RTF in e-mail | Software and Electronic Engineering
X  - NO Word docs in e-mail  |          Perth Western Australia
/ \                                            |            Ph +61 419 923
731
____________________________________________________________________________


{Original Message removed}

2001\10\14@003126 by Herbert Graf

flavicon
face
> All pins on port A now measure 5.00 volts between them and GND, EXCEPT for
> pin 4 (RA4/T0CKL), which measures something between 0.8 and 3.3 volts.

       RA4 is open collector which means it can only pull a line DOWN, not up to
5V. You have to put a pull up resistor on it for it to function as you want,
however be aware of the value, if it's to low you risk drawing to much from
th PIC, if it's to high you have to be careful about read-modify-write
operations on port A. TTYL

--
http://www.piclist.com hint: PICList Posts must start with ONE topic:
[PIC]:,[SX]:,[AVR]: ->uP ONLY! [EE]:,[OT]: ->Other [BUY]:,[AD]: ->Ads


2001\10\14@064549 by uter van ooijen & floortje hanneman

picon face
> Does anyone have a pointer to somewhere I can learn a little more about
these
> concepts? My background is programming (which is why I got interested in
the
> PIC's) and not electronics (which I am learning as I go whenever I want
the
> PIC to do something new :-)

There are many more subjects you'll want to read about. I suggest you buy
"the art of electronics" (Horowitz & Hill).

Wouter van Ooijen

Van Ooijen Technische Informatica: http://www.voti.nl
Jal compiler for PIC uC's:  http://www.xs4all.nl/~wf/wouter/pic/jal

--
http://www.piclist.com hint: PICList Posts must start with ONE topic:
[PIC]:,[SX]:,[AVR]: ->uP ONLY! [EE]:,[OT]: ->Other [BUY]:,[AD]: ->Ads


2001\10\14@083410 by Olin Lathrop

face picon face
>         bsf   STATUS, RP0       ; Use register bank number 1

Or possibly bank 3 since you didn't set RP1

>         movlw b'10000110'       ; Set port A as digital I/O
>         movwf ADCON1            ;  instead of ADC
>
>         movlw b'00000000'       ; All pins set to output
>         movwf TRISA             ;  on port A
>
>         movlw   H'FF'           ; Assert all pins
>         movwf PORTA             ; on port A

Note that PORTA is in bank 0.


********************************************************************
Olin Lathrop, embedded systems consultant in Littleton Massachusetts
(978) 742-9014, KILLspamolinKILLspamspamembedinc.com, http://www.embedinc.com

--
http://www.piclist.com hint: PICList Posts must start with ONE topic:
[PIC]:,[SX]:,[AVR]: ->uP ONLY! [EE]:,[OT]: ->Other [BUY]:,[AD]: ->Ads


2001\10\14@083413 by Olin Lathrop

face picon face
> I am just not too familiar with the open-collector open-drain etc
concepts,
> the explanation on piclist.com is also a bit cryptic (for me anyway :)

Open drain or open collector outputs can actively pull down but not up.
Another way of looking at this is that they can sink current when programmed
low, but never source any.  This is fine if you are connecting a load
between power and the pin, like and LED and a resistor.


********************************************************************
Olin Lathrop, embedded systems consultant in Littleton Massachusetts
(978) 742-9014, RemoveMEolinTakeThisOuTspamembedinc.com, http://www.embedinc.com

--
http://www.piclist.com hint: PICList Posts must start with ONE topic:
[PIC]:,[SX]:,[AVR]: ->uP ONLY! [EE]:,[OT]: ->Other [BUY]:,[AD]: ->Ads


2001\10\14@201723 by Alexandre Domingos F. Souza

flavicon
face
>> I am just not too familiar with the open-collector open-drain etc
>concepts,
>> the explanation on piclist.com is also a bit cryptic (for me anyway :)
>Open drain or open collector outputs can actively pull down but not up.
>Another way of looking at this is that they can sink current when programmed
>low, but never source any.  This is fine if you are connecting a load
>between power and the pin, like and LED and a resistor.

       Hmmm, maybe a simpler explanation? ;o)

       Imagine an Open Collector or Open Drain output as a switch. One of the poles of the switch, is tied to GND. The other is avaiable to you. If you connect a resistor to +vcc and to this pin, you will measure a HIGH on this pin, but when you "activate" this pin, you'll measure a LOW in this pin. Of course, since one of the sides of the "switch" is tied to ground, you can never use a pull down on it, it will always be GND for you all ;o)


---8<---Corte aqui---8<----

Alexandre Souza
spamBeGonetaitospamBeGonespamterra.com.br
http://planeta.terra.com.br/lazer/pinball/

---8<---Corte aqui---8<----

--
http://www.piclist.com hint: PICList Posts must start with ONE topic:
[PIC]:,[SX]:,[AVR]: ->uP ONLY! [EE]:,[OT]: ->Other [BUY]:,[AD]: ->Ads


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