Problem


Closed Thread
Results 1 to 7 of 7

Thread: Problem

  1. #1

    Default Problem

    PIC16F628A, RB4 does nothing, no matter what. Changed programs from simple to complex many times. Tried 3 different ICs and still nothing. All other ports work OK. What else could be wrong?

    main:

    high portb.4
    pause 500
    low portb.4
    pause 500
    goto main

  2. #2
    Join Date
    Jan 2008
    Location
    Sweden
    Posts
    187


    Did you find this post helpful? Yes | No

    Default

    Try to add this in the beginning of your program

    CMCON = 7

    And read the PBP manual page 10, 2.5.1
    If it still does´t work, check the config bits.
    Last edited by Fredrick; - 15th January 2009 at 20:45.

  3. #3
    Join Date
    Jul 2003
    Location
    Colorado Springs
    Posts
    4,959


    Did you find this post helpful? Yes | No

    Default

    It could be the LVP (Low Voltage Programming).

    Try adding ...
    Code:
    @  DEVICE  LVP_OFF
    But then, that is a PBP default, so it should already be there.
    <br>
    DT

  4. #4
    Join Date
    Apr 2005
    Location
    Virginia
    Posts
    65


    Did you find this post helpful? Yes | No

    Default

    StoneColdFuzzy,

    Could you post all your code up to your main routine? If we could see what intializations you've done, we might be able to better help. I assume you've set your TRISD register for pin 4 as an output. That leaves comparator pins, which Fredrick addressed, and possibly analog pins - sorry, I don't have the datasheet right in front of me. I'll also make the assumption that you've doubled-checked your wiring. That cost me a mistake for the longest time this week as Darrel can atest to.

  5. #5
    Join Date
    Aug 2006
    Location
    Look, behind you.
    Posts
    2,818


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by StoneColdFuzzy View Post
    PIC16F628A, RB4 does nothing, no matter what. What else could be wrong?
    Could be a breadboard problem, could be you have mistaken which pin is RB4 (I have done that), could be an inverted polarity LED you are using or a bad one or open resistor or other wiring error. Without seeing the breadboard and the exact code we are shooting in the dark.
    If you do not believe in MAGIC, Consider how currency has value simply by printing it, and is then traded for real assets.
    .
    Gold is the money of kings, silver is the money of gentlemen, barter is the money of peasants - but debt is the money of slaves
    .
    There simply is no "Happy Spam" If you do it you will disappear from this forum.

  6. #6


    Did you find this post helpful? Yes | No

    Default

    You'd think after 5 years of doing this I'd know to watch the config bits, One wrong click was all it took. It was in fact the LVP. Thanks for the replies!

    That was the whole main routine that I had last tried. I cut everything else out to work on the problem.

    Damn, I feel silly.

    ~ Dave

  7. #7
    Join Date
    Aug 2006
    Location
    Look, behind you.
    Posts
    2,818


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by StoneColdFuzzy View Post

    Damn, I feel silly.

    ~ Dave
    We have all been there Dave.
    If you do not believe in MAGIC, Consider how currency has value simply by printing it, and is then traded for real assets.
    .
    Gold is the money of kings, silver is the money of gentlemen, barter is the money of peasants - but debt is the money of slaves
    .
    There simply is no "Happy Spam" If you do it you will disappear from this forum.

Similar Threads

  1. problem using GOSUB under interrupt
    By fobya71 in forum mel PIC BASIC Pro
    Replies: 10
    Last Post: - 5th March 2010, 19:52
  2. USART Problem , but don't know where, in pc? or in PIC?
    By precision in forum mel PIC BASIC Pro
    Replies: 0
    Last Post: - 15th July 2007, 08:12
  3. Microcode Studio 18f2455 problem?????
    By volkan in forum mel PIC BASIC Pro
    Replies: 11
    Last Post: - 21st May 2007, 21:04
  4. Hardware problem or what ?
    By Steve S. in forum mel PIC BASIC Pro
    Replies: 8
    Last Post: - 4th March 2007, 21:39
  5. 1 slave 1 master 1 MAX232 1 problem ?
    By SuB-ZeRo in forum mel PIC BASIC Pro
    Replies: 19
    Last Post: - 31st July 2005, 22:59

Members who have read this thread : 1

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