trouble with my 16f84a


Closed Thread
Results 1 to 27 of 27

Hybrid View

  1. #1
    Join Date
    Nov 2008
    Location
    Columbus, OH, USA
    Posts
    12


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by mackrackit View Post
    Have you tried a different pin another LED?
    I do not see anything wrong with the part of your code you have posted.
    How do you have TRISB set?
    If you post the whole code it would help.


    That's actually the entirety of the code(although I set TRISB to 0 anyway).Not much to it.Also the oscillator setting is set for crystal.(xt).I tried it with a different pin and came up with the same problem.When I took the LED away from pin 6(rb0) however, the other lit up.

    I'm wondering if it may be a power supply problem.I've currently got a 7805 voltage regulator to step down a 9 volt battery, but I'm wondering if the battery is too low.

    The battery rates at 7.97 volts according to my meter.Could this be too low after the 7805 is connected?

    Shawn

  2. #2
    Join Date
    Nov 2003
    Location
    Wellton, U.S.A.
    Posts
    5,924


    Did you find this post helpful? Yes | No

    Default

    PicBasic will defualt to 4MHz. So if your crystal is running at 4 then you should be OK.
    I think it is a good idea to leave nothing to chance and define it at all times.
    Code:
    DEFINE OSC 8 'Speed of OSC
    I also think it is better to set each bit of TRIS?.
    0 = Outpuit
    1 = Input
    Code:
    TRISB = $00000000
    While you are brushing up on things, these two threads are a must read.
    Even if you do not set the fuses in code space this will give you a better understanding of how it all works.
    http://www.picbasic.co.uk/forum/showthread.php?t=543
    The chip you are using has analog.
    http://www.picbasic.co.uk/forum/showthread.php?t=561

    Power supply.
    9 volt battery is to wimpy. Better off to use a pack of AA if you want to run off batteries.
    Check the data sheet of the 7805 to find minimum voltage. At least 2 volt higher than out put.
    Dave
    Always wear safety glasses while programming.

  3. #3
    Join Date
    Nov 2008
    Location
    Columbus, OH, USA
    Posts
    12


    Did you find this post helpful? Yes | No

    Default

    I looked at the melabs datasheet and it says that I do not have analog pins. I'm not go to dismiss the possibility that I misunderstood though
    I also looked at the info on the configuration fuses, and while it's pretty cool to be able have access to those, I'm positive I would just be digging my self a larger and more frustrating hole.
    Any other ideas what could be the problem? I'm stumped.

  4. #4
    Join Date
    Nov 2003
    Location
    Wellton, U.S.A.
    Posts
    5,924


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by cavity creep View Post
    I looked at the melabs datasheet and it says that I do not have analog pins. I'm not go to dismiss the possibility that I misunderstood though
    My mistake, dirty glasses

    I would say try a better power supply. Is there a way to pull power from the EPIC?
    Dave
    Always wear safety glasses while programming.

  5. #5
    Join Date
    Nov 2008
    Location
    Columbus, OH, USA
    Posts
    12


    Did you find this post helpful? Yes | No

    Default

    Not that I know of.At least I don't think so. I tried another power supply(some aa's) , but to no avail. I'm wondering if the programmer is not setting the pin high as intstructed. Could this be a problem with the EPIC or perhaps a bad cable? Is there any way to test the programmer(or the chips for that matter) for a defect?
    If anyone needs me, I'll be staring blankly at this breadboard with with contempt.
    Thanks,
    Shawn

  6. #6
    Join Date
    May 2004
    Location
    NW France
    Posts
    3,653


    Did you find this post helpful? Yes | No

    Unhappy

    Hi, Shawn

    Did you also think to tie the MCLR pin to V+ ???

    some details about Hardware are not too much nor ... YOUR scheme will be perfect.

    ...

    Alain
    ************************************************** ***********************
    Why insist on using 32 Bits when you're not even able to deal with the first 8 ones ??? ehhhhhh ...
    ************************************************** ***********************
    IF there is the word "Problem" in your question ...
    certainly the answer is " RTFM " or " RTFDataSheet " !!!
    *****************************************

  7. #7
    Join Date
    Nov 2008
    Location
    Columbus, OH, USA
    Posts
    12


    Did you find this post helpful? Yes | No

    Default

    Hi Alain. Yes it's definitely tied to positive.I'm actually getting power throughout the chip, only little or no power to the portb pins for some reason.
    I was wondering if this was an intermittent kind of problem initially, because I would get at least one LED to blink and then none at all.But two different PICs with the same problem? Also different power supplies seem to be ineffective.

    As far as the circuit goes, I can't find a diagram right now to post(about to head out for the afternoon), but I'll try to give you a breakdown.

    pin 4= POSITIVE with 47k resistor

    pin 5= NEGATIVE

    PIN 6 AND 7= LEDs with 470 ohm resistors(and yes, the polarity is correct)

    pin 14 =positive

    pin 15 and 16 =crystal with two 22 pf caps attached to ground

    If you see something I've done wrong, please feel free to let me know.Frankly I'm baffled.

Similar Threads

  1. Code works on 16F84A but not on 16F88?
    By pharaohamps in forum mel PIC BASIC Pro
    Replies: 7
    Last Post: - 6th November 2009, 18:29
  2. MCLR causing trouble . .
    By shahidali55 in forum General
    Replies: 10
    Last Post: - 21st December 2007, 12:20
  3. ICSP using a 16F84a to program 24CXX
    By aftab in forum mel PIC BASIC
    Replies: 26
    Last Post: - 8th April 2007, 11:39
  4. 16F84A and Optrex LCD
    By coyotegd in forum mel PIC BASIC Pro
    Replies: 3
    Last Post: - 17th October 2005, 16:08
  5. RS 485 using 16F84A
    By ngeronikolos in forum mel PIC BASIC Pro
    Replies: 1
    Last Post: - 18th May 2005, 14:46

Members who have read this thread : 0

You do not have permission to view the list of names.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts