Connect with us

How to tell if my Pic16f84a is dead

Discussion in '8bit Microcontrollers' started by ChronoFish, Feb 3, 2004.

Scroll to continue with content
  1. ChronoFish

    ChronoFish Guest

    Hi there,

    I have rigged up a pic on a bread board and I am not getting much response.

    I can put a scope on osc2 and see a nice waveform - but nothing on osc1 (should I be able to?). This is a pic16f84a-20/p which I am
    assuming means it will operate up to 20MHz - I'm using a 4MHz crystal.

    The code works in my debugger which simply does the following:

    If portb > 0 turn on everything on porta
    if portb > 3 turn off everything on porta

    WHAT SHOULD HAPPEN:
    So with an input on portb pin 0 or 1 my LEDs should light
    If lit, an input on portb pin 2 or higher should turn off the LEDs
    If not lit, an input on portb pin 2 or higher should flash the LEDs 1 time

    WHAT DOES HAPPEN:
    The reality is that touching portb on any pin with +5v does nothing.
    Touching physical pin 4 (the MCLR) turns on porta.


    Any ideas?
    Thanks!
    CF
     
  2. ChronoFish

    ChronoFish Guest


    Nothing like being able to answer your own questions:
    1. No it was not dead.
    2. You can only watch the OSC on OSC2
    Don't know why exactly...
    3. You can use a slower OSC than the rated speed
    obviously you only go as fast as the OSC you choose
    4. I needed to tie the reset (MCLR) to Vdd and did so via a 100R
    Still not 100% clear on this, but Myke Predko suggests it in his book
    5. Each of my inputs needed to be tied to ground and did so via a 100R
    5V turn the pin on, but removing it does not turn it off - something
    needs to turn it off and connecting it to ground does this.
    6. Thank god the 16f84 series is EEPROM - the perfect chip for a software guy.


    -CF
     
  3. OSC1 is high impedance (it's an "input" not an "output"), your scope
    probe loads it too much and stops the oscillator.
    It's the /RESET pin for the chip, effectively. Hold it low and the
    chip does nothing.
    They are like little capacitors- you need to charge and discharge
    them.
    The 16F628 is better for less $$.


    Best regards,
    Spehro Pefhany
     
  4. It is generally a bad idea to leave inputs open (i.e. not connected).
    This does only work on old standard TTL parts (which than act as if
    the input is +5V).

    CMOS chips may even be damaged by static electricity if inputs are
    left floating. In addition, power dissipation can increase
    substantialy if inputs are at switching threshold.

    However, most microcontrollers (in particular the PIC-series, IIRC)
    have built-in pullup resistors on the _port_-pins. These can be
    switched on by software. If you want to play safe use external
    pull-up resistors (i.e. resistors to +5V). 10k should be enough (see
    below)

    The usual way to connect pushbuttons is to pull the inputs to +5V with
    resistors. Then connecting the switch to GND. So pushing the button
    will force the input low. Of course, there is current floating
    through the resitor while the button is pressed, so don't use low
    values for the resistor.

    It is a very bad idea to switch between GND and +5V with the
    pushbutton. When you press the button it will not be connected for a
    short time.

    Have fun
    Jan-Hinnerk
     
  5. Dingus

    Dingus Guest

    .... it won't wake up.


    (should I be able to?). This is a pic16f84a-20/p which I am
     
Ask a Question
Want to reply to this thread or ask your own question?
You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.
Electronics Point Logo
Continue to site
Quote of the day

-