16f84a ra4/tock1

Discussion in 'The Projects Forum' started by clwhitt, Jan 15, 2012.

  1. clwhitt

    Thread Starter New Member

    Dec 23, 2009
    16
    0
    I'm working on teaching myself how to program the PIC family of microcontrollers and have run across a simple question that the datasheet is not answering for me.
    On the 16F84A, RA4/TOCK1 is not going high when I send it the signal (no problem with RA0-RA3). Given that this is a TTL/ST multiplexed pin, do I need to setup another register (OPTION_REG?) so that this can be used as a true output (TRISA is already set as 00h)? Or is this an input only pin?

    Thanks,
    Chuck

    "Prayers for Sgt. Wookie"
     
  2. Markd77

    Senior Member

    Sep 7, 2009
    2,803
    594
    RA4 on the 16F84A is an open drain output. It can sink current but not source it, so if you want to test it, put a 1K resistor from the pin to 5V and then measure.
     
    clwhitt likes this.
  3. atferrari

    AAC Fanatic!

    Jan 6, 2004
    2,648
    762
    Or put a LED with a 270 Ohms limiting resistor and you could see what is going on.

    Anode of the LED to +5V and cathode to resistor. Resitor to pin.
     
    Last edited: Jan 15, 2012
    clwhitt likes this.
  4. clwhitt

    Thread Starter New Member

    Dec 23, 2009
    16
    0
    OK, I do remember seeing somewhere that it was a source drain, but I didn't quite understand what that meant. Now I do.
    So I did hook it up as atferrari suggested, and the result is that it is an inverted output to the LED. Cool. A slight modification to the code, and PortA is sequencing as intended.
    One other question, why aren't my friends and family impressed? Don't they understand what I just accomplished? :)

    Thanks again,
    Chuck

    "Prayers to Sgt. Wookie."
     
  5. atferrari

    AAC Fanatic!

    Jan 6, 2004
    2,648
    762
    RA4 is "open drain". Reread the manual.

    As far as I know there is no glamour in this hobby, just intimate satisfaction. A long way with that, but nothing that could help in picking up girls.

    Be ready to hear (if not answer) the question: what is that good for?

    My most impressive achievements I always celebrated them alone.

    The next to know: when you post about them here, be prepared to people just finding the wrong side of what you say and eventually "I did that before".

    We call that locally "pinchar el globo", something like "explode the balloon".

    It is your hobby. Just enjoy and forget the public.
     
    Last edited: Jan 16, 2012
  6. clwhitt

    Thread Starter New Member

    Dec 23, 2009
    16
    0

    RTFM, yup, I've heard that before. And I actually did read it again after you guys set me straight. The clearest thing I found in doing so? I've got a lot to learn (the nomenclature is the first barrier to cross).

    I've been posting online since way before there was a World Wide Web, I've found more ways than you can imagine to convey the wrong message, and have taken my share of the heat over those misunderstandings.

    Now that's funny.
    Not laughing at you, though, su ingles es mucho mejor de mi espanol. Pero me gusto mucho a hablar en espanol.

    Gracias,
    Chuck
     
  7. atferrari

    AAC Fanatic!

    Jan 6, 2004
    2,648
    762
    If you check my posts, it seems that my spelling is "wrogn" quite frequently...

    ;)

    Siga insistiendo. Lo lograrás.

    Good luck.
     
  8. spinnaker

    AAC Fanatic!

    Oct 29, 2009
    4,884
    1,001
    I don't know where you have been hanging out but I have developed a whole stable of beautiful female electronic groupies. You should see them swoon when I talk about the 18F family of Pics! To the Op, move on up to the 18F family of Pics and the ladies will be breaking down your door. I think there is a guarantee on the Microchip somewhere. I'll see if I can post a link if I find time to look for it. But got to go now one of my women is knocking at the door.
     
    Georacer likes this.
Loading...