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

    Default trouble with my 16f84a

    Hello, I've gotten to dabbling with some old pics that I've had stashed away this holiday, and I am experiencing something strange with one of the ports.I'll
    try to make the scenario as clear as possible.

    I'm going through the old "Pic Robotics" book by John Iovine. I haven't tinkered with PIC stuff in a year or two so I figured it would be a good idea to test them with the simple "wink" program using 2 LEDS. I won't post the actual tech drawing here as I'm sure most of you are familiar with it. In any case, only one LED is blinking(rb0).The other(rb1) isn't doing anything.

    I've read the PICs and went over the circuit several times and still can't figure out whats going on.I've also programmed two different pics, but I get the same result each time.I'm using the EPIC Plus if that helps at all. Does anyone have any idea what I could be doing wrong?

    Here's the code in case someone sees something I'm missing.Thanks for looking!

    Shawn

    start:
    high portb.0
    low portb.1
    pause 500
    low portb.0
    high portb.1
    pause 500
    goto start

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


    Did you find this post helpful? Yes | No

    Default

    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.
    Dave
    Always wear safety glasses while programming.

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


    Did you find this post helpful? Yes | No

    Question

    Hi,

    What about your oscillator settings ???

    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 " !!!
    *****************************************

  4. #4
    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

  5. #5
    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.

  6. #6
    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.

  7. #7
    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.

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