GOTO absolut address - is that possible?


Results 1 to 14 of 14

Threaded View

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


    Did you find this post helpful? Yes | No

    Wink Happy End

    Ok, it's solved

    Code:
    'Defines
    
    DEFINE OSC 4
    
    
    '*****************************************************************************
    '*****************************************************************************
    'Config
    
    'Program Configuration Register 1
    @		__CONFIG    _CONFIG1, _CP_OFF & _CCP1_RB0 & _DEBUG_OFF & _WRT_PROTECT_OFF & _CPD_OFF & _LVP_OFF & _BODEN_OFF & _MCLR_ON & _PWRTE_ON & _WDT_ON & _XT_OSC
    
    'Program Configuration Register 2
    @		__CONFIG    _CONFIG2, _IESO_OFF & _FCMEN_OFF
    
    
    '*****************************************************************************
    Restart:
    
    INTCON 		= %01000000			' RB0 interrupt
    OPTION_REG  = %11000111			' TMR0 pour sous régime PS = 256 ( Rpm = 460 )
    T1CON		= %01010000			' %01000000
    CCP1CON		= %00000101
    PIE1		= %00000100
    
    CMCON 		= 7
    CVRCON 		= 0
    
    ANSEL		= 0
    ADCON0 		= 0
    
    ....
    
    '*****************************************************************************
    '*****************************************************************************
    ' If Program counter lost
    
    @ ORG 4094			' Goto the very last lines ( µP is a 16F88 )
    @ CLRF PCLATH			' right page for 12/16F( lol )
    @ GOTO _Restart 		             ' Go on again !!! ...
    '
    @ END
    Look at the "Restart" Label ... it must be placed before the very first PBP command : here, an " INTCON = " statement.

    The ASM " Init " ( no underscore !!! ) label is automatically placed here by PBP in the .asm generated.

    This way, all the registers are re-set to the convenient values ...
    Last edited by Acetronics2; - 11th November 2008 at 10:40.
    ************************************************** ***********************
    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 " !!!
    *****************************************

Similar Threads

  1. Making a menu
    By chrisshortys in forum mel PIC BASIC Pro
    Replies: 36
    Last Post: - 12th November 2008, 19:54
  2. Replies: 14
    Last Post: - 26th September 2007, 05:41
  3. Problems with RC2 and RC3
    By Christopher4187 in forum General
    Replies: 11
    Last Post: - 29th May 2006, 17:19
  4. RF Transmitter
    By et_Fong in forum mel PIC BASIC Pro
    Replies: 4
    Last Post: - 27th October 2005, 16:34
  5. Output PIC module
    By freelancebee in forum mel PIC BASIC Pro
    Replies: 5
    Last Post: - 12th September 2005, 20:10

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