• AVR Freaks

Hot!timer0 h not in bank0 ?

Author
Chabb
New Member
  • Total Posts : 22
  • Reward points : 0
  • Joined: 2019/11/14 10:16:01
  • Location: 0
  • Status: offline
2019/11/15 04:09:45 (permalink)
0

timer0 h not in bank0 ?

MPLABX ide V5.30 under window 7 Please where is in memory Timer0h.
The instruction : movff tempo,tmr0h (tempo is a file rgister) result in error
Timer0h is not in bank 0
#1

11 Replies Related Threads

    ric
    Super Member
    • Total Posts : 24593
    • Reward points : 0
    • Joined: 2003/11/07 12:41:26
    • Location: Australia, Melbourne
    • Status: offline
    Re: timer0 h not in bank0 ? 2019/11/15 12:58:51 (permalink)
    +1 (1)
    You have started three topics all at once, but not mentioned WHICH PIC you are using in any of them.
    The only hint is a mention of the "MOVFF" instruction in this topic, so it must be a member of the PIC18F family.
    It is impossible for anyone to answer your questions if you don't reveal the actual device.
     

    I also post at: PicForum
    Links to useful PIC information: http://picforum.ric323.co...opic.php?f=59&t=15
    NEW USERS: Posting images, links and code - workaround for restrictions.
    To get a useful answer, always state which PIC you are using!
    #2
    mpgmike
    Super Member
    • Total Posts : 332
    • Reward points : 0
    • Joined: 2014/01/23 17:27:06
    • Location: NJ
    • Status: offline
    Re: timer0 h not in bank0 ? 2019/11/16 03:50:07 (permalink)
    -1 (1)
    Are you sure it's an Error and not just a Warning?  MPLABX generates a Warning for virtually every thing you do that's not in Bank0 (ASM only).

    I don't need the world to know my name, but I want to live a life so all my great-grandchildren proudly remember me.
    #3
    1and0
    Access is Denied
    • Total Posts : 9989
    • Reward points : 0
    • Joined: 2007/05/06 12:03:20
    • Location: Harry's Gray Matter
    • Status: offline
    Re: timer0 h not in bank0 ? 2019/11/16 07:01:29 (permalink)
    +2 (2)
    mpgmike
    Are you sure it's an Error and not just a Warning?  MPLABX generates a Warning for virtually every thing you do that's not in Bank0 (ASM only).

    MPLABX does NOT generate such warning; MPASM does.  That "register in operand not in bank 0" is a message; it's neither an error nor a warning. Also, it does not apply to PIC18F devices. It does apply wrongly to the MOVFF instruction in the newer PIC18s.
    post edited by 1and0 - 2019/11/16 19:11:58
    #4
    1and0
    Access is Denied
    • Total Posts : 9989
    • Reward points : 0
    • Joined: 2007/05/06 12:03:20
    • Location: Harry's Gray Matter
    • Status: offline
    Re: timer0 h not in bank0 ? 2019/11/16 07:02:42 (permalink)
    +2 (2)
    Chabb
    MPLABX ide V5.30 under window 7 Please where is in memory Timer0h.
    The instruction : movff tempo,tmr0h (tempo is a file rgister) result in error
    Timer0h is not in bank 0

    Timer0h does not appear in that instruction. ;)  That is, Timer0h is NOT the same as tmr0h!
     
    #5
    Chabb
    New Member
    • Total Posts : 22
    • Reward points : 0
    • Joined: 2019/11/14 10:16:01
    • Location: 0
    • Status: offline
    Re: timer0 h not in bank0 ? 2019/11/16 17:18:40 (permalink)
    0
    i am usign a pic 18f25k42. instruction movff tempo,tmr0h generates a warning : Operand not in bank 0.
    Thank you for your Mail and your response off my problems. I used the same program with mplab 8.91
    and Pic 18f2520 it worked perfectly. Ok it is not an error it's a warning but tmr0h is not loaded whit "tempo".
    tmr0L counts fosc/4 prescal 1/16 generates an interrupt eatch time 255+1 T0con0 is = 90hexa (bit 4 = 16 bits mode).
    #6
    1and0
    Access is Denied
    • Total Posts : 9989
    • Reward points : 0
    • Joined: 2007/05/06 12:03:20
    • Location: Harry's Gray Matter
    • Status: offline
    Re: timer0 h not in bank0 ? 2019/11/16 18:16:04 (permalink)
    +1 (1)
    Chabb
    i am usign a pic 18f25k42. instruction movff tempo,tmr0h generates a warning : Operand not in bank 0.
     

    You must have disabled the default setting of case sensitivity. That is, tmr0h is actually TMR0H, a SFR that is located in the upper bank where MOVFF cannot access. Use either MOVF/MOVWF with correct banking or MOVFFL.
    #7
    1and0
    Access is Denied
    • Total Posts : 9989
    • Reward points : 0
    • Joined: 2007/05/06 12:03:20
    • Location: Harry's Gray Matter
    • Status: offline
    Re: timer0 h not in bank0 ? 2019/11/16 18:43:51 (permalink)
    0
    In my opinion,
    Message[302] Register in operand not in bank 0.  Ensure that bank bits are correct.

    is the wrong message to indicate MOVFF instruction incorrectly accessing a SFR in the upper bank, as MOVFF does not use banking at all.
    #8
    ric
    Super Member
    • Total Posts : 24593
    • Reward points : 0
    • Joined: 2003/11/07 12:41:26
    • Location: Australia, Melbourne
    • Status: offline
    Re: timer0 h not in bank0 ? 2019/11/16 22:43:39 (permalink)
    +2 (2)
    Chabb
    i am usign a pic 18f25k42. instruction movff tempo,tmr0h generates a warning : Operand not in bank 0.

    THIS is the vital information that should have been in your first post.
    The K42 chips have an expanded address space different to smaller PIC18F chips.
    The MOVFF instruction can only access the lower 4k of memory, and the SFR registers like TMR0H are outside that space. You can only access them using the MOVFFL instruction.
     

    Thank you for your Mail and your response off my problems. I used the same program with mplab 8.91
    and Pic 18f2520 it worked perfectly.

    That is because the MOVFF instruction can access all of memory in a PIC18F2520 chip
     

    I also post at: PicForum
    Links to useful PIC information: http://picforum.ric323.co...opic.php?f=59&t=15
    NEW USERS: Posting images, links and code - workaround for restrictions.
    To get a useful answer, always state which PIC you are using!
    #9
    Chabb
    New Member
    • Total Posts : 22
    • Reward points : 0
    • Joined: 2019/11/14 10:16:01
    • Location: 0
    • Status: offline
    Re: timer0 h not in bank0 ? 2019/11/18 03:20:20 (permalink)
    0
    Thank you 1and0 for your interest to my problem.Thank you Ric. I have replaced movff by
    movf tempo,w then movwf tmr0h. the warning disappears. Timer 0 does not counts on 16
    bits (bit 4 t0con0 = 1) an interrupt is genereted eatch time tmr0l overruns tmr0h never progress.
    #10
    ric
    Super Member
    • Total Posts : 24593
    • Reward points : 0
    • Joined: 2003/11/07 12:41:26
    • Location: Australia, Melbourne
    • Status: offline
    Re: timer0 h not in bank0 ? 2019/11/18 03:32:12 (permalink)
    +1 (1)
    Chabb
     tmr0h never progress.

    How do you know?
    In 16 bit mode, TMR0H is buffered, so it won't change if you're not reading TMR0L first.
     

    I also post at: PicForum
    Links to useful PIC information: http://picforum.ric323.co...opic.php?f=59&t=15
    NEW USERS: Posting images, links and code - workaround for restrictions.
    To get a useful answer, always state which PIC you are using!
    #11
    1and0
    Access is Denied
    • Total Posts : 9989
    • Reward points : 0
    • Joined: 2007/05/06 12:03:20
    • Location: Harry's Gray Matter
    • Status: offline
    Re: timer0 h not in bank0 ? 2019/11/18 04:50:16 (permalink)
    +1 (1)
    Chabb
    Timer 0 does not counts on 16
    bits (bit 4 t0con0 = 1) an interrupt is genereted eatch time tmr0l overruns tmr0h never progress.

    As Ric said, TMR0H is a buffered version of the high byte of Timer0.  In the Simulator, take a look at TMR0_Internal instead.
    #12
    Jump to:
    © 2019 APG vNext Commercial Version 4.5