Searching \ for '[PIC]: strange output port.' 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=output
Search entire site for: 'strange output port.'.

Exact match. Not showing close matches.
PICList Thread
'[PIC]: strange output port.'
2001\01\04@125141 by RoDelta

flavicon
face
Hi.
I tryed  to use  PIC16C621A, RA4 as output, open drain. I put a 10K resistor
to Vcc and the base of a npn transistor in RA4 to drive a relay (relay
conected on colector with diode self induction protection, and emitter to
zero).
When the port come hight imediately drop to zero and sit there.
I saw that, when the output (in  RA4)drop to any value
<Vdd/2, by external circuit,  this output become to zero and stay in zero
even the value of the
external circuit apply in RA4 return to any value > Vdd/2.
I made a test.
The output is high, and I force pin 3 ( RA4 ) with a
jump to zero. The current is limited by 10K resistor to Vdd. When I remove
this jump the output stays in zero ! Note, by the program this output is
high all the time .
The same test in a PIC16F84 this do not happen (no comparator sets!). The
output come to zero with a jump to zero and return to high when remove this
jump.
Anyone knows why this happen ?
I didn't find nothing in data sheet (16C621A) about it.
My sets:
banc1                                       ;macro to bank 1
MOVLW  b'00000010'           ;Place option reg setup into W
MOVWF  OPTION_REG       ; Set up OPTION register
MOVLW   b'00000011'           ; RA0 and RA1 as intput RA2,3 and 4 as output
MOVWF  TRISA                      ;
banc0                                        ;macro to bank 0
MOVLW  b'00000111'            ;07h comparator off
MOVWF  CMCON
MOVLW  B'10100000'            ; int only to tmr0
MOVWF  INTCON
VRCON, I left by default. (b'00000000')

Did I forgot any set?
TIA
Roberto Locks Guimaraes

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


2001\01\04@140440 by Dan Michaels

flavicon
face
At 03:52 PM 1/4/01 -0200, you wrote:
>Hi.
>I tryed  to use  PIC16C621A, RA4 as output, open drain. I put a 10K resistor
>to Vcc and the base of a npn transistor in RA4 to drive a relay (relay
>conected on colector with diode self induction protection, and emitter to
>zero).

Do you have a resistor between RA4 and the base? If not,
put one in.

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


2001\01\04@150523 by Olin Lathrop

face picon face
> >I tryed  to use  PIC16C621A, RA4 as output, open drain. I put a 10K
resistor
> >to Vcc and the base of a npn transistor in RA4 to drive a relay (relay
> >conected on colector with diode self induction protection, and emitter to
> >zero).
>
> Do you have a resistor between RA4 and the base? If not,
> put one in.

And why should that help?  If it is open drain, then he should be able to
connect the base of the NPN directly to the pin because the current into the
base can only come from the pullup resistor.  Adding an additional series
resistor has no advantage and will slow down the response.


*****************************************************************
Olin Lathrop, embedded systems consultant in Devens Massachusetts
(978) 772-3129, spam_OUTolinTakeThisOuTspamembedinc.com, http://www.embedinc.com

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


2001\01\04@151954 by David VanHorn

flavicon
face
At 03:52 PM 1/4/01 -0200, RoDelta wrote:
>Hi.
>I tryed  to use  PIC16C621A, RA4 as output, open drain. I put a 10K resistor
>to Vcc and the base of a npn transistor in RA4 to drive a relay (relay
>conected on colector with diode self induction protection, and emitter to
>zero).


What's the beta (gain)of the transistor?
You're putting 500uA roughly, into the base. A gain of 100 will give you
50mA collector current. If the relay takes more than that, you don't close.

Measure the voltage across the relay coil, when it's supposed to be energized.

Also, this is a CLASSIC for being bitten by BSF/BCF instructions. The
voltage on the I/O pin will never get to a logic high, so any subsequent
read-mod-write instruction will change that pin into a low output.

You may need to shut the comparator off as well. I'm using RA4 here in an
F627, but I'm turning off the comparator first.


--
Where's dave? http://www.findu.com/cgi-bin/find.cgi?kc6ete-9

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


2001\01\04@155613 by Dwayne Reid

flavicon
face
At 02:37 PM 1/4/01 -0500, Olin Lathrop wrote:
> > >I tryed  to use  PIC16C621A, RA4 as output, open drain. I put a 10K
>resistor
> > >to Vcc and the base of a npn transistor in RA4 to drive a relay (relay
> > >conected on colector with diode self induction protection, and emitter to
> > >zero).
> >
> > Do you have a resistor between RA4 and the base? If not,
> > put one in.
>
>And why should that help?  If it is open drain, then he should be able to
>connect the base of the NPN directly to the pin because the current into the
>base can only come from the pullup resistor.  Adding an additional series
>resistor has no advantage and will slow down the response.

Because of the Read-Modify-Write problem.

The logic level at pin RA4 will never go above 0.7Vdc which reads as a
logic LO under all cases.  Lets say that you did a "bsf RA4" and then did
*ANY* R-M-W operation to port RA.  Voila!  Pin RA4 is now a logic LO.

dwayne



Dwayne Reid   <.....dwaynerKILLspamspam@spam@planet.eon.net>
Trinity Electronics Systems Ltd    Edmonton, AB, CANADA
(780) 489-3199 voice          (780) 487-6397 fax

Celebrating 16 years of Engineering Innovation (1984 - 2000)

* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
Do NOT send unsolicited commercial email to this email address.
This message neither grants consent to receive unsolicited
commercial email nor is intended to solicit commercial email.

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


2001\01\04@175104 by imenez Yamasaki

flavicon
face
   Hi Roberto,

   You MUST use a resistor between RA4 and the base of your transistor...
why? just make a little equation:

   V(RA4) = Ib * Rb + Vbe

   you have Rb = 0, so you are forcing V(RA4) = Vbe (usually 0.7 V)

   Better now?
   I Hope this helps...

   Regards,

   Gonzalo

----- Mensaje original -----
De: "RoDelta" <rodeltaspamKILLspamWNET.COM.BR>
Para: <.....PICLISTKILLspamspam.....MITVMA.MIT.EDU>
Enviado: Jueves 4 de Enero de 2001 12:52 PM
Asunto: [PIC]: strange output port.


| Hi.
| I tryed  to use  PIC16C621A, RA4 as output, open drain. I put a 10K
resistor
| to Vcc and the base of a npn transistor in RA4 to drive a relay (relay
| conected on colector with diode self induction protection, and emitter to
| zero).
| When the port come hight imediately drop to zero and sit there.
| I saw that, when the output (in  RA4)drop to any value
| <Vdd/2, by external circuit,  this output become to zero and stay in zero
| even the value of the
| external circuit apply in RA4 return to any value > Vdd/2.
| I made a test.
| The output is high, and I force pin 3 ( RA4 ) with a
| jump to zero. The current is limited by 10K resistor to Vdd. When I remove
| this jump the output stays in zero ! Note, by the program this output is
| high all the time .
| The same test in a PIC16F84 this do not happen (no comparator sets!). The
| output come to zero with a jump to zero and return to high when remove
this
| jump.
| Anyone knows why this happen ?
| I didn't find nothing in data sheet (16C621A) about it.
| My sets:
|  banc1                                       ;macro to bank 1
|  MOVLW  b'00000010'           ;Place option reg setup into W
|  MOVWF  OPTION_REG       ; Set up OPTION register
|  MOVLW   b'00000011'           ; RA0 and RA1 as intput RA2,3 and 4 as
output
|  MOVWF  TRISA                      ;
|  banc0                                        ;macro to bank 0
|  MOVLW  b'00000111'            ;07h comparator off
|  MOVWF  CMCON
|  MOVLW  B'10100000'            ; int only to tmr0
|  MOVWF  INTCON
| VRCON, I left by default. (b'00000000')
|
| Did I forgot any set?
| TIA
| Roberto Locks Guimaraes
|
| --
| http://www.piclist.com hint: The PICList is archived three different
| ways.  See http://www.piclist.com/#archives for details.
|
|
|

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


2001\01\04@185216 by David VanHorn

flavicon
face
At 05:55 PM 1/4/01 -0500, Gonzalo Jimenez Yamasaki wrote:
>     Hi Roberto,
>
>     You MUST use a resistor between RA4 and the base of your transistor...
>why? just make a little equation:
>
>     V(RA4) = Ib * Rb + Vbe
>
>     you have Rb = 0, so you are forcing V(RA4) = Vbe (usually 0.7 V)

Why do you see this as a problem?
--
Where's dave? http://www.findu.com/cgi-bin/find.cgi?kc6ete-9

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


2001\01\05@110828 by imenez Yamasaki

flavicon
face
| At 05:55 PM 1/4/01 -0500, Gonzalo Jimenez Yamasaki wrote:
| >     Hi Roberto,
| >
| >     You MUST use a resistor between RA4 and the base of your
transistor...
| >why? just make a little equation:
| >
| >     V(RA4) = Ib * Rb + Vbe
| >
| >     you have Rb = 0, so you are forcing V(RA4) = Vbe (usually 0.7 V)
|
| Why do you see this as a problem?

   Maybe is not a big problem, but that why you can4t see positive (high)
level in RA4...

   Regards,

   Gonzalo

--
http://www.piclist.com#nomail Going offline? Don't AutoReply us!
email EraseMElistservspam_OUTspamTakeThisOuTmitvma.mit.edu with SET PICList DIGEST in the body


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