'16C84 RA4 Question.'
|Is there a trick to make the RA4 pin on a 16C84 an output.
I have the PIC connected to an 8 BIT ADC, if I read the ADC and
then send a HI to either RA0 throught to RA3, depending on
the value recieved from the ADC,
0 to 63 = HI on pin RA0 only.
64 to 128 = HI on pin RA1 only.
129 to 191 = HI on pin RA2 only.
192 to 255 = HI on pin RA3 only.
everything works fine, BUT when I try and use RA4 as well,
0 to 50 = HI on pin RA0 only.
51 to 100 = HI on pin RA1 only.
101 to 150 = HI on pin RA2 only.
151 to 200 = HI on pin RA3 only.
201 to 255 = HI on pin RA4 only.
everything works fine UNTIL the value from the ADC is in the
201 to 255 range and the RA4 pin changes from the LOW to an
open state, neither HI or LOW, but it seems to work right in
MPLAB simulator. If it matters I am using a 4Mh crystal and
only set the Power Up Timer fuse. I am sure the port is
initialised for output and MPLAB simulator also shows this.
(-; Why are there flotation devices under plane seats
instead of parachutes?
PS. I am fairly new to programming and this is only my second
PIC program.I actually wrote it in a language called SIL,
similar to Pascal/Basic. Thanks Lars Silen for this Free Software.
I also used a love my Logic probe from Peter Anderson:
you get a PIC 12C508 or 509 that is hooked to an LED that is lit
brighty when probe is connected to HI, off when connected to LOW,
and dimly when not connected to either, and pulses when on a
pulsing line. It also has two clock output pins, a once a second
and a 10 a second clock output. I ran my 16C84 off of these and
could count the pulses being sent to my ADC.(could count 7 IO/CLK
pulses to ADC when I should have been sending 8, Doh!).
Dean <MITVMA.MIT.EDU> wrote: PICLIST
> Is there a trick to make the RA4 pin on a 16C84 an output.
> [When I write a 1 to PORTA.4,] the RA4 pin changes from the LOW to an
> open state, neither HI or LOW
That's how the RA4 pin works; it's an open-collector output, so if
you want it to go high, you need to put a pullup resistor (10K works
fine) on it.
=== Andrew Warren - ix.netcom.comfastfwd
=== Fast Forward Engineering - Vista, California
In a message dated 14/12/97 03:44:16, you write:
<< Is there a trick to make the RA4 pin on a 16C84 an output. >>
Easy you need a pull up resistor as RA4 is open drain output and there is also
no diode to VCC internaly cause its used for programing the chip.
From: Dean <SINESURF.CO.NZ> deanz
To: MITVMA.MIT.EDU < PICLISTMITVMA.MIT.EDU> PICLIST
Date: Saturday, December 13, 1997 22:22
Subject: 16C84 RA4 Question.
Yes there is, the RA4 pin when in output mode only is capable of pulling
a line low, it has no transistor (or whatever) for pulling the line high
(BTW great for I2C). To get a high, connect a 10k (value not critical) to
RA4 and VCC, then you should get the right logic out of it. TTYL
More... (looser matching)
- Last day of these posts
- In 1997
, 1998 only
- New search...