16f877a: PCLATH register


Closed Thread
Results 1 to 10 of 10

Hybrid View

  1. #1
    herve's Avatar
    herve Guest

    Question 16f877a: PCLATH register

    Could somebody give me a simple example, showing how to use " PCLATH register", in a short program. My objective is to solve the message 306: Crossing page boundary - ensure page bits are set", which appears in my program. My program is done with MPLAB IDE V6.60.

    Thank you in advance,

    Best regards,

    Hervé.

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


    Did you find this post helpful? Yes | No

    Default

    Hi,Herve

    You can forget about Message 306 ... PBasic cares for you !!!

    It can be cancelled using :

    @ Errorlevel -306

    at the top of your program ...

    OR using PM Compiler ... !!!

    Now PCLATH permits to use a larger adressing range than an asm CALL allows, Look at fig 2.3 p 19 of the Datasheet : it explains the different BANKS of memory. PCLATH permits to choose one of these Banks.

    a look at page 32 will show you how addressing is done ...

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

  3. #3
    herve's Avatar
    herve Guest


    Did you find this post helpful? Yes | No

    Wink 16f877a: 306 message

    Hello Acetronics,
    I have already used "ERRORLEVEL - 306". It was OK to suppress the message, but when I launched the program, I faced with problems at the level where the message 306 was indicated (before the addition of "ERRORLEVEL-306"). So, I concluded that I could not ignore this message.

    I am going to analyse the datasheet, in accordance with your proposal, but could you give me a short example of program using PCLATH register, in order that it completes my analysis efficiency ?

    Thank you in advance,

    Best regards,

    Hervé.

  4. #4
    Join Date
    Feb 2003
    Location
    Salt Lake City, Utah USA
    Posts
    517


    Did you find this post helpful? Yes | No

    Smile

    Paul Borgmeier
    Salt Lake City, UT
    USA
    __________________

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


    Did you find this post helpful? Yes | No

    Wink THE good question ...

    Quote Originally Posted by herve
    Hello Acetronics,
    I faced with problems at the level where the message 306 was indicated , ... but could you give me a short example of program using PCLATH register, in order that it completes my analysis efficiency ?

    Hervé.
    Hi, Hervé

    Using pure PbP would never involve such problems ... sooooooo, WHAT do you do and want to do here ????????????????????

    My crystal ball is gone for holidays ...

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

  6. #6
    Join Date
    Mar 2003
    Location
    Commerce Michigan USA
    Posts
    1,166


    Did you find this post helpful? Yes | No

    Default

    herve, The message is just a warning. As long as you are not using the BRANCH statement you should be OK. If you are using the BRANCH statement in your program then change it to BRANCHL. This is the BranchLong statement and is used when branching to other parts of your program that are not in the same page (crossing page boundries).

    Dave Purola,
    N8NTA

  7. #7
    herve's Avatar
    herve Guest


    Did you find this post helpful? Yes | No

    Unhappy 16f877a: message 306 / PCLATH

    Hello Dave and Alain,
    I am not using any "BRANCH procedure". My program is only using a lot of "GOTO" and "CALL" instructions. People explained me that this large number of "GOTO" and "CALL" is the reason why there is the message 306 (Crossing page boundary -- ensure page bits are set): the pic program memory (where my program is saved) is divided into pages due to limitation in the program counter size that can't carry the whole address bits for the whole memory. My program may have exceeded the size of one page so it crossed the page boundries to the next page. So the pc (program counter) overflowed.

    The solution would be to adjust PCLATH register.

    That is why I would like someone to give me an example of PCLATH use, through a short program, in order that I could know how to do with this PCLATH.

    If you could help me, I thank you in advance,

    Best regards,

    Hervé.

Similar Threads

  1. Active low input?
    By CosMecc in forum mel PIC BASIC Pro
    Replies: 14
    Last Post: - 8th August 2010, 20:31
  2. Can anyone help a newcomer?
    By scopit in forum Schematics
    Replies: 18
    Last Post: - 20th October 2009, 09:23
  3. PIC16F877A pwm use for IR transmission
    By mcbeasleyjr in forum General
    Replies: 0
    Last Post: - 11th July 2009, 18:51
  4. MX7705 or AD7705 experience
    By FM11 in forum mel PIC BASIC Pro
    Replies: 1
    Last Post: - 12th January 2006, 21:54
  5. Problems with 16F877A code
    By NightHawk2 in forum mel PIC BASIC Pro
    Replies: 1
    Last Post: - 20th August 2003, 01:36

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