16f877a: PCLATH register


Closed Thread
Results 1 to 10 of 10

Hybrid View

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


    Did you find this post helpful? Yes | No

    Wink No Magic here ...

    Hi, Hervé

    Here an example ( ASM source ... )

    REDCYL ;SUB pour lire SEUIL et NCYL
    movlw 1 ;Aller dans LTABLE chercher le SEUIL (negatif)
    ;de ligne rouge
    bcf PCLATH,0 ;LTABLE est la page 2(en h200)
    bsf PCLATH,1 ;donc PCLATH =2
    call LTABLE

    and somewhere further

    LTABLE org h'200' ;Table des delais N =367 - 1500 t/mn(0° avant,soit T/4)
    addwf PCL,f ;sauter au bon endroit h34=opcode pour RETLW

    INCLUDE c:\aepl\Oltab.txt ;ici la LTABLE préalablement générée par le prog. gentab.bas


    The goal is to retrieve a value in a Lookup table ...

    BUT you NEED to know the page number ... where you want to jump to !!!

    So, a solution is to place " manually" your called stubb to a known location ( not "squatted" ) by PbP ... :

    ORG xxxx

    CalledStubb
    .....
    .....

    PbP example

    '************************************************* ****************************
    'Table des Valeurs d'avance en 200h - longueur Maxi 254 lignes !!!
    '************************************************* ****************************

    asm

    bcf PCLATH,0
    bsf PCLATH,1

    call Table

    Movwf _Avance

    endasm

    and further, at the very top high free program location.

    asm


    ORG 200h
    Table

    movfw _Index
    addwf PCL,F

    Include C:\Documents and Settings\Alain\Mes documents\Avance.txt


    endasm

    END

    No secret there ...

    Bonnes vacances ...

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

  2. #2
    herve's Avatar
    herve Guest


    Did you find this post helpful? Yes | No

    Smile 16f877a: 306 message

    Hi everybody,
    Thank you for all your elements. I am waiting for the week-end to analyse them in details (lack of time during the week !).

    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