Cant get my PIC running


Closed Thread
Results 1 to 14 of 14

Hybrid View

  1. #1
    Join Date
    Aug 2008
    Posts
    13

    Default Cant get my PIC running

    Hello,

    I have problem with my new PIC 16f877 controller. I was searching answer to the problem with google and found this site with very friendly people on it so i decided to ask help here even the problem is not picbasic relative. However im going to use picbasic after this problem is fixed.

    Backround:
    Im totally new to microcontrollers and there migth be something obvious that i have missed, so easy suggestions are important too. I have bougth PIC 16f877 controller and made circuit for it. As programmer i use a LVP circuit that seems to work as i can tell: writing a program to it result no errors and when reading the controllers memory, i can see changes in the hex file downloaded.

    Problem:
    As the programming seems to work, next thing i have tried to do is to see if there is some life when i turn power on. For this, i have programmed a assembler program to put a voltage to a pin to measure it with voltage meter or to see connected LED to ligth up.
    (MPLAB)
    LIST p=16f877
    INCLUDE "p16f877.inc"

    __CONFIG _PWRTE_ON & _HS_OSC & _WDT_OFF & _BODEN_OFF

    ORG 0x00
    goto Main

    ORG 0x04
    goto Main

    Main
    BANKSEL TRISB
    bcf TRISB,5 ; i also have tried clrf TRISB without success
    BANKSEL PORTB
    bsf PORTB,5

    Loop NOP
    goto Loop

    end

    No voltage appears on the pin (tried some other pins too). Here is the circuit: http://kuvaton.com/k/Q8m.jpg edit: from RB3 there goes a wire to ground

    I have tested the circuit also with computer powersupply +5V and ground to points A and B in the link above with no success. When tried that, i disconnected stabilization capacitors and the ground pin in the regulator to avoid them to interference.

    I saw some circuits in the web where ceramic capacitors where used in some parts of the circuit. In my circuit all the capacitors are electrolyte capacitors, does this make a difference? Unfortunately i dont have any ceramic versions to test.

    I will be thankful for any suggestion.
    Last edited by Viberer; - 28th August 2008 at 00:32.

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


    Did you find this post helpful? Yes | No

    Default

    Welcome,

    My assembly is really bad, but this might be the problem.
    Code:
    Loop NOP
    goto Loop
    I think it is stuck in a NOP loop.

    Try the PB demo
    http://www.melabs.com/pbpdemo.htm
    Dave
    Always wear safety glasses while programming.

  3. #3
    Join Date
    Aug 2008
    Posts
    13


    Did you find this post helpful? Yes | No

    Default

    Thanks for reply, i tried it but it didnt work In some samples i have seen this kind of infinite loop being used, i dont know why it is there.

  4. #4
    Join Date
    Jul 2003
    Posts
    2,405


    Did you find this post helpful? Yes | No

    Default

    With LVP enabled you need to ground RB3 for normal operation. If this pin is left floating or
    high it thinks the PIC is in programming mode, and will not execute your code.

    Read section 12.17 in your data sheet and look at note 4 in the grey area.
    Regards,

    -Bruce
    tech at rentron.com
    http://www.rentron.com

  5. #5
    Join Date
    Aug 2008
    Posts
    13


    Did you find this post helpful? Yes | No

    Default Still not working

    Quote Originally Posted by Bruce View Post
    With LVP enabled you need to ground RB3 for normal operation. If this pin is left floating or
    high it thinks the PIC is in programming mode, and will not execute your code.

    Read section 12.17 in your data sheet and look at note 4 in the grey area.
    Oh yes, i remember reading that. I tried grounding it then and i forgot it when it didnt help. Now it is grounded again and will be that way but i got still no life from it Thanks for notification

    Im really starting to lose my mind with this chip

  6. #6
    Join Date
    Jul 2003
    Posts
    2,405


    Did you find this post helpful? Yes | No

    Default

    It can definitely be frustrating, but hang-in there...;O}

    Which device programmer are you using?

    Have you programmed another PIC succesfully with this programmer?

    Have you checked every single connection with a volt-meter?

    Have you tried another oscillator?

    A LOT of factors are involved. Even with a simple program like yours just
    making a pin high.
    Regards,

    -Bruce
    tech at rentron.com
    http://www.rentron.com

Similar Threads

  1. pic first build test board not running
    By comwarrior in forum Schematics
    Replies: 11
    Last Post: - 29th June 2009, 16:48
  2. pic to pic ir link versus wired link : help please anyone
    By xnihilo in forum mel PIC BASIC Pro
    Replies: 13
    Last Post: - 30th May 2008, 21:01
  3. Crystal osc running but PIC not using it
    By p15218 in forum mel PIC BASIC Pro
    Replies: 9
    Last Post: - 18th February 2007, 22:33
  4. Pic 16f628a running at lower than 4.5V
    By MegaADY in forum mel PIC BASIC Pro
    Replies: 1
    Last Post: - 10th April 2005, 18:40
  5. Serial Pic to Pic using HSER
    By Chadhammer in forum mel PIC BASIC Pro
    Replies: 5
    Last Post: - 11th March 2005, 23:14

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