+ Reply to Thread
Results 1 to 6 of 6
  1. #1
    Join Date
    May 2016
    Posts
    1

    Smile program runs and stop

    hi i need help, my program runs and stops at a certain line, at PORTA = 0, i.e after TRISC = %00000000 ( checked with the ICD compile). i use pic16f886. what could be the prolem? compiles successfully though.thanksAmber var PORTB.1Good var PORTB.3time_up var PORTB.2Correct var PORTB.0Play var PORTB.5i var bytev var bytepalo var byteleds var wordleds.byte0 = PORTAleds.byte1 = PORTCleds= 0 @ errorlevel -306 ; V_1 var PORTA.0V_2 var PORTA.1V_3 var PORTA.2V_4 var PORTA.3V_5 var PORTA.4V_6 var PORTA.5V_7 var PORTA.6V_8 var PORTA.7V_9 var PORTC.0V_10 var PORTC.1V_11 var PORTC.2V_12 var PORTC.3V_13 var PORTC.4V_14 var PORTC.5V_15 var PORTC.6V_16 var PORTC.7TRISA = %00000000TRISB = %00100001TRISC = %00000000PORTA = 0 'LEDs offPORTB = 0PORTC = 0

  2. #2
    Join Date
    Jan 2005
    Location
    Montreal, Quebec, Canada
    Posts
    2,254

    Default Re: program runs and stop

    Start by editting your post, add CODE tags (click on GO ADVANCED), and then split your lines.

    That will make it easier for people to help.

    Robert

  3. #3
    Join Date
    Mar 2003
    Location
    Commerce Michigan USA
    Posts
    1,196

    Default Re: program runs and stop

    hi i need help, my program runs and stops at a certain line, at PORTA = 0, i.e after TRISC = %00000000 ( checked with the ICD compile). i use pic16f886. what could be the prolem? compiles successfully though.

    thanksAmber var PORTB.1
    Good var PORTB.3
    time_up var PORTB.2
    Correct var PORTB.0
    Play var PORTB.5
    i var byte
    v var byte
    palo var byte
    leds var word
    leds.byte0 = PORTA
    leds.byte1 = PORTC
    leds= 0
    @ errorlevel -306;
    V_1 var PORTA.0
    V_2 var PORTA.1
    V_3 var PORTA.2
    V_4 var PORTA.3
    V_5 var PORTA.4
    V_6 var PORTA.5
    V_7 var PORTA.6
    V_8 var PORTA.7
    V_9 var PORTC.0
    V_10 var PORTC.1
    V_11 var PORTC.2
    V_12 var PORTC.3
    V_13 var PORTC.4
    V_14 var PORTC.5
    V_15 var PORTC.6
    V_16 var PORTC.7
    TRISA = %00000000
    TRISB = %00100001
    TRISC = %00000000
    PORTA = 0 'LEDs off
    PORTB = 0
    PORTC = 0

    From what I can see there is NO program here. Only configurations for the processor. Is this all of the program?
    Dave Purola,
    N8NTA
    EN82fn

  4. #4
    Join Date
    Oct 2005
    Location
    Sweden
    Posts
    3,259

    Default Re: program runs and stop

    Actually this
    Code:
    leds.byte0 = PORTA
     leds.byte1 = PORTC
     leds= 0
    and this
    Code:
    TRISA = %00000000
     TRISB = %00100001
     TRISC = %00000000
     PORTA = 0 'LEDs off
     PORTB = 0
     PORTC = 0
    is "program" but yeah, something's weird.....

    Are you using the ICD in Microcode studio? I don't know how that works exactly but my guess is that a "program" which is just running off into the wild like that probably doesn't work very well with the software debugger since it inserts calls to the "debug engine" between each statement. When there's no more statement there will be no more calls to the debug engine and it'll look like the program stopped.

    If that really IS all of the program then at least add an END statement to it or better yet, for ICD testing purposes, add an endless loop at the bottom
    Code:
    Forever:
      i = i + 1
      Pause 1
    Goto Forever
    /Henrik,

  5. #5
    Join Date
    Jan 2005
    Location
    Montreal, Quebec, Canada
    Posts
    2,254

    Default Re: program runs and stop

    Code:
    @ errorlevel -306;
    What does this do?
    Not as dumb as yesterday, but stupider than tomorrow!

  6. #6
    Join Date
    Nov 2003
    Location
    Wellton, U.S.A.
    Posts
    5,926

    Default Re: program runs and stop

    @ errorlevel -306 ' supress page boundry error
    Dave
    Always wear safety glasses while programming.

Similar Threads

  1. PIC18F45K80 runs way to fast.
    By bmoe79 in forum PBP3
    Replies: 3
    Last Post: - 19th December 2014, 13:24
  2. hardware counting while software runs
    By Archangel in forum mel PIC BASIC Pro
    Replies: 5
    Last Post: - 2nd October 2006, 03:26
  3. Ds1302 Stops are runs slow
    By Kman in forum mel PIC BASIC Pro
    Replies: 2
    Last Post: - 13th June 2006, 02:10
  4. Debug in + Floating pin = stop program execution?
    By jamie_s in forum mel PIC BASIC Pro
    Replies: 1
    Last Post: - 9th November 2005, 08:46
  5. Stop program
    By Sam in forum mel PIC BASIC Pro
    Replies: 2
    Last Post: - 30th March 2004, 14:57

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